3232from pyk .proof .tui import APRProofViewer
3333from pyk .utils import FrozenDict , hash_str , single
3434
35+ from kevm_pyk .interpreter import iterate_gst
3536from kevm_pyk .summarizer import batch_summarize , clear_proofs , summarize
3637
3738from . import VERSION , config
4142 get_argument_type_setter ,
4243 get_option_string_destination ,
4344)
44- from .gst_to_kore import SORT_ETHEREUM_SIMULATION , filter_gst_keys , gst_to_kore , kore_pgm_to_kore
45+ from .gst_to_kore import SORT_ETHEREUM_SIMULATION , kore_pgm_to_kore
4546from .kevm import KEVM , KEVMSemantics , kevm_node_printer
4647from .kompile import KompileTarget , kevm_kompile
4748from .utils import (
@@ -598,26 +599,38 @@ def exec_run(options: RunOptions) -> None:
598599
599600 try :
600601 json_read = json .loads (options .input_file .read_text ())
601- gst_data = filter_gst_keys (json_read )
602- kore_pattern = gst_to_kore (gst_data , options .schedule , options .mode , options .chainid , options .usegas )
602+ if options .gst_name :
603+ json_read = {options .gst_name : json_read [options .gst_name ]}
604+ kore_pattern_list = [
605+ (name , kore )
606+ for (name , kore ) in iterate_gst (json_read , options .schedule , options .mode , options .chainid , options .usegas )
607+ ]
603608 except json .JSONDecodeError :
604609 pgm_token = KToken (options .input_file .read_text (), KSort ('EthereumSimulation' ))
605610 kast_pgm = kevm .parse_token (pgm_token )
606611 kore_pgm = kevm .kast_to_kore (kast_pgm , sort = KSort ('EthereumSimulation' ))
607- kore_pattern = kore_pgm_to_kore (
608- kore_pgm , SORT_ETHEREUM_SIMULATION , options .schedule , options .mode , options .chainid , options .usegas
612+ kore_pattern_list = [
613+ (
614+ '' ,
615+ kore_pgm_to_kore (
616+ kore_pgm , SORT_ETHEREUM_SIMULATION , options .schedule , options .mode , options .chainid , options .usegas
617+ ),
618+ ),
619+ ]
620+
621+ for name , kore_pattern in kore_pattern_list :
622+ if name :
623+ _LOGGER .info (f'Processing test - { name } ' )
624+ kevm .run (
625+ kore_pattern ,
626+ depth = options .depth ,
627+ term = True ,
628+ expand_macros = options .expand_macros ,
629+ output = options .output ,
630+ check = True ,
631+ debugger = options .debugger ,
609632 )
610633
611- kevm .run (
612- kore_pattern ,
613- depth = options .depth ,
614- term = True ,
615- expand_macros = options .expand_macros ,
616- output = options .output ,
617- check = True ,
618- debugger = options .debugger ,
619- )
620-
621634
622635def exec_kast (options : KastOptions ) -> None :
623636 target = options .target or 'llvm'
@@ -628,17 +641,30 @@ def exec_kast(options: KastOptions) -> None:
628641
629642 try :
630643 json_read = json .loads (options .input_file .read_text ())
631- kore_pattern = gst_to_kore (json_read , options .schedule , options .mode , options .chainid , options .usegas )
644+ if options .gst_name :
645+ json_read = {options .gst_name : json_read [options .gst_name ]}
646+ kore_pattern_list = [
647+ (name , kore )
648+ for (name , kore ) in iterate_gst (json_read , options .schedule , options .mode , options .chainid , options .usegas )
649+ ]
632650 except json .JSONDecodeError :
633651 pgm_token = KToken (options .input_file .read_text (), KSort ('EthereumSimulation' ))
634652 kast_pgm = kevm .parse_token (pgm_token )
635653 kore_pgm = kevm .kast_to_kore (kast_pgm )
636- kore_pattern = kore_pgm_to_kore (
637- kore_pgm , SORT_ETHEREUM_SIMULATION , options .schedule , options .mode , options .chainid , options .usegas
638- )
639-
640- output_text = kore_print (kore_pattern , definition_dir = kevm .definition_dir , output = options .output )
641- print (output_text )
654+ kore_pattern_list = [
655+ (
656+ '' ,
657+ kore_pgm_to_kore (
658+ kore_pgm , SORT_ETHEREUM_SIMULATION , options .schedule , options .mode , options .chainid , options .usegas
659+ ),
660+ ),
661+ ]
662+
663+ for name , kore_pattern in kore_pattern_list :
664+ if name :
665+ _LOGGER .info (f'Processing test - { name } ' )
666+ output_text = kore_print (kore_pattern , definition_dir = kevm .definition_dir , output = options .output )
667+ print (output_text )
642668
643669
644670def exec_summarize (options : SummarizeOptions ) -> None :
0 commit comments