Skip to content

Commit

Permalink
allow_symbolic_program
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevengre committed Jan 8, 2025
1 parent f567e36 commit e914f89
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions kevm-pyk/src/kevm_pyk/summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def build_spec(
opcode = KVariable('OP_CODE', KSort('BinStackOp'))
next_opcode = KApply('#next[_]_EVM_InternalOp_MaybeOpCode', opcode)
_init_subst: dict[str, KInner] = {'K_CELL': KSequence([next_opcode, KVariable('K_CELL')])}
_init_subst['PROGRAM_CELL'] = self.kevm.bytes_empty()
init_subst = CSubst(Subst(_init_subst), ())
# TODO: following provides some special cases that cannot be handled automatically
# Error Message:
Expand All @@ -66,7 +65,6 @@ def build_spec(
# construct the final substitution
_final_subst: dict[str, KInner] = {vname: KVariable('FINAL_' + vname) for vname in cterm.free_vars}
_final_subst['K_CELL'] = KVariable('K_CELL')
_final_subst['PROGRAM_CELL'] = self.kevm.bytes_empty()
final_subst = CSubst(Subst(_final_subst), ())

kclaim, _ = cterm_build_claim('instruction_spec', init_subst(cterm), final_subst(cterm))
Expand All @@ -84,7 +82,7 @@ def explore(self, proof: APRProof) -> None:
def _init_and_run_proof(proof: APRProof) -> tuple[bool, list[str]]:
with legacy_explore(
self.kevm,
kcfg_semantics=KEVMSemantics(),
kcfg_semantics=KEVMSemantics(allow_symbolic_program=True),
id=proof.id,
llvm_definition_dir=self.kevm.definition_dir / 'llvm-library',
bug_report=None,
Expand Down Expand Up @@ -116,7 +114,7 @@ def create_kcfg_explore() -> KCFGExplore:
)
return KCFGExplore(
cterm_symbolic,
kcfg_semantics=KEVMSemantics(),
kcfg_semantics=KEVMSemantics(allow_symbolic_program=True),
id=proof.id,
)

Expand Down Expand Up @@ -165,7 +163,7 @@ def create_kcfg_explore() -> KCFGExplore:
print(line)

def summarize(self, proof: APRProof) -> None:
proof.minimize_kcfg(KEVMSemantics(), False)
proof.minimize_kcfg(KEVMSemantics(allow_symbolic_program=True), False)
node_printer = kevm_node_printer(self.kevm, proof)
proof_show = APRProofShow(self.kevm, node_printer=node_printer)
for res_line in proof_show.show(proof, to_module=True):
Expand Down

0 comments on commit e914f89

Please sign in to comment.