Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use an llvm backend library in exec_prove with --use-booster #2069

Merged
merged 14 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions kevm-pyk/src/kevm_pyk/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,14 @@ def is_functional(claim: KClaim) -> bool:
claim_lhs = claim_lhs.lhs
return not (type(claim_lhs) is KApply and claim_lhs.label.name == '<generatedTop>')

llvm_definition_dir = definition_dir / 'llvm-library' if use_booster else None

def _init_and_run_proof(claim: KClaim) -> tuple[bool, list[str] | None]:
with legacy_explore(
kevm,
kcfg_semantics=KEVMSemantics(auto_abstract_gas=auto_abstract_gas),
id=claim.label,
llvm_definition_dir=llvm_definition_dir,
bug_report=bug_report,
kore_rpc_command=kore_rpc_command,
smt_timeout=smt_timeout,
Expand Down
60 changes: 0 additions & 60 deletions tests/specs/erc20/evm-symbolic.k

This file was deleted.

6 changes: 0 additions & 6 deletions tests/specs/erc20/verification.k
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
requires "edsl.md"
requires "evm-symbolic.k"
requires "lemmas/lemmas.k"

module VERIFICATION
imports VERIFICATION-HASKELL
imports LEMMAS

endmodule

module VERIFICATION-HASKELL [symbolic, kore]
imports EDSL
endmodule
2 changes: 1 addition & 1 deletion tests/specs/mcd/dai-symbol-pass-spec.k
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module DAI-SYMBOL-PASS-SPEC
<schedule> ISTANBUL </schedule>
<ethereum>
<evm>
<output> _ => #asByteStackInWidthaux(32, 31, 32, #enc(#string("DAI"))) </output>
<output> _ => #buf(32, 32) +Bytes #buf(32, 3) +Bytes b"DAI" +Bytes #buf(29, 0) </output>
<statusCode> _ => EVMC_SUCCESS </statusCode>
<callStack> _VCallStack </callStack>
<interimStates> _ </interimStates>
Expand Down
41 changes: 7 additions & 34 deletions tests/specs/mcd/verification.k
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@ module VERIFICATION
imports DSS-BIN-RUNTIME
imports DSS-STORAGE
imports LEMMAS-MCD

endmodule

module LEMMAS-MCD
imports LEMMAS-MCD-HASKELL

imports LEMMAS-MCD-SYNTAX
endmodule

module LEMMAS-MCD-SYNTAX [symbolic]
imports LEMMAS
module LEMMAS-MCD-SYNTAX
imports EVM

// ########################
// Constants
Expand All @@ -42,23 +37,6 @@ module LEMMAS-MCD-SYNTAX [symbolic]
// -------------------------------------------------
rule #string2Word(S) => #asWord(#padRightToWidth(32, #parseByteStackRaw(S)))

syntax Int ::= nthbyteof ( Int , Int , Int ) [function, smtlib(smt_nthbyteof)]
// ------------------------------------------------------------------------------
rule nthbyteof(V, I, N) => nthbyteof(V /Int 256, I, N -Int 1) when N >Int (I +Int 1) [concrete]
rule nthbyteof(V, I, N) => V modInt 256 when N ==Int (I +Int 1) [concrete]

// ########################
// Buffer Reasoning
// ########################

syntax Bytes ::= #asByteStackInWidth ( Int, Int ) [function]
| #asByteStackInWidthaux ( Int, Int, Int, Bytes ) [function]
// ---------------------------------------------------------------------------
rule #asByteStackInWidth(X, N) => #asByteStackInWidthaux(X, N -Int 1, N, .Bytes)

rule #asByteStackInWidthaux(X, I, N, WS) => #asByteStackInWidthaux(X, I -Int 1, N, nthbyteof(X, I, N) : WS) when I >Int 0
rule #asByteStackInWidthaux(X, 0, N, WS) => nthbyteof(X, 0, N) : WS

// ########################
// Arithmetic
// ########################
Expand All @@ -69,8 +47,10 @@ module LEMMAS-MCD-SYNTAX [symbolic]

endmodule

module LEMMAS-MCD-HASKELL [symbolic, kore]
imports LEMMAS-MCD-COMMON
module LEMMAS-MCD [symbolic, kore]
imports LEMMAS
imports LEMMAS-MCD-SYNTAX
imports WORD-PACK

// ########################
// Arithmetic
Expand Down Expand Up @@ -157,13 +137,6 @@ module LEMMAS-MCD-HASKELL [symbolic, kore]
rule { (M:Map [K <- V1]) #Equals (M [K <- V2]) } => { V1 #Equals V2 }
[simplification]

endmodule


module LEMMAS-MCD-COMMON [symbolic]
imports LEMMAS-MCD-SYNTAX
imports WORD-PACK

// ########################
// Buffer Reasoning
// ########################
Expand Down
Loading