@@ -380,21 +380,23 @@ def prove_it(id_and_cfg: Tuple[str, Tuple[KCFG, Path]]) -> bool:
380
380
continue
381
381
382
382
_LOGGER .info (f'Advancing proof from node { cfgid } : { shorten_hashes (curr_node .id )} ' )
383
- depth , term , next_terms = foundry .execute (curr_node .cterm , depth = max_depth )
383
+ depth , cterm , next_cterms = foundry .execute (curr_node .cterm , depth = max_depth )
384
384
if depth == 0 :
385
385
_LOGGER .info (f'Found stuck node { cfgid } : { shorten_hashes (curr_node .id )} ' )
386
386
continue
387
387
388
- next_state = CTerm (sanitize_config (foundry .definition , term ))
388
+ next_state = CTerm (sanitize_config (foundry .definition , cterm . kast ))
389
389
next_node = cfg .get_or_create_node (next_state )
390
- _LOGGER .info (f'Found basic block at depth { depth } for { cfgid } : { shorten_hashes ((curr_node .id , next_node .id ))} .' )
390
+ _LOGGER .info (
391
+ f'Found basic block at depth { depth } for { cfgid } : { shorten_hashes ((curr_node .id , next_node .id ))} .'
392
+ )
391
393
cfg .create_edge (curr_node .id , next_node .id , mlTop (), depth )
392
394
393
- if len (next_terms ) == 0 :
395
+ if len (next_cterms ) == 0 :
394
396
continue
395
397
396
- if len (next_terms ) == 1 :
397
- raise ValueError (f'Found a single successor term : { (depth , term , next_terms )} ' )
398
+ if len (next_cterms ) == 1 :
399
+ raise ValueError (f'Found a single successor cterm : { (depth , cterm , next_cterms )} ' )
398
400
399
401
cfg .add_expanded (next_node .id )
400
402
branches = KEVM .extract_branches (next_state )
@@ -412,14 +414,13 @@ def prove_it(id_and_cfg: Tuple[str, Tuple[KCFG, Path]]) -> bool:
412
414
# _LOGGER.info(f'Made cover: {shorten_hashes((branch_node.id, next_node.id))}')
413
415
else :
414
416
_LOGGER .warning (f'Falling back to extracted next states for { cfgid } :\n { next_node .id } ' )
415
- branch_cterms = [CTerm (nt ) for nt in next_terms ]
416
417
branch_constraints = [
417
- [c for c in s .constraints if c not in next_state .constraints ] for s in branch_cterms
418
+ [c for c in s .constraints if c not in next_state .constraints ] for s in next_cterms
418
419
]
419
420
_LOGGER .info (
420
- f'Found { len (list (branch_cterms ))} branches manually at depth 1 for { cfgid } : { [foundry .pretty_print (mlAnd (bc )) for bc in branch_constraints ]} '
421
+ f'Found { len (list (next_cterms ))} branches manually at depth 1 for { cfgid } : { [foundry .pretty_print (mlAnd (bc )) for bc in branch_constraints ]} '
421
422
)
422
- for bs , bc in zip (branch_cterms , branch_constraints ):
423
+ for bs , bc in zip (next_cterms , branch_constraints ):
423
424
branch_node = cfg .get_or_create_node (bs )
424
425
cfg .create_edge (next_node .id , branch_node .id , mlAnd (bc ), 1 )
425
426
0 commit comments