Dialect/EVM: split opcode frontend + executable interpreter from meta theory - #39
Merged
chriseth merged 1 commit intoJul 27, 2026
Conversation
…theory Blanket `import Mathlib` in `Dialect/EVM.lean` forced the entire Mathlib library onto the import path of anything using the EVM dialect — including a compiler executable that only needs to build/run the dialect, not reason about it. Statically linking Mathlib made a downstream `yulc` binary ~158 MB. Split the module three ways along the Mathlib boundary: * `Dialect/EVMOp.lean` — opcode enum `Op`, `U256`, `opName`/`parse`/`mkCall`, `litValue`/`litWF`, `effects`. Mathlib-free (builds in 13 jobs). * `Dialect/EVMExec.lean` — the executable interpreter: `EvmState`, `stepOp`, state helpers, and the `evm`/`evmWithExternal`/`exec` dialect instances. Mathlib-free (14 jobs); imports EVMOp. * `Dialect/EVM.lean` — metatheory only (`effects_sound`, `exec_lawful`, `@[simp]` state lemmas, worked examples). Imports EVMExec + Mathlib. Purely additive: `import YulSemantics.Dialect.EVM` still re-exports the whole `YulSemantics.EVM` namespace, so every existing downstream module builds unchanged. Downstream code that wants a Mathlib-free path can now import `Dialect.EVMExec` (interpreter) or `Dialect.EVMOp` (opcodes) instead. Full library builds; no proof content changed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chris-ai1
force-pushed
the
agent/split-evm-dialect-mathlib-free
branch
from
July 27, 2026 12:22
9600a4b to
dc92e2c
Compare
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.
Blanket
import MathlibinDialect/EVM.leanforced the entire Mathlib library onto the import path of anything using the EVM dialect — including a compiler executable that only needs to build/run the dialect, not reason about it. Statically linking Mathlib madeyulc~158 MB.Split the module three ways along the Mathlib boundary:
Dialect/EVMOp.lean— opcode enumOp,U256,opName/parse/mkCall,litValue/litWF,effects. Mathlib-free (builds in 13 jobs).Dialect/EVMExec.lean— the executable interpreter:EvmState,stepOp,state helpers, and the
evm/evmWithExternal/execdialect instances.Mathlib-free (14 jobs); imports EVMOp.
Dialect/EVM.lean— metatheory only (effects_sound,exec_lawful,@[simp]state lemmas, worked examples). Imports EVMExec + Mathlib.Syntax/ObjectRunnow import the lighterEVMExec(they need only the frontend/interpreter). No proof content changed; the full library still builds.