Skip to content

Commit 25ae6e2

Browse files
committed
kevm-pyk/__main__: better logging/error messages
1 parent 9ec9e9a commit 25ae6e2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

kevm-pyk/src/kevm_pyk/__main__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def prove_it(id_and_cfg: Tuple[str, Tuple[KCFG, Path]]) -> bool:
377377
iterations += 1
378378
curr_node = cfg.frontier[0]
379379
cfg.add_expanded(curr_node.id)
380-
_LOGGER.info(f'Advancing proof from node: {shorten_hashes(curr_node.id)}')
380+
_LOGGER.info(f'Advancing proof from node {cfgid}: {shorten_hashes(curr_node.id)}')
381381
edge = KCFG.Edge(curr_node, target_node, mlTop(), -1)
382382
claim = edge.to_claim()
383383
claim_id = f'gen-{curr_node.id}-to-{target_node.id}'
@@ -388,35 +388,35 @@ def prove_it(id_and_cfg: Tuple[str, Tuple[KCFG, Path]]) -> bool:
388388
if result == mlTop():
389389
cfg.create_edge(curr_node.id, target_node.id, mlTop(), depth)
390390
_LOGGER.info(
391-
f'Target state reached at depth {depth}, inserted edge from {shorten_hashes((curr_node.id))} to {shorten_hashes((target_node.id))}.'
391+
f'Target state reached at depth {depth} for {cfgid}: {shorten_hashes((curr_node.id, target_node.id))}.'
392392
)
393393

394394
else:
395395
next_state = CTerm(sanitize_config(foundry.definition, result))
396396
next_node = cfg.get_or_create_node(next_state)
397397
if next_node != curr_node:
398-
_LOGGER.info(f'Found basic block at depth {depth}: {shorten_hashes((curr_node.id, next_node.id))}.')
398+
_LOGGER.info(f'Found basic block at depth {depth} for {cfgid}: {shorten_hashes((curr_node.id, next_node.id))}.')
399399
cfg.create_edge(curr_node.id, next_node.id, mlTop(), depth)
400400

401401
if KEVM.is_terminal(next_node.cterm):
402402
cfg.add_expanded(next_node.id)
403-
_LOGGER.info(f'Terminal node: {shorten_hashes((curr_node.id))}.')
403+
_LOGGER.info(f'Terminal node {cfgid}: {shorten_hashes((curr_node.id))}.')
404404

405405
elif branching:
406406
branches = KEVM.extract_branches(next_state)
407407
if not branches:
408408
raise ValueError(
409-
f'Could not extract branch condition:\n{foundry.pretty_print(minimize_term(result))}'
409+
f'Could not extract branch condition {cfgid}:\n{foundry.pretty_print(minimize_term(result))}'
410410
)
411411
cfg.add_expanded(next_node.id)
412412
_LOGGER.info(
413-
f'Found {len(list(branches))} branches at depth {depth}: {[foundry.pretty_print(b) for b in branches]}'
413+
f'Found {len(list(branches))} branches at depth {depth} for {cfgid}: {[foundry.pretty_print(b) for b in branches]}'
414414
)
415415
for branch in branches:
416416
branch_cterm = next_state.add_constraint(branch)
417417
branch_node = cfg.get_or_create_node(branch_cterm)
418418
cfg.create_edge(next_node.id, branch_node.id, branch, 0)
419-
_LOGGER.info(f'Made split: {shorten_hashes((next_node.id, branch_node.id))}')
419+
_LOGGER.info(f'Made split for {cfgid}: {shorten_hashes((next_node.id, branch_node.id))}')
420420
# TODO: have to store case splits as rewrites because of how frontier is handled for covers
421421
# cfg.create_cover(branch_node.id, next_node.id)
422422
# _LOGGER.info(f'Made cover: {shorten_hashes((branch_node.id, next_node.id))}')

0 commit comments

Comments
 (0)