You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Discharge TG-3 at the translation-validation level. Via TG-2 (infer ≡
HasType), refinement reduces to "OCaml infer_expr ≡ Lean infer on the core
fragment", established by three layers:
- Closure proof: the core fragment never yields TTangle under infer_expr
(strengthened entire-type-tree IH; `close` is the sole boundary gateway,
excluded). Write-up in proofs/TG3-REFINEMENT.md.
- Machine-checked half: proofs/TG3Differential.lean — 496 obligations
`infer [] e = <infer_expr e> := by decide`, GENERATED from the OCaml
checker by compiler/test/tg3/tg3_emit.ml and kernel-verified by Lean's
proven infer. New proofs/check-tg3-differential.sh, wired into
lean-proofs.yml.
- OCaml half: compiler/test/tg3 --check (dune runtest) — 1008 assertions
(closure invariant, curated pins, named->de Bruijn translation incl.
let-shadowing, and the OCaml side of every divergence).
Complete divergence catalogue (both sides pinned): D1 close (OCaml
Tangle[I,I] vs Lean word 0) + downstream family D1b pipeline(close,close),
D1c compose(braid,close) [OCaml rejects], D1d add(close,close); D2
bool==bool (OCaml extra-core convenience, Lean rejects).
Not claimed: a universal Lean theorem over all OCaml runs (would require
reflecting typecheck.ml); extra-core features are excluded, not modelled;
refinement is OCaml->Lean only.
dune runtest green (597 existing + tg3 1008); proofs/check-tg3-differential.sh
0 errors. Docs updated: PROOF-NEEDS, PROOF-NARRATIVE, echo-types-ocaml-pipeline,
CHANGELOG, STATE.a2ml.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"DONE: thread echo residue into the OCaml compositional IR — EchoClosed node (verbatim residue) in compositional.ml; echo_skein_sink + residue_blob; --compile-pd CLI; cross-repo TangleIR contract at ECHO-TANGLEIR-THREADING.md (Julia KRLAdapter.jl/quandledb still pending)",
| TG-3 | OCaml `typecheck.ml` refines the Lean `HasType` spec | TP | Lean 4 + translation validation | P1 | 5d | NOT STARTED (partial alignment: `Eq` now enforces same-width words to match `tEqWord`; `Bool == Bool` is a deliberate extra-core feature outside the 26-rule fragment, like `match`/`weave`/`mirror`/`compute` — these must be excluded from or added to the modelled core before TG-3 can close) |
58
+
| TG-3 | OCaml `typecheck.ml` refines the Lean `HasType` spec | TP | Lean 4 + translation validation | P1 | — | **LANDED** (translation-validation level — [`proofs/TG3-REFINEMENT.md`](proofs/TG3-REFINEMENT.md)). Reduced via TG-2 (`infer ≡ HasType`) to "OCaml `infer_expr` ≡ Lean `infer` on the core fragment", then discharged by: (a) a closure proof (core fragment never yields `TTangle`, strengthened tree-IH); (b) 496 Lean kernel-checked obligations in [`proofs/TG3Differential.lean`](proofs/TG3Differential.lean) generated from `infer_expr` by `compiler/test/tg3/tg3_emit.ml` (`by decide`; run `proofs/check-tg3-differential.sh`); (c) 1008 OCaml `--check` assertions (`dune runtest`). Complete divergence catalogue: **D1** `close` (OCaml `Tangle[I,I]` vs Lean `word 0` — sole boundary gateway, + downstream D1b/c/d) and **D2** `bool==bool` (OCaml accepts, Lean rejects). Extra-core feature list (model-later / declare-non-core) in TG3-REFINEMENT §3. Not claimed: a universal Lean proof over all OCaml runs (would require reflecting `typecheck.ml`); refinement is OCaml→Lean only |
59
59
| TG-4 | Pretty-print/parse round-trip on closed values | INV | OCaml property test (cheap) | P2 | 4h |**LANDED** (PR #46 — OCaml property test in `compiler/test/test_roundtrip.ml`, 26-entry corpus including 8 echo/product constructors; 52 round-trip runs) |
60
60
| TG-5 |`compositional.ml` (418 LoC) rewriter preserves types | TP | Lean 4 + OCaml test file | P2 | 3d | NOT STARTED (B6: no test file yet) |
0 commit comments