Skip to content

Incremental exploration based kprove using rpc endpoints #1443

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

Closed
wants to merge 204 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
204 commits
Select commit Hold shift + click to select a range
7a2a27b
kevm-pyk/__main__: hook up --[no-]minimize to omit_large_subst
ehildenb Nov 24, 2022
4901ee8
bin/kevm: pass through --debug to kevm-pyk
ehildenb Nov 5, 2022
7708f2d
kevm-pyk/__main__: correct handling of --debug argument
ehildenb Nov 5, 2022
b432831
kevm-pyk/solc_to_k: use infinite gas for proofs
ehildenb Nov 30, 2022
8d80a3b
infinite-gas: remove unsound Cmem lemmas
ehildenb Sep 28, 2022
c8ddd5f
tests/infinite-gas-spec: name Cgascap claims
ehildenb Dec 2, 2022
6bc73d9
tests/infinite-gas-spec: failing simplification about #allBut64th
ehildenb Dec 2, 2022
9f7b8b7
include/lemmas.k: add lemma about #allBut64th
ehildenb Dec 2, 2022
6d18243
tests/inifnite-gas-spec: remove bad claims about Cgascap, add new one
ehildenb Dec 2, 2022
04e1f22
include/infinite-gas: correct/simplify lemmas about Cgascap
ehildenb Dec 2, 2022
a62fd4e
Merge remote-tracking branch 'upstream/master' into foundry-fixes
ehildenb Dec 2, 2022
9730d23
tests/infinite-gas-spec: correct claim about allBut64th
ehildenb Dec 2, 2022
b752209
include/, kevm-pyk/, tests/specs/: rework/simplify allBut64th logic
ehildenb Dec 2, 2022
d6233c9
include/infinite-gas, tests/infinite-gas-spec: another disequality le…
ehildenb Dec 2, 2022
d870dc2
tests/failing-symbolic.java: remove several proofs already covered by…
ehildenb Dec 2, 2022
635810f
include/infinite-gas, tests/infinite-gas-spec: lemma/test about Cgascap
ehildenb Dec 2, 2022
1f75de1
tests/infinite-gas-spec: name allBut64th claims, remove Cgascap claim
ehildenb Dec 2, 2022
11e2207
include/infinite-gas, tests/{infinite-gas-spec,lemmas-spec}: adjustme…
ehildenb Dec 4, 2022
eafd84b
include/infinite-gas, tests/infinite-gas-spec: additional lemmas for …
ehildenb Dec 4, 2022
bf7fa2d
kevm-pyk/__main__: supply custom node printer for cfgs
ehildenb Dec 6, 2022
e9a88fc
kevm-pyk/__main__: add --to-module argument to foundry-show
ehildenb Dec 6, 2022
a9cf7ed
kevm-pyk/solc_to_k: store bytecode without 0x
ehildenb Dec 7, 2022
a31f803
kevm-pyk/solc_to_k: compute srcmap
ehildenb Dec 7, 2022
360d35e
kevm-pyk/__main__: store sourcemap on disk
ehildenb Dec 7, 2022
3fd5ad2
kevm-pyk/__main__: display sourcemap as part of cfg
ehildenb Dec 7, 2022
d42fba6
Merge branch 'master' into foundry-fixes
ehildenb Dec 8, 2022
30e1770
tests/infinite-gas-spec: add failing Cgascap spec
ehildenb Dec 8, 2022
282ad2c
include/infinite-gas: generalize and simplify lemmas about infinite
ehildenb Dec 8, 2022
b56ea91
Merge branch 'master' into foundry-fixes
anvacaru Dec 9, 2022
d8c4930
Merge branch 'master' into srcmap-display
ehildenb Dec 9, 2022
9bae7dd
Merge branch 'master' into srcmap-display
ehildenb Dec 11, 2022
5d27737
Merge branch 'master' into foundry-fixes
anvacaru Dec 12, 2022
65e6637
deps/pyk_release: v0.1.85
rv-jenkins Dec 12, 2022
fd6fbd2
kevm-pyk/: sync poetry files
rv-auditor Dec 12, 2022
bf201ea
flake.{nix,lock}: update Nix derivations
rv-auditor Dec 12, 2022
2c88d9f
Merge branch 'master' into _update-deps_runtimeverification_pyk
rv-jenkins Dec 12, 2022
0fa9da6
kevm-pyk/: sync poetry files
rv-auditor Dec 12, 2022
6a06f66
flake.{nix,lock}: update Nix derivations
rv-auditor Dec 12, 2022
c6705ac
deps/pyk_release: v0.1.86
rv-jenkins Dec 12, 2022
8809f2b
kevm-pyk/: sync poetry files
rv-auditor Dec 12, 2022
f87b1a6
flake.{nix,lock}: update Nix derivations
rv-auditor Dec 12, 2022
f7734b1
deps/pyk_release: v0.1.87
rv-jenkins Dec 12, 2022
1cf8b80
kevm-pyk/: sync poetry files
rv-auditor Dec 12, 2022
131fea8
flake.{nix,lock}: update Nix derivations
rv-auditor Dec 12, 2022
a42dd38
deps/pyk_release: v0.1.88
rv-jenkins Dec 13, 2022
bb74e4b
kevm-pyk/: sync poetry files
rv-auditor Dec 13, 2022
f2cccf5
flake.{nix,lock}: update Nix derivations
rv-auditor Dec 13, 2022
d294a04
Merge branch 'master' into _update-deps_runtimeverification_pyk
rv-jenkins Dec 14, 2022
0a7da94
kevm-pyk/: sync poetry files
rv-auditor Dec 14, 2022
87fcce3
flake.{nix,lock}: update Nix derivations
rv-auditor Dec 14, 2022
0e2be52
Merge branch 'master' into srcmap-display
ehildenb Dec 14, 2022
35abe7f
kevm-pyk/__main__: include <callDepth> cell in node pretty print
ehildenb Dec 10, 2022
a528cf8
kevm-pyk/__main__: dont bother with lame pcs
ehildenb Dec 13, 2022
cbf364a
========================= upstream/master =========================
ehildenb Dec 14, 2022
f81aca1
Merge remote-tracking branch 'upstream/master' into foundry-fixes
ehildenb Dec 14, 2022
7b0145f
Merge branch 'foundry-fixes' into _incremental-exploration
ehildenb Dec 14, 2022
5cbf00c
========================= foundry-fixes =========================
ehildenb Dec 14, 2022
abf1ba4
Merge remote-tracking branch 'upstream/_update-deps_runtimeverificati…
ehildenb Dec 14, 2022
b7f4409
========================= upstream/_update-deps_runtimeverification_p…
ehildenb Dec 14, 2022
df20359
kevm-pyk/__main__: omit_large_subst => minimize
ehildenb Dec 14, 2022
7b6e6d9
Merge branch 'foundry-fixes' into _incremental-exploration
ehildenb Dec 14, 2022
89b58ad
========================= foundry-fixes =========================
ehildenb Dec 14, 2022
95a74d9
Merge branch 'srcmap-display' into _incremental-exploration
ehildenb Dec 14, 2022
c0533a5
========================= srcmap-display =========================
ehildenb Dec 14, 2022
533562e
========================= upstream/_update-deps_runtimeverification_p…
ehildenb Dec 14, 2022
3cff24a
Add command view-kcfg
tothtamas28 Dec 9, 2022
73d45b3
bin/kevm, kevm-pyk/__main__: hook up kevm foundry-view-kcfg command
ehildenb Dec 13, 2022
dd62718
kevm-pyk/__main__: view CFG by test-name
ehildenb Dec 13, 2022
9795e26
bin/kevm: simplify foundry integration
ehildenb Dec 13, 2022
6f1b991
bin/kevm: correction
ehildenb Dec 13, 2022
48e520f
Merge branch 'foundry-kcfg-viewer' into _incremental-exploration
ehildenb Dec 14, 2022
720dcfc
========================= foundry-kcfg-viewer =========================
ehildenb Dec 14, 2022
7e5f8e0
Add command view-kcfg
tothtamas28 Dec 9, 2022
d5aa27e
bin/kevm, kevm-pyk/__main__: hook up kevm foundry-view-kcfg command
ehildenb Dec 13, 2022
a058d32
kevm-pyk/__main__: view CFG by test-name
ehildenb Dec 13, 2022
e544692
bin/kevm: simplify foundry integration
ehildenb Dec 13, 2022
e2f8c1e
bin/kevm: correction
ehildenb Dec 13, 2022
05bfb07
Merge remote-tracking branch 'upstream/master' into _incremental-expl…
ehildenb Dec 14, 2022
d785209
========================= upstream/master =========================
ehildenb Dec 14, 2022
7462861
Merge branch 'foundry-kcfg-viewer' into _incremental-exploration
ehildenb Dec 14, 2022
1175a32
========================= foundry-kcfg-viewer =========================
ehildenb Dec 14, 2022
352eb25
kevm-pyk/__main__: simpler KCFGViewer
ehildenb Dec 15, 2022
0e23aaf
Merge branch 'foundry-kcfg-viewer' into _incremental-exploration
ehildenb Dec 15, 2022
f2ee32a
========================= foundry-kcfg-viewer =========================
ehildenb Dec 15, 2022
5db65d3
deps/pyk_release: v0.1.89
rv-jenkins Dec 15, 2022
72ebe34
kevm-pyk/: sync poetry files
rv-auditor Dec 15, 2022
4aa4c44
flake.{nix,lock}: update Nix derivations
rv-auditor Dec 15, 2022
ad49e8e
Merge branch 'master' into _update-deps_runtimeverification_pyk
ehildenb Dec 15, 2022
e58b842
Merge remote-tracking branch 'upstream/master' into _incremental-expl…
ehildenb Dec 15, 2022
6de7c0a
========================= upstream/master =========================
ehildenb Dec 15, 2022
068d7ff
Merge remote-tracking branch 'upstream/_update-deps_runtimeverificati…
ehildenb Dec 15, 2022
6b5f939
========================= upstream/_update-deps_runtimeverification_p…
ehildenb Dec 15, 2022
6b916ca
flake.{nix,lock}: update Nix derivations
rv-auditor Dec 15, 2022
aea48b8
Merge remote-tracking branch 'upstream/master' into foundry-kcfg-viewer
ehildenb Dec 16, 2022
f108946
Merge branch 'foundry-kcfg-viewer' into _incremental-exploration
ehildenb Dec 16, 2022
5a92ebd
========================= foundry-kcfg-viewer =========================
ehildenb Dec 16, 2022
4f6c42c
Merge remote-tracking branch 'upstream/_update-deps_runtimeverificati…
ehildenb Dec 16, 2022
7c0c7ba
========================= upstream/_update-deps_runtimeverification_p…
ehildenb Dec 16, 2022
2b56b5f
Merge remote-tracking branch 'upstream/master' into _incremental-expl…
ehildenb Dec 17, 2022
8723f9f
========================= upstream/master =========================
ehildenb Dec 17, 2022
801fd44
deps/pyk_release: v0.1.90
rv-jenkins Dec 17, 2022
ab8b343
kevm-pyk/: sync poetry files
rv-auditor Dec 17, 2022
690f597
flake.{nix,lock}: update Nix derivations
rv-auditor Dec 17, 2022
4163a35
Merge remote-tracking branch 'upstream/master' into _incremental-expl…
ehildenb Dec 17, 2022
e35da15
========================= upstream/master =========================
ehildenb Dec 17, 2022
1058079
deps/pyk_release: v0.1.91
rv-jenkins Dec 19, 2022
e0e1857
Merge remote-tracking branch 'upstream/_update-deps_runtimeverificati…
ehildenb Dec 19, 2022
f631e19
========================= upstream/_update-deps_runtimeverification_p…
ehildenb Dec 19, 2022
4b1478a
kevm-pyk/kevm: add KEVM.is_terminal and KEVM.extract_branches
ehildenb Oct 21, 2022
af988f6
kevm-pyk/__main__: add basic auto-exploration strategy for KCFGs
ehildenb Oct 21, 2022
5e7a4ed
kevm-pyk/__main__: check terminal/branching even if its a new node
ehildenb Oct 22, 2022
fddbcad
!!! kevm-pyk/__main__: use an edge instead of a cover because of how …
ehildenb Oct 22, 2022
11628b1
kevm-pyk/__main__: add expanded after retrieving from frontier
ehildenb Oct 22, 2022
15ab107
kevm-pyk/__main__: add --max-iterations option to foundry-prove
ehildenb Oct 23, 2022
eda3b71
kevm-pyk/__main__: allow --max-iterations to be 0
ehildenb Oct 23, 2022
2155215
kevm-pyk/__main__: add TODO
ehildenb Oct 30, 2022
c6b3754
kevm-pyk/__main__: call sanitize_config on output of get_claim_basic_…
ehildenb Oct 25, 2022
f65e4a8
kevm-pyk/__main__: after discovering proven state, dont also try to e…
ehildenb Oct 31, 2022
984369f
Makefile: set options to make faster CI exploration in Makefile
ehildenb Nov 2, 2022
e3665eb
kevm-pyk/__main__: better logging/error messages
ehildenb Nov 2, 2022
57782ac
kevm-pyk/__main__: fall back to manual branch extraction using haskel…
ehildenb Nov 2, 2022
1bb3922
kevm-pyk/__main__: use KProve kore-rpc endpoints
ehildenb Nov 16, 2022
a914196
kevm-pyk/__main__: simplify a bit
ehildenb Nov 16, 2022
35f6c77
kevm-pyk/__main__: add check for subsumption into target state
ehildenb Nov 23, 2022
23314b7
kevm-pyk/__main__: flatten control flow, execute will never return Top
ehildenb Nov 23, 2022
e6499b4
kevm-pyk/__main__: move faster checks to beginning of loop
ehildenb Nov 23, 2022
45f8bf7
kevm-pyk/__main__: execute endpoint returns CTerms
ehildenb Nov 23, 2022
c2c92b7
kevm-pyk/__main__: pass in learned witness instead of inferring it
ehildenb Nov 23, 2022
93cf51c
kevm-pyk/__main__: no need to sanitize configuration
ehildenb Nov 23, 2022
867e4f3
kevm-pyk/__main__: write cfg every iteration
ehildenb Nov 23, 2022
e43141d
kevm-pyk/__main__: reset port used for each proving problem
ehildenb Nov 24, 2022
9537fbd
kevm-pyk/{utils,__main__}: KCFG.replace_node returns new node id and …
ehildenb Nov 26, 2022
0b22915
kevm-pyk/__main__: simplify each frontier node before expanding it
ehildenb Nov 27, 2022
bf96ffb
kevm-pyk/__main__: use KCFG.split_node instead of manual splitting
ehildenb Nov 29, 2022
c4e90fd
kevm-pyk/__main__: rename implies results
ehildenb Nov 29, 2022
03e0a2c
kevm-pyk/__main__: print warning if depth bound is reached
ehildenb Nov 29, 2022
d684f3c
kevm-pyk/__main__: factor out _write_cfg
ehildenb Dec 4, 2022
ce5fc06
kevm-pyk/__main__: fall back to original prover to determine of non-e…
ehildenb Dec 4, 2022
5291b1f
kevm-pyk/__main__: better log messages
ehildenb Dec 4, 2022
25d07fe
kevm-pyk/kevm: add KEVM.add_language_invariants and KEVM.abstract
ehildenb Dec 6, 2022
68f62c9
kevm-pyk/__main__: check subsumption/terminal before simplifying, to …
ehildenb Dec 6, 2022
00ad12d
kevm-pyk/__main__: build claim directly and store variable map on bra…
ehildenb Dec 6, 2022
b7341a2
kevm-pyk/__main__: add option --auto-abstract to foundry-prove
ehildenb Dec 6, 2022
62c46a1
kevm-pyk/__main__: store every opcode
ehildenb Dec 7, 2022
708ac22
kevm-pyk/kevm: remove redundant function
ehildenb Dec 7, 2022
6423d20
kevm-pyk/__main__: only save every 10th execution step
ehildenb Dec 7, 2022
aa1b2c3
kevm-pyk/utils: remove sanitize_config and KProve_prove_claim
ehildenb Dec 9, 2022
0cfd343
Makefile: simplify initial states
ehildenb Dec 9, 2022
e2380e8
kevm-pyk/__main__: close RPC server at end of prove_it
ehildenb Dec 9, 2022
ba29d6c
kevm-pyk/{__main__, utils}: pull out generic rpc_prove method
ehildenb Dec 9, 2022
04e399e
kevm-pyk/kevm: make KEVM.abstract a staticmethod
ehildenb Dec 9, 2022
0e7443f
kevm-pyk/utils: pass each argument to rpc_prove separately
ehildenb Dec 9, 2022
167c053
kevm-pyk/__main__: zip up arguments to rpc_prove properly
ehildenb Dec 9, 2022
159cfe1
kevm-pyk/utils: pass in terminal_rules and cut_point_rules
ehildenb Dec 9, 2022
2ad663d
kevm-pyk/__main__: set terminal_rules
ehildenb Dec 9, 2022
05627a8
kevm-pyk/utils: set CFG sparsity with max_depth parameter
ehildenb Dec 9, 2022
f5338fc
kevm-pyk/__main__: decrease max depth default
ehildenb Dec 9, 2022
59010aa
kevm-pyk/__main__: remove comment
ehildenb Dec 9, 2022
ac566af
kevm-pyk/utils: do not exceed max_depth for basic blocks
ehildenb Dec 9, 2022
78a70f5
kevm-pyk/utils: add option to simplify initial KCFG nodes before begi…
ehildenb Dec 9, 2022
b34b6f5
kevm-pyk/__main__: remove now redundant option to simplify init in main
ehildenb Dec 9, 2022
2436029
kevm-pyk/__main__: only auto-abstract if the user specifies
ehildenb Dec 9, 2022
9aa2d21
kevm-pyk/utils: better messages
ehildenb Dec 9, 2022
47cf507
kevm-pyk/__main__: remove now unused option
ehildenb Dec 9, 2022
b751537
kevm-pyk/utils: improve log messages
ehildenb Dec 9, 2022
d4b6379
kevm-pyk/utils: simplify logic for advancing proof
ehildenb Dec 9, 2022
a589f9d
kevm-pyk/__main__: add option to break every EVM step of execution
ehildenb Dec 9, 2022
7356096
kevm-pyk/utils: better handling of stuck nodes and depth-0 blocks
ehildenb Dec 10, 2022
e60ef93
kevm-pyk/kevm: correct way to get zero-byte code
ehildenb Dec 10, 2022
a333b9e
kevm-pyk/utils: better log message
ehildenb Dec 10, 2022
196f8e2
.github/test-pr: increase parallelism
ehildenb Dec 10, 2022
043b22e
kevm-pyk/kevm: refine the KEVM.is_terminal check
ehildenb Dec 10, 2022
e28f0c8
kevm-pyk/__main__: recover from proof crashing
ehildenb Dec 10, 2022
1d04b16
kevm-pyk/__main__: catch all exceptions
ehildenb Dec 10, 2022
7a2e81a
kevm-pyk/utils: use top-level close method
ehildenb Dec 10, 2022
3ea1ab7
kevm-pyk/__main__: catch all runtime exceptions in subprocess
ehildenb Dec 10, 2022
5be6b17
kevm-pyk/kevm: get rid of redundant unique
ehildenb Dec 13, 2022
d6148c8
kevm-pyk/__main__: add invariants to initial/target terms
ehildenb Dec 13, 2022
751aa75
kevm-pyk/utils: no resimplifications or extraction of branches using …
ehildenb Dec 13, 2022
1da3af5
tests/foundry: add trivial branching proof
ehildenb Dec 13, 2022
890e3ed
kevm-pyk/utils: attempt opportunistic extraction of branches every block
ehildenb Dec 13, 2022
58e4f87
kevm-pyk/{utils,__main__}: only check subsumption into final state at…
ehildenb Dec 13, 2022
063065b
kevm-pyk/utils: refactor to attempt branch extraction on every basic …
ehildenb Dec 13, 2022
2bd13a2
kevm-pyk/__main__: add kevm foundry-remove-node functionality
ehildenb Dec 13, 2022
d17d2b6
tests/foundry/exclude: remove proofs reaching #Bottom
ehildenb Dec 13, 2022
ba9b5d4
tests/foundry: add test in subdirectory
ehildenb Dec 13, 2022
d2bda47
kevm-pyk/utils: add method replace_special_chars
ehildenb Dec 13, 2022
14e0fcd
kevm-pyk/__main__: add --rpc-base-port option
ehildenb Dec 16, 2022
7b8dda6
kevm-pyk/{kevm,__main__}: move srcmap as field of KEVM
ehildenb Dec 16, 2022
73fb317
kevm-pyk/{kevm, __main__}: move node short info printer into KEVM class
ehildenb Dec 16, 2022
80fd8a0
kevm-pyk/utils: simplify write_cfg
ehildenb Dec 16, 2022
f0ea5c8
kevm-pyk/utils: add byte_offset_to_lines
ehildenb Dec 16, 2022
ca235f4
kevm-pyk/{solc_to_k, __main__}: resolve sourcemap at load time, also …
ehildenb Dec 16, 2022
0915734
kevm-pyk/{kevm,__main__}: include srcmap information in short node ou…
ehildenb Dec 16, 2022
f9b0c95
include/evm: name various CALL rules
ehildenb Dec 16, 2022
598b7dc
kevm-pyk/__main__: add option --break-on-calls
ehildenb Dec 16, 2022
8d8a59c
kevm-pyk/__main__: updated structure for KCFG import
ehildenb Dec 16, 2022
867867b
tests/foundry: add multi-assume test
ehildenb Dec 17, 2022
3c2c4a6
!!! kevm-pyk/pyproject: update to custom-kcfg-view branch
ehildenb Dec 19, 2022
55b4df6
!!! kevm-pyk/poetry.lock: update
ehildenb Dec 19, 2022
e7723f4
!!! flake.nix: update pyk to custom-kcfg-view branch
ehildenb Dec 19, 2022
5600b53
!!! flake.lock: update
ehildenb Dec 19, 2022
2d95de4
Revert "kevm-pyk/{kevm,__main__}: include srcmap information in short…
ehildenb Dec 19, 2022
03d5fb1
kevm-pyk/__main__: do not remove target nodes from KCFG
ehildenb Jan 26, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
- name: 'Build Foundry'
run: docker exec -u user kevm-ci-foundry-${GITHUB_SHA} /bin/bash -c 'make build-foundry -j2'
- name: 'Test Foundry'
run: docker exec -u user kevm-ci-foundry-${GITHUB_SHA} /bin/bash -c 'make test-foundry -j2 FOUNDRY_PAR=4 KPROVE_OPTS=--retry'
run: docker exec -u user kevm-ci-foundry-${GITHUB_SHA} /bin/bash -c 'make test-foundry -j2 FOUNDRY_PAR=12 KPROVE_OPTS=--retry'
- name: 'Tear down Docker'
if: always()
run: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ tests/foundry/out/kompiled/foundry.k: tests/foundry/out/kompiled/timestamp

tests/foundry/out/kompiled/foundry.k.prove: tests/foundry/out/kompiled/timestamp
$(KEVM) foundry-prove tests/foundry/out \
-j$(FOUNDRY_PAR) --no-simplify-init \
-j$(FOUNDRY_PAR) --max-depth 1000 \
$(KEVM_OPTS) $(KPROVE_OPTS) \
$(addprefix --exclude-test , $(shell cat tests/foundry/exclude))

Expand Down
1 change: 1 addition & 0 deletions bin/kevm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ run_kevm_pyk() {
;;
esac
! ${verbose} || pyk_args+=(--verbose)
! ${debug} || pyk_args+=(--debug)
execute python3 -m kevm_pyk "${pyk_command}" "$@" "${pyk_args[@]}"
}

Expand Down
2 changes: 1 addition & 1 deletion deps/pyk_release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.1.89
v0.1.91
20 changes: 10 additions & 10 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"github:ethereum/legacytests/d7abc42a7b352a7b44b1f66b58aca54e4af6a9d7";
ethereum-legacytests.flake = false;
haskell-backend.follows = "k-framework/haskell-backend";
pyk.url = "github:runtimeverification/pyk/v0.1.89";
pyk.url = "github:runtimeverification/pyk/custom-kcfg-view";
pyk.inputs.flake-utils.follows = "k-framework/flake-utils";
pyk.inputs.nixpkgs.follows = "k-framework/nixpkgs";

Expand Down
21 changes: 13 additions & 8 deletions include/kframework/evm.md
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,8 @@ For each `CALL*` operation, we make a corresponding call to `#call` and a state-
```k
syntax CallOp ::= "CALL"
// ------------------------
rule <k> CALL _GCAP ACCTTO VALUE ARGSTART ARGWIDTH RETSTART RETWIDTH
rule [call]:
<k> CALL _GCAP ACCTTO VALUE ARGSTART ARGWIDTH RETSTART RETWIDTH
=> #checkCall ACCTFROM VALUE
~> #call ACCTFROM ACCTTO ACCTTO VALUE VALUE #range(LM, ARGSTART, ARGWIDTH) false
~> #return RETSTART RETWIDTH
Expand All @@ -1480,7 +1481,8 @@ For each `CALL*` operation, we make a corresponding call to `#call` and a state-

syntax CallOp ::= "CALLCODE"
// ----------------------------
rule <k> CALLCODE _GCAP ACCTTO VALUE ARGSTART ARGWIDTH RETSTART RETWIDTH
rule [callcode]:
<k> CALLCODE _GCAP ACCTTO VALUE ARGSTART ARGWIDTH RETSTART RETWIDTH
=> #checkCall ACCTFROM VALUE
~> #call ACCTFROM ACCTFROM ACCTTO VALUE VALUE #range(LM, ARGSTART, ARGWIDTH) false
~> #return RETSTART RETWIDTH
Expand All @@ -1491,7 +1493,8 @@ For each `CALL*` operation, we make a corresponding call to `#call` and a state-

syntax CallSixOp ::= "DELEGATECALL"
// -----------------------------------
rule <k> DELEGATECALL _GCAP ACCTTO ARGSTART ARGWIDTH RETSTART RETWIDTH
rule [delegatecall]:
<k> DELEGATECALL _GCAP ACCTTO ARGSTART ARGWIDTH RETSTART RETWIDTH
=> #checkCall ACCTFROM 0
~> #call ACCTAPPFROM ACCTFROM ACCTTO 0 VALUE #range(LM, ARGSTART, ARGWIDTH) false
~> #return RETSTART RETWIDTH
Expand All @@ -1504,7 +1507,8 @@ For each `CALL*` operation, we make a corresponding call to `#call` and a state-

syntax CallSixOp ::= "STATICCALL"
// ---------------------------------
rule <k> STATICCALL _GCAP ACCTTO ARGSTART ARGWIDTH RETSTART RETWIDTH
rule [staticcall]:
<k> STATICCALL _GCAP ACCTTO ARGSTART ARGWIDTH RETSTART RETWIDTH
=> #checkCall ACCTFROM 0
~> #call ACCTFROM ACCTTO ACCTTO 0 0 #range(LM, ARGSTART, ARGWIDTH) true
~> #return RETSTART RETWIDTH
Expand Down Expand Up @@ -1623,7 +1627,8 @@ For each `CALL*` operation, we make a corresponding call to `#call` and a state-
```k
syntax TernStackOp ::= "CREATE"
// -------------------------------
rule <k> CREATE VALUE MEMSTART MEMWIDTH
rule [create]:
<k> CREATE VALUE MEMSTART MEMWIDTH
=> #accessAccounts #newAddr(ACCT, NONCE)
~> #checkCall ACCT VALUE
~> #create ACCT #newAddr(ACCT, NONCE) VALUE #range(LM, MEMSTART, MEMWIDTH)
Expand All @@ -1644,7 +1649,8 @@ For each `CALL*` operation, we make a corresponding call to `#call` and a state-
```k
syntax QuadStackOp ::= "CREATE2"
// --------------------------------
rule <k> CREATE2 VALUE MEMSTART MEMWIDTH SALT
rule [create2]:
<k> CREATE2 VALUE MEMSTART MEMWIDTH SALT
=> #accessAccounts #newAddr(ACCT, SALT, #range(LM, MEMSTART, MEMWIDTH))
~> #checkCall ACCT VALUE
~> #create ACCT #newAddr(ACCT, SALT, #range(LM, MEMSTART, MEMWIDTH)) VALUE #range(LM, MEMSTART, MEMWIDTH)
Expand Down Expand Up @@ -2336,8 +2342,7 @@ There are several helpers for calculating gas (most of them also specified in th

syntax Int ::= #allBut64th ( Int ) [function, total, smtlib(gas_allBut64th)]
// ----------------------------------------------------------------------------
rule [allBut64th.pos]: #allBut64th(N) => N -Int (N /Int 64) requires 0 <=Int N
rule [allBut64th.neg]: #allBut64th(N) => 0 requires N <Int 0
rule [allBut64th]: #allBut64th(N) => N -Int (N /Int 64)
```

```{.k .nobytes}
Expand Down
41 changes: 23 additions & 18 deletions include/kframework/infinite-gas.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ module INFINITE-GAS-COMMON

syntax Int ::= #gas ( Int ) [function, total, no-evaluators, klabel(infGas), symbol, smtlib(infGas)]
// ----------------------------------------------------------------------------------------------------
rule #gas(G) +Int G' => #gas(G +Int G') requires 0 <=Int G' orBool 0 -Int G' <Int #gas(G) [simplification]
rule G +Int #gas(G') => #gas(G +Int G') requires 0 <=Int G orBool 0 -Int G <Int #gas(G') [simplification]

rule #gas(G) -Int G' => #gas(G -Int G') requires 0 <=Int G' andBool G' <Int #gas(G) [simplification]
rule #gas(G) -Int #gas(G') => #gas(G -Int G') [simplification]
// N.B.: These lemmas amount to defining \inf - \inf as \inf.
// In most mathematics, it's undefined it seems, so we get the choice!
// We make them lower priority than other rules.
rule #gas(G) +Int G' => #gas(G +Int G') [simplification(60)]
rule G +Int #gas(G') => #gas(G +Int G') [simplification(60)]
rule #gas(G) -Int G' => #gas(G -Int G') [simplification(60)]
rule #gas(G) -Int #gas(G') => #gas(G -Int G') [simplification(60)]

rule #gas(G) *Int G' => #gas(G *Int G') requires 0 <=Int G' [simplification]
rule G *Int #gas(G') => #gas(G *Int G') requires 0 <=Int G [simplification]
Expand All @@ -87,14 +89,11 @@ module INFINITE-GAS-COMMON
rule G /Int #gas(G') => 0 requires 0 <=Int G andBool G <Int #gas(G') [simplification]

rule #gas(#gas(G)) => #gas(G) [simplification]
rule #gas(#gas(G) +Int G') => #gas(G +Int G') [simplification]

rule minInt(#gas(G), #gas(G')) => #gas(minInt(G, G')) [simplification]
rule #if B #then #gas(G) #else #gas(G') #fi => #gas(#if B #then G #else G' #fi) [simplification]

rule #allBut64th(#gas(G)) => #gas(#allBut64th(G)) [simplification]

rule Cgascap(SCHED, #gas(GCAP), #gas(GAVAIL), GEXTRA) => #gas(Cgascap(SCHED, GCAP, GAVAIL, GEXTRA)) requires #rangeUInt(256, GEXTRA) [simplification]

rule _ <=Int #gas(_) => true [simplification]
rule #gas(_) <Int _ => false [simplification]

Expand Down Expand Up @@ -124,11 +123,6 @@ module INFINITE-GAS-COMMON
rule #gas(_) <Int Csload(_, _) => false [simplification]
rule #gas(_) >=Int Csload(_, _) => true [simplification]

rule 0 <=Int Cmem(_, _) => true [simplification]
rule Cmem(_, _) <Int #gas(_) => true [simplification]
rule #gas(_) <Int Cmem(_, _) => false [simplification]
rule Cmem(_, _) <=Int #gas(_) => true [simplification]

rule 0 <=Int Caddraccess(_, _) => true [simplification]
rule Caddraccess(_, _) <Int #gas(_) => true [simplification]
rule #gas(_) <Int Caddraccess(_, _) => false [simplification]
Expand All @@ -140,15 +134,26 @@ module INFINITE-GAS-COMMON
rule 0 <=Int Cmem(_, N) => true requires 0 <=Int N [simplification]
rule Cmem(_, N) <Int #gas(G) => true requires N <Int #gas(G) [simplification]

rule 0 <=Int Cgascap(_, _, _, _) => true [simplification]
rule Cgascap(_, GCAP, GAVAIL, GEXTRA) <Int #gas(G) => true requires GCAP <Int #gas(G) andBool GAVAIL <Int #gas(G) andBool GEXTRA <Int #gas(G) [simplification]
rule Cgascap(SCHED, GAVAIL, GAVAIL, GEXTRA) => #allBut64th(GAVAIL -Int GEXTRA)
requires 0 <=Int GEXTRA andBool GEXTRA <=Int GAVAIL
andBool notBool Gstaticcalldepth << SCHED >>
[simplification]

rule 0 <=Int Cgascap(_, _, _, _) => true [simplification]
rule G <=Int Cgascap(_, GCAP, #gas(_), _) => true requires 0 <=Int G andBool G <=Int GCAP [simplification]
rule Cgascap(_, GCAP, #gas(_), _) <Int G => false requires 0 <=Int G andBool G <=Int GCAP [simplification]
rule Cgascap(_, GCAP, _, _) <Int G => true requires 0 <=Int GCAP andBool GCAP <Int G [simplification]
rule Cgascap(_, #gas(_), #gas(_), _) <Int _ => false [simplification]

rule 0 <=Int Cextra(_, _, _, _) => true [simplification]
rule Cextra(_, _, _, _) <Int #gas(_) => true [simplification]
rule Cextra(_, _, _, _) <Int pow256 => true [simplification]

rule 0 <=Int #allBut64th(_) => true [simplification]
rule #allBut64th(G) <Int #gas(G') => true requires G <Int #gas(G') [simplification]
rule #allBut64th(#gas(G)) => #gas(#allBut64th(G)) [simplification]
rule (G /Int 64) +Int #allBut64th(G) => G [simplification]

rule 0 <=Int #allBut64th(G) => true requires 0 <=Int G [simplification]
rule #allBut64th(G) <Int G' => true requires G <Int G' [simplification]

rule 0 <=Int _:ScheduleConst < _:Schedule > => true [simplification]
rule _:ScheduleConst < _:Schedule > <Int #gas(_) => true [simplification]
Expand Down
2 changes: 2 additions & 0 deletions include/kframework/lemmas/lemmas.k
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ module LEMMAS [symbolic]
rule maxUInt48 &Int X <Int pow48 => true requires 0 <=Int X [simplification, smt-lemma]
rule maxUInt160 &Int X <Int pow160 => true requires 0 <=Int X [simplification, smt-lemma]

rule (X /Int 64) +Int #allBut64th(X) => X [simplification]

// ########################
// Set Reasoning
// ########################
Expand Down
Loading