-
-
Notifications
You must be signed in to change notification settings - Fork 0
TG-6: WASM compilation preserves semantics (compiler-correctness theorem) #27
Copy link
Copy link
Open
Labels
bindingsABI, FFI, WASM, and cross-language interop surfacesABI, FFI, WASM, and cross-language interop surfacesenhancementNew capability or improvement to existing behaviourNew capability or improvement to existing behaviourproofsFormal verification: Agda, Coq, Idris, Lean, Z3/SMT, axiom debtFormal verification: Agda, Coq, Idris, Lean, Z3/SMT, axiom debt
Description
Activity
Metadata
Metadata
Assignees
Labels
bindingsABI, FFI, WASM, and cross-language interop surfacesABI, FFI, WASM, and cross-language interop surfacesenhancementNew capability or improvement to existing behaviourNew capability or improvement to existing behaviourproofsFormal verification: Agda, Coq, Idris, Lean, Z3/SMT, axiom debtFormal verification: Agda, Coq, Idris, Lean, Z3/SMT, axiom debt
Source: PROOF-NARRATIVE.md §3 TG-6.
Claim
For every closed well-typed
e, the source-level evaluation ofeand the WASM execution ofcompile_to_wasm(e)agree on the observable result.Why valuable
This is the compiler-correctness theorem for the WASM backend. Without it, the structural reasoning Tangle claims means "something" on the runtime is unverified. Currently a trust-us claim.
Aligns with the broader estate typed-wasm proof-debt arc (
project_typed_wasm_proof_debt_post_a10) and the WasmCert-Isabelle tie-back referenced there.Assumptions
[[A-TG-6.1]]Standard WASM small-step semantics is well-defined (wasm-spec / WasmCert-Isabelle).[[A-TG-6.2]]Source semantics has no floating-point non-determinism (Tangle has onlyIntcurrently).Acceptance criteria (research-grade; expect multiple PRs)
compile_to_wasm— or reuse WasmCert if it can be imported.R(e, w)holds iff WASM statewrepresents source expressione.R(e, w) ∧ e ⟶ e' ⟹ ∃ w'. w ⟶* w' ∧ R(e', w').R(e, w) ∧ w ⟶ w' ⟹ ∃ e'. e ⟶* e' ∧ R(e', w').axiom/sorry/postulate.Effort
3+ weeks (research-grade). Comparable to CompCert's WASM backend work. Should be staged:
Suggested phasing
AddandEqlower correctly.BraidLitlowering. Bytewise equality between source AST and the WASM-emitted braid representation.ComposeandTensorlowering. Algebraic equivalence using T-WidthAppend and T-WidthShift.Close. The semantic move fromword ntoword 0.Relationship to other obligations
Out of scope