@@ -60,6 +60,13 @@ run_prove() {
6060 kprove --directory " $backend_dir " " $run_file " " $@ "
6161}
6262
63+ run_search () {
64+ local search_pattern
65+ search_pattern=" $1 " ; shift
66+ export K_OPTS=-Xmx8G
67+ run_krun --search --pattern " $search_pattern " " $@ "
68+ }
69+
6370run_klab () {
6471 local run_mode klab_log
6572
@@ -132,6 +139,7 @@ if [[ "$run_command" == 'help' ]]; then
132139 $0 interpret [--backend (ocaml|llvm)] <pgm> <interpreter arg>*
133140 $0 kast [--backend (ocaml|java)] <pgm> <output format> <K arg>*
134141 $0 prove [--backend (java|haskell)] <spec> <K arg>* -m <def_module>
142+ $0 search [--backend (java|haskell)] <pgm> <pattern> <K arg>*
135143 $0 klab-run <pgm> <K arg>*
136144 $0 klab-prove <spec> <K arg>* -m <def_module>
137145 $0 klab-view <spec>
@@ -140,6 +148,7 @@ if [[ "$run_command" == 'help' ]]; then
140148 $0 interpret : Run JSON EVM programs without K Frontend (external parser)
141149 $0 kast : Parse an EVM program and output it in a supported format
142150 $0 prove : Run an EVM K proof
151+ $0 search : Search for a K pattern in an EVM program execution
143152 $0 klab-(run|prove) : Run program or prove spec and dump StateLogs which KLab can read
144153 $0 klab-view : View the statelog associated with a given program or spec
145154
@@ -148,6 +157,7 @@ if [[ "$run_command" == 'help' ]]; then
148157 <K arg> is an argument you want to pass to K.
149158 <interpreter arg> is an argument you want to pass to the derived interpreter.
150159 <output format> is the format for Kast to output the term in.
160+ <pattern> is the configuration pattern to search for.
151161 <def_module> is the module to take as axioms when doing verification.
152162
153163 klab-view: Make sure that the 'klab/bin' directory is on your PATH to use this option.
@@ -179,6 +189,7 @@ case "$run_command-$backend" in
179189 kast-@ (ocaml| java| llvm| haskell) ) run_kast " $@ " ;;
180190 interpret-@ (ocaml| llvm) ) run_interpret " $@ " ;;
181191 prove-@ (java| haskell) ) run_prove " $@ " ;;
192+ search-@ (java| haskell) ) run_search " $@ " ;;
182193 klab-@ (run| prove)-java ) run_klab " ${run_command# klab-} " " $@ " ;;
183194 klab-view-java ) view_klab " $@ " ;;
184195 * ) $0 help ; fatal " Unknown command on backend: $run_command $backend " ;;
0 commit comments