@@ -372,13 +372,17 @@ def prove_it(id_and_cfg: Tuple[str, Tuple[KCFG, Path]]) -> bool:
372
372
iterations += 1
373
373
curr_node = cfg .frontier [0 ]
374
374
375
+ _LOGGER .info (
376
+ f'Checking subsumption into target state { cfgid } : { shorten_hashes ((curr_node .id , target_node .id ))} '
377
+ )
375
378
if subst := foundry .check_implication (curr_node .cterm , target_node .cterm ):
376
379
cfg .create_cover (curr_node .id , target_node .id , witness = (subst , mlTop ()))
377
380
_LOGGER .info (f'Subsumed into target node: { shorten_hashes ((curr_node .id , target_node .id ))} ' )
378
381
continue
379
382
380
383
cfg .add_expanded (curr_node .id )
381
384
385
+ _LOGGER .info (f'Checking terminal node { cfgid } : { shorten_hashes ((curr_node .id ))} ' )
382
386
if KEVM .is_terminal (curr_node .cterm ):
383
387
_LOGGER .info (f'Terminal node { cfgid } : { shorten_hashes ((curr_node .id ))} .' )
384
388
continue
@@ -389,28 +393,27 @@ def prove_it(id_and_cfg: Tuple[str, Tuple[KCFG, Path]]) -> bool:
389
393
_LOGGER .info (f'Found stuck node { cfgid } : { shorten_hashes (curr_node .id )} ' )
390
394
continue
391
395
392
- # next_state = CTerm(sanitize_config(foundry.definition, cterm.kast))
393
- next_state = cterm
394
- next_node = cfg .get_or_create_node (next_state )
396
+ next_node = cfg .get_or_create_node (cterm )
397
+ cfg .create_edge (curr_node .id , next_node .id , mlTop (), depth )
395
398
_LOGGER .info (
396
399
f'Found basic block at depth { depth } for { cfgid } : { shorten_hashes ((curr_node .id , next_node .id ))} .'
397
400
)
398
- cfg .create_edge (curr_node .id , next_node .id , mlTop (), depth )
399
401
400
402
if len (next_cterms ) == 0 :
401
403
continue
402
404
403
405
if len (next_cterms ) == 1 :
404
406
raise ValueError (f'Found a single successor cterm: { (depth , cterm , next_cterms )} ' )
405
407
408
+ _LOGGER .info (f'Extracting branchings from node in { cfgid } : { shorten_hashes ((curr_node .id ))} ' )
406
409
cfg .add_expanded (next_node .id )
407
- branches = KEVM .extract_branches (next_state )
410
+ branches = KEVM .extract_branches (cterm )
408
411
if len (list (branches )) > 0 :
409
412
_LOGGER .info (
410
413
f'Found { len (list (branches ))} branches at depth { depth } for { cfgid } : { [foundry .pretty_print (b ) for b in branches ]} '
411
414
)
412
415
for branch in branches :
413
- branch_cterm = next_state .add_constraint (branch )
416
+ branch_cterm = cterm .add_constraint (branch )
414
417
branch_node = cfg .get_or_create_node (branch_cterm )
415
418
cfg .create_edge (next_node .id , branch_node .id , branch , 0 )
416
419
_LOGGER .info (f'Made split for { cfgid } : { shorten_hashes ((next_node .id , branch_node .id ))} ' )
@@ -419,9 +422,7 @@ def prove_it(id_and_cfg: Tuple[str, Tuple[KCFG, Path]]) -> bool:
419
422
# _LOGGER.info(f'Made cover: {shorten_hashes((branch_node.id, next_node.id))}')
420
423
else :
421
424
_LOGGER .warning (f'Falling back to extracted next states for { cfgid } :\n { next_node .id } ' )
422
- branch_constraints = [
423
- [c for c in s .constraints if c not in next_state .constraints ] for s in next_cterms
424
- ]
425
+ branch_constraints = [[c for c in s .constraints if c not in cterm .constraints ] for s in next_cterms ]
425
426
_LOGGER .info (
426
427
f'Found { len (list (next_cterms ))} branches manually at depth 1 for { cfgid } : { [foundry .pretty_print (mlAnd (bc )) for bc in branch_constraints ]} '
427
428
)
0 commit comments