evm-semantics/evm.md: rewrite #transferFunds rule to be linear#2862
Merged
automergerpr-permission-manager[bot] merged 1 commit intoJun 12, 2026
Merged
Conversation
…linearity to side condition
The same-account variant of #transferFunds was
rule <k> #transferFunds ACCT ACCT VALUE => .K ... </k>
...
requires VALUE <=Int ORIGFROM
i.e. the linearity guard `ACCT ACCT` required the two account-id
arguments to be syntactically identical. Booster's matcher cannot
discharge that on distinct-named symbolic variables (e.g.
`#transferFunds ?CONTRACT_ID 1 0`), even when the path constraint
implies their distinctness — match returns Indeterminate, booster
aborts, and the proof yields to kore.
Reformulate as
rule <k> #transferFunds ACCTFROM ACCTTO VALUE => .K ... </k>
...
requires ACCTFROM ==K ACCTTO andBool VALUE <=Int ORIGFROM
The LHS now uses distinct variable names so the match is unconditional;
the original linearity moves into the side condition as `==K`, which
booster can discharge via the path constraint (or via its SMT path)
without an indeterminate-match abort. Semantically equivalent on
concrete inputs and strictly more permissive on symbolic inputs in a
sound direction (matches when args are semantically equal but not
syntactically).
Recover-mode sweep identified 12 kore-execute handoffs (all benchmarks
ecrecover variants) caused by this exact match-fail abort. Validated
locally on benchmarks/ecrecover00-siginvalid-spec.k together with the
#asAccount [total] fix in the preceding commit: the spec's recover-mode
kcfg went from 2 kore-handoffs to 0, proof still passes.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
(cherry picked from commit 1bff5e84ed608edeeb5e403e748b342e40f33f4b)
anvacaru
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The same-account variant of #transferFunds was
i.e. the linearity guard
ACCT ACCTrequired the two account-id arguments to be syntactically identical. Booster's matcher cannot discharge that on distinct-named symbolic variables (e.g.#transferFunds ?CONTRACT_ID 1 0), even when the path constraint implies their distinctness — match returns Indeterminate, booster aborts, and the proof yields to kore.Reformulate as
The LHS now uses distinct variable names so the match is unconditional; the original linearity moves into the side condition as
==K, which booster can discharge via the path constraint (or via its SMT path) without an indeterminate-match abort. Semantically equivalent on concrete inputs and strictly more permissive on symbolic inputs in a sound direction (matches when args are semantically equal but not syntactically).Recover-mode sweep identified 12 kore-execute handoffs (all benchmarks ecrecover variants) caused by this exact match-fail abort. Validated locally on benchmarks/ecrecover00-siginvalid-spec.k.