Summary
SupportedSpec and the Layer 2 theorem surface are now helper-proof-ready on the source side, but the compiled-side IR semantics still cannot execute internal helper calls. execIRFunction only runs the compiled external function body and ignores IRContract.internalFunctions, so any generic helper-summary composition proof remains blocked even after the source-side summary/rank interfaces exist.
This issue tracks the compiled-side theorem target and proof architecture needed to make internal helper composition a real generic Layer 2 capability instead of a fail-closed exclusion.
Why this is the next structural blocker
PR #1633 split the body witness into feature-local interfaces and added:
- positive direct-callee helper-summary inventory (
SupportedBodyHelperInterface.summaryOf)
- a decreasing helper-rank interface (
calleeRanksDecrease)
- helper-aware source semantics (
evalExprWithHelpers, execStmtListWithHelpers, interpretInternalFunctionFuel)
- theorem-level proof wrappers (
SupportedSpecHelperProofs)
What still blocks end-to-end generic helper reuse:
SupportedStmtList still excludes helper-call syntax, so generic body proofs do not yet admit helper forms.
GenericInduction.supported_function_body_correct_from_exact_state_generic_with_helpers still collapses helper-aware source semantics back to helper-free semantics through calls.helperCompatibility.
Compiler.Proofs.IRGeneration.IRInterpreter.execIRFunction does not model internal helper call composition at all.
The third point is the compiled-side blocker. Without an IR semantics that can execute helper calls, consuming source-side helper summaries alone would not strengthen compile_preserves_semantics for helper-using contracts.
Scope
- define the exact IR semantics target for internal helper composition
- make the target compatible with the existing generic theorem surface, ideally via helper-aware/contract-aware IR execution plus compatibility lemmas on the current helper-free fragment
- preserve proof genericity: no contract-specific helper assumptions, no demo-only shortcuts
- keep the trusted boundary explicit if any temporary compatibility reduction remains
Candidate implementation shape
- add contract-aware IR execution that can resolve calls against
IRContract.internalFunctions
- introduce explicit fuel / rank discipline for internal helper execution on the IR side, aligned with the source-side decreasing helper-rank interface
- retarget the generic theorem stack to the richer IR semantics family while proving equivalence to the current
execIRFunction / interpretIR on the existing supported fragment
- only then thread helper-summary soundness/rank evidence through the body proof to remove
SupportedBodyCallInterface.helperCompatibility
Acceptance criteria
- the remaining helper blocker is no longer "IR semantics has no internal helper composition"
- the exact compiled-side theorem target for helper-using contracts is encoded in code/docs, not only in prose
- the public Layer 2 theorem surface does not need another theorem-shape rewrite when helper composition is proved
- docs and
artifacts/layer2_boundary_catalog.json link to this issue as the compiled-side helper blocker
Part of #1630.
Related: #1510, #1633.
Summary
SupportedSpecand the Layer 2 theorem surface are now helper-proof-ready on the source side, but the compiled-side IR semantics still cannot execute internal helper calls.execIRFunctiononly runs the compiled external function body and ignoresIRContract.internalFunctions, so any generic helper-summary composition proof remains blocked even after the source-side summary/rank interfaces exist.This issue tracks the compiled-side theorem target and proof architecture needed to make internal helper composition a real generic Layer 2 capability instead of a fail-closed exclusion.
Why this is the next structural blocker
PR #1633 split the body witness into feature-local interfaces and added:
SupportedBodyHelperInterface.summaryOf)calleeRanksDecrease)evalExprWithHelpers,execStmtListWithHelpers,interpretInternalFunctionFuel)SupportedSpecHelperProofs)What still blocks end-to-end generic helper reuse:
SupportedStmtListstill excludes helper-call syntax, so generic body proofs do not yet admit helper forms.GenericInduction.supported_function_body_correct_from_exact_state_generic_with_helpersstill collapses helper-aware source semantics back to helper-free semantics throughcalls.helperCompatibility.Compiler.Proofs.IRGeneration.IRInterpreter.execIRFunctiondoes not model internal helper call composition at all.The third point is the compiled-side blocker. Without an IR semantics that can execute helper calls, consuming source-side helper summaries alone would not strengthen
compile_preserves_semanticsfor helper-using contracts.Scope
Candidate implementation shape
IRContract.internalFunctionsexecIRFunction/interpretIRon the existing supported fragmentSupportedBodyCallInterface.helperCompatibilityAcceptance criteria
artifacts/layer2_boundary_catalog.jsonlink to this issue as the compiled-side helper blockerPart of #1630.
Related: #1510, #1633.