-
Notifications
You must be signed in to change notification settings - Fork 43
Kore REPL
The Kore REPL is currently under early active development. Breaking changes may occur at any time.
In order to see the execution graph (the graph
command), you will need graphviz
installed (and dot
available in your path). This option currently only works on Linux.
In the root of the repository:
$ make k-frontend
$ stack build
The REPL is currently setup to work with the imp
proofs under the repository:
$ cd src/main/k/working/imp
$ make prove/max-spec.krepl
The kore-repl
executable can be ran with any other languages/definitions.
You can run it with kprove
, for example:
$ kprove --haskell-backend-command "/path/to/kore-repl " -d . -m VERIFICATION spec.k
In order to get the path to kore-repl
, you can run stack exec -- which kore-repl
.
Alternatively, you can run kore-repl
directly:
$ /path/to/kore-repl path/to/vdefinition.kore --module VERIFICATION --prove /path/to/spec.kore --spec-module SPEC-NAME
Note you will have to manually compile to kore
to obtain vdefinition.kore
and spec.kore
if you chose to run kore-repl
yourself.
You can interrupt the repl
while it is evaluating steps in order to stop long-running/infinite loops by pressing Ctrl-C
. Please note that this not work if you run the repl through kprove
. See above for how to run kore-repl
directly.
The repl
can execute commands from a file. When supplying a repl script file as a command line argument, the repl
can be run in two modes: interactive (default) or run-mode. After a script is executed in interactive mode you will be taken to the repl
prompt. Running a script in run-mode will output the status of the proof after executing the script and exit. You can also load scripts while inside the repl
by using the load
command.
Command line arguments for when running kore-repl
directly (as above):
-
--run-mode
or-r
: flag to run in run-mode; if you omit this argument you will run therepl
in interactive mode -
--repl-script
: path to the script
So, in order to run using in run-mode using script.krepl
found in the current directory:
$ /path/to/kore-repl path/to/vdefinition.kore --module VERIFICATION --prove /path/to/spec.kore --spec-module SPEC-NAME --repl-script script.krepl --run-mode
Exit codes for run-mode:
-
exit code 0
: successful execution and proof was completed -
exit code 1
: error during execution -
exit code 2
: successful execution but proof was not finished