feat(evm): add proof-facing step runs - #5
Conversation
…p at a time The module did not build: with `autoImplicit=false` the `Runs` inductive left `instr`/`pre`/`mid`/`n` unbound, and the concrete fixture asked `rfl` to evaluate seven opcodes, which exceeded the heartbeat limit. `Runs` now labels every entry with its own fuel and gas cost. `X` decrements fuel per iteration and recomputes gas through `C'`, so a run under one shared gas cost could not describe any real code execution. Adds the one-step decomposition of `X` itself: a complete case analysis over out of fuel, exceptional halt, failing step, non-halting continuation, normal halt and `REVERT`, plus `XStep`/`XRuns` chaining them. `X`'s `W`/`Z`/`H` are local `let`s, so they are mirrored here; each decomposition theorem unfolds `X` and rewrites with the mirror, so drift breaks the proof rather than passing silently.
…relations `XRuns.length` claimed that a run executes one instruction per unit of fuel, but the trace it produced was existential and unrelated to the run, so any list of the right length proved it. `XRuns` now carries the trace as an index, built from the gas cost each step actually charged, which makes the fuel accounting a statement about the run. `XStepAt` exposes that gas cost, and `XStepAt.deterministic` shows `Z` fixes it. Nothing so far witnessed a non-reflexive `XStep`, so the X-level API could have been vacuous. `Z_JUMPDEST` discharges the exceptional-halting check for any state that can pay `Gjumpdest` with room on the stack, giving an `XStepAt` and a one-instruction `XRuns`.
|
@codex review Pushed The previous head did not compile. With What the proof API now offers
Two things worth your attention
Verification
Please look hardest at whether any statement is weaker than it reads, and at the mirror/ |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Scope
This is F4a: generic EVMYulLean proof-facing execution infrastructure over the existing executable
EvmYul.EVM.step.It adds:
Exceptresults;Runsrelation for successful steps;runN, with soundness and completeness;runN_sound.No opcode semantics are duplicated, and there are no changes to gas accounting, accounts,
X,Xi, or opcode implementations.F4b—decomposition or equivalence results involving
X/Xi—is explicitly left to a later PR. This PR makes no EIP-8282 guarantee.Verification
lake env lean EvmYul/EVM/Proof/Execution.leanlake build EvmYullake buildlake build yulSemanticsTests && lake env yulSemanticsTestsgit diff --checksorry|admit|axiom|native_decide: zero matchesThe lightweight Yul semantics test executable completed successfully. No external Ethereum conformance corpus was run.