Skip to content

Commit 9e43323

Browse files
committed
kevm-pyk/__main__: execute endpoint returns CTerms
1 parent 503ae60 commit 9e43323

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

kevm-pyk/src/kevm_pyk/__main__.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -380,21 +380,23 @@ def prove_it(id_and_cfg: Tuple[str, Tuple[KCFG, Path]]) -> bool:
380380
continue
381381

382382
_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)
384384
if depth == 0:
385385
_LOGGER.info(f'Found stuck node {cfgid}: {shorten_hashes(curr_node.id)}')
386386
continue
387387

388-
next_state = CTerm(sanitize_config(foundry.definition, term))
388+
next_state = CTerm(sanitize_config(foundry.definition, cterm.kast))
389389
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+
)
391393
cfg.create_edge(curr_node.id, next_node.id, mlTop(), depth)
392394

393-
if len(next_terms) == 0:
395+
if len(next_cterms) == 0:
394396
continue
395397

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)}')
398400

399401
cfg.add_expanded(next_node.id)
400402
branches = KEVM.extract_branches(next_state)
@@ -412,14 +414,13 @@ def prove_it(id_and_cfg: Tuple[str, Tuple[KCFG, Path]]) -> bool:
412414
# _LOGGER.info(f'Made cover: {shorten_hashes((branch_node.id, next_node.id))}')
413415
else:
414416
_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]
416417
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
418419
]
419420
_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]}'
421422
)
422-
for bs, bc in zip(branch_cterms, branch_constraints):
423+
for bs, bc in zip(next_cterms, branch_constraints):
423424
branch_node = cfg.get_or_create_node(bs)
424425
cfg.create_edge(next_node.id, branch_node.id, mlAnd(bc), 1)
425426

0 commit comments

Comments
 (0)