The symbolic execution engine powering the K Framework
Kore is the "core" part of the K framework.
In short, we need a formal semantics of K. In K, users can define formal syntax and semantics of programming languages as K definitions, and automatically obtain parsers, interpreters, compilers, and various verification tools for their languages. Therefore K is a language-independent framework.
Thanks to years of research in matching logic and reachability logic, we know that all K does can be nicely formalized as logic reasoning in matching logic. To give K a formal semantics, we only need to formally specify the underlying matching logic theories with which K does reasoning. In practice, these underlying theories are complex and often infinite, and it is tricky to specify infinite theories without a carefully designed formal specification language. And Kore is such a language.
The docs directory contains a collection of documents that describe the mathematical foundation of Kore and a BNF grammar that defines the syntax of Kore language. See /docs/introduction.md for an overview of the components of Kore.
koreproject is an implementation in Haskell of a Kore parser and symbolic execution engine, for use with the K Framework as a backend.
stack build kore # or cabal build kore
cabal, version 3.0 or later is recommended.
make all # builds all binaries
If you are building the project on an Apple Silicon machine, a temporary workaround is necessary to install a new enough version of GHC with support for ARM64 Darwin. To do so, follow the instructions in this comment. The command-line flags for
stackshould then be specified everywhere an execution of
stackis required. For
makeinvocations in this project, set the environment variable
STACK_BUILD_OPTS=--compiler ghc-8.10.7 --system-ghc.
ghcmerge their full support for ARM64 Darwin in future releases, it should be possible to remove this workaround.
Developers will require all the dependencies listed above, in addition to the requirements and recommendations below.
For integration testing, we require:
Instead of installing the frontend, you can use our
Dockerfileto run the integration tests inside a container. Use
docker.shto run commands inside the container:
./docker/build.sh # run once when dependencies change ./docker/run.sh make all # build the backend ./docker/run.sh make test # run all tests ./docker/run.sh make -C test/imp test # run all tests in test/imp
For setting up a development environment, we recommend:
./entr.shto keep important files up-to-date.
We recommend to keep
./entr.shrunning in the background to keep important files (such as package descriptions) up-to-date, especially if the developer is using Cabal.
To run a language server, developers will need to activate the appropriate
ln -s hie-stack.yaml hie.yaml # for Stack # or ln -s hie-cabal.yaml hie.yaml # for Cabal # or ln -s hie-bios.yaml hie.yaml # if all else fails
The project's dependencies must be installed before starting the language server:
stack build --test --bench --only-dependencies # or cabal build --enable-tests --enable-benchmarks --only-dependencies kore
We provide a
shell.nixexpression with a suitable development environment and a binary cache at runtimeverification.cachix.org. The development environment is intended to be used with
.cabalpackage description file changes, run:
# Requires Nix to be installed. ./nix/rematerialize.sh
This script is also run by an automatic workflow.
We provide a
test.nixfor running integration tests:
nix-build test.nix # run all integration tests nix-build test.nix --argstr test imp # run the integration tests in test/imp nix-shell test.nix # enter a shell where we can run tests manually