Summary
The axiom documentation for evalIRExpr_eq_evalYulExpr (AXIOMS.md and inline comments) claims that both evalIRExpr and evalYulExpr are partial functions, which is why an axiom is needed. However, only the IR side appears to use partial def.
AXIOMS.md Claim
Why Axiom?:
- Both
evalIRExpr and evalYulExpr are defined as partial functions (not provably terminating in Lean)
- Lean cannot prove equality between partial functions
- Functions have identical source code structure but different state type parameters
Actual Code
IR side (Compiler/Proofs/IRGeneration/IRInterpreter.lean):
partial def evalIRExpr (state : IRState) : YulExpr → Option Nat -- ✅ partial
Yul side — the Yul evaluator in Compiler/Proofs/YulGeneration/Semantics.lean uses fuel-based evaluation (the execYulStmtFuel pattern mentioned elsewhere), which may NOT be partial.
Why This Matters
If only evalIRExpr is partial and the Yul side is total (fuel-based), then:
- The axiom justification ("both are partial") is wrong
- The elimination strategy should be simpler — only the IR side needs refactoring
- The documentation overstates why the axiom is needed
Recommendation
- Verify whether
evalYulExpr in Semantics.lean is actually partial or fuel-based
- Correct AXIOMS.md to accurately describe the asymmetry
- Update the elimination strategy accordingly — refactoring only the IR evaluator to match the Yul evaluator's fuel pattern may be sufficient
Summary
The axiom documentation for
evalIRExpr_eq_evalYulExpr(AXIOMS.md and inline comments) claims that bothevalIRExprandevalYulExprarepartialfunctions, which is why an axiom is needed. However, only the IR side appears to usepartial def.AXIOMS.md Claim
Actual Code
IR side (
Compiler/Proofs/IRGeneration/IRInterpreter.lean):Yul side — the Yul evaluator in
Compiler/Proofs/YulGeneration/Semantics.leanuses fuel-based evaluation (theexecYulStmtFuelpattern mentioned elsewhere), which may NOT bepartial.Why This Matters
If only
evalIRExprispartialand the Yul side is total (fuel-based), then:Recommendation
evalYulExprinSemantics.leanis actuallypartialor fuel-based