@@ -492,6 +492,30 @@ def exec_foundry_show_cfg(
492
492
print (f'\n \n State Delta { node_id_1 } => { node_id_2 } :\n \n { foundry .pretty_print (config_delta )} \n ' )
493
493
494
494
495
+ def exec_foundry_list (
496
+ profile : bool ,
497
+ foundry_out : Path ,
498
+ details : bool = True ,
499
+ ** kwargs : Any ,
500
+ ) -> None :
501
+ kcfgs_dir = foundry_out / 'kcfgs'
502
+ pattern = '*.json'
503
+ paths = kcfgs_dir .glob (pattern )
504
+ for kcfg_file in paths :
505
+ with open (kcfg_file , 'r' ) as kf :
506
+ kcfg = KCFG .from_dict (json .loads (kf .read ()))
507
+ total_nodes = len (kcfg .nodes )
508
+ frontier_nodes = len (kcfg .frontier )
509
+ stuck_nodes = len (kcfg .stuck )
510
+ proven = 'passed' if frontier_nodes + stuck_nodes == 0 else 'failed'
511
+ print (f'{ kcfg_file } : { proven } ' )
512
+ if details :
513
+ print (f' nodes: { total_nodes } ' )
514
+ print (f' frontier: { frontier_nodes } ' )
515
+ print (f' stuck: { stuck_nodes } ' )
516
+ print ()
517
+
518
+
495
519
def exec_run (
496
520
definition_dir : Path ,
497
521
profile : bool ,
@@ -790,6 +814,17 @@ def parse(s: str) -> List[T]:
790
814
'--no-minimize' , dest = 'minimize' , action = 'store_false' , help = 'Do not minimize output.'
791
815
)
792
816
817
+ foundry_list_args = command_parser .add_parser (
818
+ 'foundry-list' ,
819
+ help = 'List information about KCFGs on disk' ,
820
+ parents = [shared_args , k_args ],
821
+ )
822
+ foundry_list_args .add_argument ('foundry_out' , type = dir_path , help = 'Path to Foundry output directory.' )
823
+ foundry_list_args .add_argument (
824
+ '--details' , dest = 'details' , default = True , action = 'store_true' , help = 'Information about progress on each KCFG.'
825
+ )
826
+ foundry_list_args .add_argument ('--no-details' , dest = 'details' , action = 'store_false' , help = 'Just list the KCFGs.' )
827
+
793
828
return parser
794
829
795
830
0 commit comments