@@ -385,34 +385,35 @@ def prove_it(id_and_cfg: Tuple[str, Tuple[KCFG, Path]]) -> bool:
385
385
f'Target state reached at depth { depth } , inserted edge from { shorten_hashes ((curr_node .id ))} to { shorten_hashes ((target_node .id ))} .'
386
386
)
387
387
388
- next_state = CTerm (sanitize_config (foundry .definition , result ))
389
- next_node = cfg .get_or_create_node (next_state )
390
- if next_node != curr_node :
391
- _LOGGER .info (f'Found basic block at depth { depth } : { shorten_hashes ((curr_node .id , next_node .id ))} .' )
392
- cfg .create_edge (curr_node .id , next_node .id , mlTop (), depth )
393
-
394
- if KEVM .is_terminal (next_node .cterm ):
395
- cfg .add_expanded (next_node .id )
396
- _LOGGER .info (f'Terminal node: { shorten_hashes ((curr_node .id ))} .' )
397
-
398
- elif branching :
399
- branches = KEVM .extract_branches (next_state )
400
- if not branches :
401
- raise ValueError (
402
- f'Could not extract branch condition:\n { foundry .pretty_print (minimize_term (result ))} '
388
+ else :
389
+ next_state = CTerm (sanitize_config (foundry .definition , result ))
390
+ next_node = cfg .get_or_create_node (next_state )
391
+ if next_node != curr_node :
392
+ _LOGGER .info (f'Found basic block at depth { depth } : { shorten_hashes ((curr_node .id , next_node .id ))} .' )
393
+ cfg .create_edge (curr_node .id , next_node .id , mlTop (), depth )
394
+
395
+ if KEVM .is_terminal (next_node .cterm ):
396
+ cfg .add_expanded (next_node .id )
397
+ _LOGGER .info (f'Terminal node: { shorten_hashes ((curr_node .id ))} .' )
398
+
399
+ elif branching :
400
+ branches = KEVM .extract_branches (next_state )
401
+ if not branches :
402
+ raise ValueError (
403
+ f'Could not extract branch condition:\n { foundry .pretty_print (minimize_term (result ))} '
404
+ )
405
+ cfg .add_expanded (next_node .id )
406
+ _LOGGER .info (
407
+ f'Found { len (list (branches ))} branches at depth { depth } : { [foundry .pretty_print (b ) for b in branches ]} '
403
408
)
404
- cfg .add_expanded (next_node .id )
405
- _LOGGER .info (
406
- f'Found { len (list (branches ))} branches at depth { depth } : { [foundry .pretty_print (b ) for b in branches ]} '
407
- )
408
- for branch in branches :
409
- branch_cterm = next_state .add_constraint (branch )
410
- branch_node = cfg .get_or_create_node (branch_cterm )
411
- cfg .create_edge (next_node .id , branch_node .id , branch , 0 )
412
- _LOGGER .info (f'Made split: { shorten_hashes ((next_node .id , branch_node .id ))} ' )
413
- # TODO: have to store case splits as rewrites because of how frontier is handled for covers
414
- # cfg.create_cover(branch_node.id, next_node.id)
415
- # _LOGGER.info(f'Made cover: {shorten_hashes((branch_node.id, next_node.id))}')
409
+ for branch in branches :
410
+ branch_cterm = next_state .add_constraint (branch )
411
+ branch_node = cfg .get_or_create_node (branch_cterm )
412
+ cfg .create_edge (next_node .id , branch_node .id , branch , 0 )
413
+ _LOGGER .info (f'Made split: { shorten_hashes ((next_node .id , branch_node .id ))} ' )
414
+ # TODO: have to store case splits as rewrites because of how frontier is handled for covers
415
+ # cfg.create_cover(branch_node.id, next_node.id)
416
+ # _LOGGER.info(f'Made cover: {shorten_hashes((branch_node.id, next_node.id))}')
416
417
417
418
_write_cfg (cfg , cfgpath )
418
419
0 commit comments