Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d1683ca
Scaffold G1 S5–S8 follow-up plan
Th0rgal May 11, 2026
cca8c5d
docs: add implementation research addendum to G1 S5-S8 plan
Th0rgal May 11, 2026
8b9077a
G1 Layer B: harness append/leave equation helpers for switch-id dispa…
May 11, 2026
1fdab2b
Layer A: IR-side observational-equality lemmas (G1 S5-S8 follow-up)
May 12, 2026
ade52b0
Layer A: weaken IRStmtPreservesObs predicate (drop vacuous storage/ev…
Th0rgal May 12, 2026
136ea12
docs: addendum on Layer A predicate evaluability issue + recommended …
Th0rgal May 12, 2026
85a08de
Layer A scaffolding: LetManyFree + NotTerminator side-condition helpers
Th0rgal May 12, 2026
af6974e
Layer A: add state-relative IRStmtPreservesObsAt with unconditional c…
Th0rgal May 12, 2026
2fb9df0
Layer A: cross-cast lemmas for let_/assign/sstore (state-relative)
Th0rgal May 12, 2026
dd4171a
Layer A: remove iff_forall_state lemma (CI Lean 4.22.0 mis-parses ide…
Th0rgal May 12, 2026
6bbcc0d
Layer A: cross-cast batch 2a (tstore, mstore)
Th0rgal May 12, 2026
46a223b
Layer A: cross-cast batch 2b (mstore8, calldatacopy, returndatacopy)
Th0rgal May 12, 2026
562566f
Layer A: cross-cast batch 2c (log0..log4)
Th0rgal May 12, 2026
ac501e6
Layer A: cross-cast batch 3a (sstore_mappingSlot, sstore_ident)
Th0rgal May 12, 2026
3013aca
Layer A: cross-cast batch 3b (sstore_add + general expr_call_opaque)
Th0rgal May 12, 2026
212ff12
Layer A: strengthen IRStmtPreservesObsAt + StmtsContinueFrom + state-…
Th0rgal May 12, 2026
d333e45
Layer A: composition helpers for StmtsContinueFrom
Th0rgal May 12, 2026
ec81774
Layer A: fix CI red on d333e451 (dedup + unused simp args)
Th0rgal May 12, 2026
3ef9105
Layer A: remove final unused simp args in expr_call_opaque
Th0rgal May 12, 2026
b7ed463
Layer A: fix CI strict-Lean unsolved-goals on opaque expr_call branches
Th0rgal May 12, 2026
a06336d
Layer A: restore expr_call_opaque cross-cast + add funcDef
Th0rgal May 12, 2026
f2f651c
Merge remote-tracking branch 'upstream/main' into native-evmyullean-g…
Th0rgal May 12, 2026
77f6fda
upstream/main fix candidate: mulDiv512Down/Up missing cases in Suppor…
Th0rgal May 12, 2026
6e7ded7
upstream/main fix: paramDynamicHeadWord + wildcard expansion in Suppo…
Th0rgal May 12, 2026
dfdd124
upstream/main fix: add paramDynamicHeadWord/mulDiv512 to 6 cases-on-E…
Th0rgal May 12, 2026
b62e297
allowlist: 2 SupportedSpec proofs that grew past 50 lines
Th0rgal May 13, 2026
dde16bd
upstream/main fix: SourceSemantics — wildcard expansion + new constru…
Th0rgal May 13, 2026
d2d7423
upstream/main fix: total defs + new SupportedSpec _eq_false lemmas + …
Th0rgal May 13, 2026
e9a9486
G1 E3 + E5: success-bridge chains for of_block_empty and of_singleton…
Th0rgal May 13, 2026
796743f
Merge remote-tracking branch 'upstream/main' into native-evmyullean-g…
Th0rgal May 13, 2026
5f8e602
Add parallel _revived preservation predicates with leave-singleton br…
Th0rgal May 13, 2026
2f8a801
Add NativeStmtPreservesWord_revived_empty_block
Th0rgal May 13, 2026
2626f28
Regenerate PrintAxioms.lean for Path B revived predicates
Th0rgal May 13, 2026
f68edb3
Merge Path B foundation: parallel _revived preservation predicates
Th0rgal May 13, 2026
fb413b0
Merge remote-tracking branch 'upstream/main' into native-evmyullean-g…
Th0rgal May 13, 2026
0179448
Cascade fix for upstream Expr.arrayElementDynamicMember{Length,Element}
Th0rgal May 13, 2026
d847ce8
Add _revived block adapter + .Block [.Leave] composition
Th0rgal May 13, 2026
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
8 changes: 8 additions & 0 deletions Compiler/CompilationModelFeatureTest.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2536,6 +2536,14 @@ private def adtAliasPayloadMemoizesExprSpec : CompilationModel := {
{ name := "choice", ty := FieldType.adt "Choice" 1, «slot» := some 10, aliasSlots := [100] }
]
«constructor» := none
externals := [
{ name := "echo"
params := [ParamType.uint256]
returnType := some ParamType.uint256
returns := [ParamType.uint256]
axiomNames := []
}
]
functions := [
{ name := "store"
params := [{ name := "input", ty := ParamType.uint256 }]
Expand Down
137 changes: 137 additions & 0 deletions Compiler/Proofs/EndToEnd.lean
Original file line number Diff line number Diff line change
Expand Up @@ -18947,6 +18947,77 @@ private theorem NativeGeneratedSelectorHitUserBodyPreservesBridgeAtFuel.of_empty
reservedNames n0))
(EvmYul.UInt256.ofNat 1) (some nativeContract)

/-- Selected user bodies of shape `[.block []]` lower to `[.Block []]`, which
preserves the generated matched flag via `NativeStmtPreservesWord_empty_block`. -/
private theorem NativeGeneratedSelectorHitUserBodyPreservesBridgeAtFuel.of_block_empty
(irContract : IRContract)
(tx : IRTransaction)
(hBlockEmpty :
∀ fn,
irContract.functions.find? (fun fn => fn.selector == tx.functionSelector) =
some fn →
fn.body = [.block []]) :
NativeGeneratedSelectorHitUserBodyPreservesBridgeAtFuel irContract tx := by
intro nativeContract fn reservedNames n0 cases' body' bodyNative bodyStart
bodyEnd userBodyStart _hLowerRuntime hFind _hCase _hBodyLower
hUserBodyLower _pre _suffix _hCases
have hBody : fn.body = [.block []] := hBlockEmpty fn hFind
rw [hBody] at hUserBodyLower
simp [Compiler.Proofs.YulGeneration.Backends.lowerStmtsNativeWithSwitchIds_cons,
Compiler.Proofs.YulGeneration.Backends.lowerStmtsNativeWithSwitchIds_nil,
Compiler.Proofs.YulGeneration.Backends.lowerStmtGroupNativeWithSwitchIds_block,
Bind.bind, Except.bind, Pure.pure, Except.pure, List.append_nil]
at hUserBodyLower
rcases hUserBodyLower with ⟨rfl, _rfl⟩
exact
Compiler.Proofs.YulGeneration.Backends.Native.NativeBlockPreservesWord_singleton
(Compiler.Proofs.YulGeneration.Backends.nativeSwitchMatchedTempName
(Compiler.Proofs.YulGeneration.Backends.freshNativeSwitchId
reservedNames n0))
(EvmYul.UInt256.ofNat 1) (.Block []) (some nativeContract)
(Compiler.Proofs.YulGeneration.Backends.Native.NativeStmtPreservesWord_empty_block
(Compiler.Proofs.YulGeneration.Backends.nativeSwitchMatchedTempName
(Compiler.Proofs.YulGeneration.Backends.freshNativeSwitchId
reservedNames n0))
(EvmYul.UInt256.ofNat 1) (some nativeContract))

/-- Selected user bodies of shape `[.comment text]` lower to `[.Block []]`
(comments are no-ops in the native backend), which preserves the generated
matched flag via `NativeStmtPreservesWord_empty_block`. -/
private theorem NativeGeneratedSelectorHitUserBodyPreservesBridgeAtFuel.of_singleton_comment
(irContract : IRContract)
(tx : IRTransaction)
(hComment :
∀ fn,
irContract.functions.find? (fun fn => fn.selector == tx.functionSelector) =
some fn →
∃ text, fn.body = [.comment text]) :
NativeGeneratedSelectorHitUserBodyPreservesBridgeAtFuel irContract tx := by
intro nativeContract fn reservedNames n0 cases' body' bodyNative bodyStart
bodyEnd userBodyStart _hLowerRuntime hFind _hCase _hBodyLower
hUserBodyLower _pre _suffix _hCases
obtain ⟨text, hBody⟩ := hComment fn hFind
rw [hBody] at hUserBodyLower
rcases Compiler.Proofs.YulGeneration.Backends.Native.lowerStmtsNativeWithSwitchIds_comment_head_eq
reservedNames userBodyStart text [] bodyNative bodyEnd hUserBodyLower
with ⟨rest', hShape, hRest⟩
simp [Compiler.Proofs.YulGeneration.Backends.lowerStmtsNativeWithSwitchIds_nil]
at hRest
rcases hRest with ⟨hRest', _⟩
subst hRest'
subst hShape
exact
Compiler.Proofs.YulGeneration.Backends.Native.NativeBlockPreservesWord_singleton
(Compiler.Proofs.YulGeneration.Backends.nativeSwitchMatchedTempName
(Compiler.Proofs.YulGeneration.Backends.freshNativeSwitchId
reservedNames n0))
(EvmYul.UInt256.ofNat 1) (.Block []) (some nativeContract)
(Compiler.Proofs.YulGeneration.Backends.Native.NativeStmtPreservesWord_empty_block
(Compiler.Proofs.YulGeneration.Backends.nativeSwitchMatchedTempName
(Compiler.Proofs.YulGeneration.Backends.freshNativeSwitchId
reservedNames n0))
(EvmYul.UInt256.ofNat 1) (some nativeContract))

/-- Empty selected user bodies discharge the full revived selector-hit user-body
bridge. -/
private theorem NativeGeneratedSelectorHitUserBodyExecBridgeAtFuelRevived.of_empty_body
Expand Down Expand Up @@ -21424,6 +21495,72 @@ private theorem NativeGeneratedSelectorHitSuccessBridge.of_empty_body
(NativeGeneratedSelectorHitUserBodyExecBridgeAtFuelRevived.of_empty_body
irContract tx state observableSlots hEmpty)

/-- Selected user bodies of shape `[.block []]` supply the named selector-hit
success bridge. The exec-only Revived leaf is the existing `of_block_empty`
constructor; the matched-flag preservation half is discharged by the
matching preserves bridge `of_block_empty`. -/
private theorem NativeGeneratedSelectorHitSuccessBridge.of_block_empty
(spec : CompilationModel.CompilationModel) (selectors : List Nat)
(hSupported : SupportedSpec spec selectors)
(irContract : IRContract)
(tx : IRTransaction)
(state : IRState)
(observableSlots : List Nat)
(hcompile : CompilationModel.compile spec selectors = Except.ok irContract)
(hSelectorRange : tx.functionSelector < Compiler.Constants.selectorModulus)
(hSelectorsRange :
∀ selector, selector ∈ selectors →
selector < Compiler.Constants.selectorModulus)
(hNoWrap : 4 + tx.args.length * 32 < EvmYul.UInt256.size)
(hBlockEmpty :
∀ fn,
irContract.functions.find? (fun fn => fn.selector == tx.functionSelector) =
some fn →
fn.body = [.block []]) :
NativeGeneratedSelectorHitSuccessBridge irContract tx state
observableSlots :=
NativeGeneratedSelectorHitSuccessBridge.of_selected_user_body_exec_only_and_preserves
spec selectors hSupported irContract tx state observableSlots hcompile
hSelectorRange hSelectorsRange hNoWrap
(NativeGeneratedSelectedUserBodyExecOnlyBridgeAtFuelRevived.of_block_empty
irContract tx state observableSlots hBlockEmpty)
(NativeGeneratedSelectorHitUserBodyPreservesBridgeAtFuel.of_block_empty
irContract tx hBlockEmpty)

/-- Selected user bodies of shape `[.comment text]` supply the named selector-hit
success bridge. The exec-only Revived leaf is the existing `of_singleton_comment`
constructor; the matched-flag preservation half is discharged by the
matching preserves bridge `of_singleton_comment`. The lowered native shape is
identical to `.of_block_empty` (a single `.Block []`), so the same
`NativeStmtPreservesWord_empty_block` discharges the inner per-stmt obligation. -/
private theorem NativeGeneratedSelectorHitSuccessBridge.of_singleton_comment
(spec : CompilationModel.CompilationModel) (selectors : List Nat)
(hSupported : SupportedSpec spec selectors)
(irContract : IRContract)
(tx : IRTransaction)
(state : IRState)
(observableSlots : List Nat)
(hcompile : CompilationModel.compile spec selectors = Except.ok irContract)
(hSelectorRange : tx.functionSelector < Compiler.Constants.selectorModulus)
(hSelectorsRange :
∀ selector, selector ∈ selectors →
selector < Compiler.Constants.selectorModulus)
(hNoWrap : 4 + tx.args.length * 32 < EvmYul.UInt256.size)
(hComment :
∀ fn,
irContract.functions.find? (fun fn => fn.selector == tx.functionSelector) =
some fn →
∃ text, fn.body = [.comment text]) :
NativeGeneratedSelectorHitSuccessBridge irContract tx state
observableSlots :=
NativeGeneratedSelectorHitSuccessBridge.of_selected_user_body_exec_only_and_preserves
spec selectors hSupported irContract tx state observableSlots hcompile
hSelectorRange hSelectorsRange hNoWrap
(NativeGeneratedSelectedUserBodyExecOnlyBridgeAtFuelRevived.of_singleton_comment
irContract tx state observableSlots hComment)
(NativeGeneratedSelectorHitUserBodyPreservesBridgeAtFuel.of_singleton_comment
irContract tx hComment)

/-- Generated `callDispatcher` result theorem from `SupportedSpec + compile`,
modulo the exact-fuel lowered-user-body proof stated against
`execIRFunction`, with generated guard failures already discharged.
Expand Down
Loading
Loading