Skip to content

Commit 57c9f3b

Browse files
committed
kevm-pyk/foundry: no need to add invariants to initial KCFG again
1 parent ecc7790 commit 57c9f3b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

kevm-pyk/src/kevm_pyk/foundry.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,13 @@ def foundry_prove(
256256
method = [m for m in contract.methods if m.name == method_name][0]
257257
empty_config = foundry.definition.empty_config(GENERATED_TOP_CELL)
258258
kcfg = _method_to_cfg(empty_config, contract, method)
259-
init_term = kcfg.get_unique_init().cterm.kast
260-
target_term = kcfg.get_unique_target().cterm.kast
261259
_LOGGER.info(f'Expanding macros in initial state for test: {test}')
262-
init_term = KDefinition__expand_macros(foundry.definition, init_term)
263-
init_cterm = KEVM.add_invariant(CTerm(init_term))
264-
_LOGGER.info(f'Expanding macros in target state for test: {test}')
265-
target_term = KDefinition__expand_macros(foundry.definition, target_term)
266-
target_cterm = KEVM.add_invariant(CTerm(target_term))
260+
init_term = kcfg.get_unique_init().cterm.kast
261+
init_cterm = CTerm(KDefinition__expand_macros(foundry.definition, init_term))
267262
kcfg.replace_node(kcfg.get_unique_init().id, init_cterm)
263+
_LOGGER.info(f'Expanding macros in target state for test: {test}')
264+
target_term = kcfg.get_unique_target().cterm.kast
265+
target_cterm = CTerm(KDefinition__expand_macros(foundry.definition, target_term))
268266
kcfg.replace_node(kcfg.get_unique_target().id, target_cterm)
269267
if simplify_init:
270268
with KCFGExplore(foundry, port=find_free_port(), bug_report=br) as kcfg_explore:

0 commit comments

Comments
 (0)