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
feat(tg-8): virtual-knot dialect as a conservative extension of core (template)
TG-8 template. compiler/lib/dialect_vk.ml models the virtual-knot dialect (the
virtual braid monoid VBn, braids plus involutive virtual crossings v_i) as a
CONSERVATIVE EXTENSION of the core braid language: a vgen is a real crossing or
a virtual crossing; the real fragment embeds via `embed`, and every decision on
it is DELEGATED to Braid_equiv (TG-7). Conservativity therefore holds BY
CONSTRUCTION -- the dialect cannot change core typing/semantics.
compiler/test/tg8/tg8_conservativity.ml (2311 assertions) verifies: faithful
embedding (project . embed = id); the dialect decides core terms exactly as the
core procedure (decide_trivial (embed w) = Some (is_trivial w); equiv likewise);
permutation/writhe invariants agree on the real fragment; proper extension (a
virtual crossing is a genuinely-new non-real element, v_i v_i = e); and an
honest partial-decision frontier (irreducible mixed virtual content -> None,
never guessed).
Built as a SEPARATE module: no core-AST or Lean-oracle edits, avoiding the
Warning 8 exhaustiveness cascade and keeping the proof oracle safe. Honest
scope: this is the dialect's semantic core + conservativity bridge, not a
surface-syntax parser integration, and VBn equivalence is a sound partial
decider. Surface syntax, the other four dialects (replicate the template), and
a Lean conservativity proof are the next rungs (PROOF-NEEDS.md TG-8).
dune runtest green (existing 597 + tg3 1008 + tg5 189 + tg7 2220 + tg8 2311).
Docs: PROOF-NEEDS, CHANGELOG, STATE.a2ml.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"BLOCKED (TG-8): dialects are README-only — need one dialect implemented (AST+parser+HasType/Step+eval) before conservativity is even stateable",
39
+
"TEMPLATE-DONE (TG-8): virtual-knot conservative-extension template — compiler/lib/dialect_vk.ml (VBn = core + virtual layer delegating to Braid_equiv on the real fragment; conservativity by construction) + compiler/test/tg8 (2311 assertions). Remaining: surface syntax, other 4 dialects, Lean conservativity proof.",
40
40
"RUNG-DONE (TG-7): out-of-band braid_equiv (Dehornoy handle reduction) in compiler/lib/braid_equiv.ml — decides braid-group equivalence WITHOUT changing == (compiler/test/tg7, 2220 assertions). Routing == through it stays an owner decision; Lean correctness research-grade.",
41
41
"RUNG-DONE (TG-6): wasm differential — compiler/tangle-wasm/tests/differential.rs executes generated wasm via wasmi (dev-dep) and checks strand permutation == reference model (trefoil, non-commuting, braid-relation, 5-strand). Codegen-vs-semantics; not a cross-binary eval.ml diff; full bisimulation research-grade.",
42
42
]
@@ -47,12 +47,12 @@ issues = []
47
47
[critical-next-actions]
48
48
actions = [
49
49
"TG-7 OWNER DECISION (rung done): out-of-band braid_equiv now exists (compiler/lib/braid_equiv.ml). Decide whether to route `==`/Step.eqBraids through it (semantics change to eval.ml + Lean + proofs) or keep them list-equality and use braid_equiv only as a tool.",
50
-
"TG-8 prerequisite: implement one dialect end-to-end (virtual-knot suggested) as the conservativity template; dialects are currently README-only.",
50
+
"TG-8 (template done): replicate the virtual-knot conservative-extension template to the other 4 dialects; add surface syntax; mechanise the Lean conservativity proof.",
51
51
"TG-6 (rung done): optional next rungs = cross-binary differential vs eval.ml; Markov-helper coverage; Lean/WasmCert bisimulation (research-grade).",
52
52
"TangleIR Julia: implement EchoClosed node in KRLAdapter.jl per contract (quandledb session)",
Copy file name to clipboardExpand all lines: PROOF-NEEDS.md
+26-17Lines changed: 26 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ Cross-referenced to [PROOF-NARRATIVE.md §3](PROOF-NARRATIVE.md#3-remaining-obli
60
60
| TG-5 |`compositional.ml` (418 LoC) rewriter preserves types | TP | OCaml property test | P2 | — |**LANDED** (`compiler/test/tg5/tg5_invariants.ml`, 189 assertions in `dune runtest`). compositional is below the Ty layer, so "preserves types" = preserves the PD-lowering structural invariants + echo residue-recovery: `OpenWord`/`ClosedDiagram`/`EchoClosed` each pinned (closedness, `\|crossings\|`=unit-length, source unit-expanded, **verbatim residue** for `EchoClose` with `expand(residue)=diagram word` and echo-diagram pdv1-identical to plain `close`), error paths, count pins. Lean IR model = optional later rung |
61
61
| TG-6 | WASM compilation preserves semantics (source eval ≡ wasm exec) | TP / ALG | differential + Lean bisimulation | P1 | — |**RUNG LANDED (differential)**: `compiler/tangle-wasm/tests/differential.rs` EXECUTES the generated wasm with the `wasmi` interpreter (dev-dep) and checks the braid strand-permutation equals an independent reference model (trefoil, non-commuting pairs, braid-relation pairs, 5-strand weave). Validates codegen vs the permutation semantics; not a cross-binary diff against `eval.ml`, and Markov helpers untested. Full source↔wasm bisimulation (WasmCert) remains research-grade |
62
62
| TG-7 |`Step.eqBraids` decides braid-group equivalence (not list equality) | ALG / DOM | OCaml + Lean 4 | P2 | — |**RUNG LANDED (non-semantic)**: `compiler/lib/braid_equiv.ml` decides braid-group equivalence via Dehornoy handle reduction, out-of-band (leaves `==`/`Step.eqBraids` as list equality). Tested (`compiler/test/tg7`, 2220 assertions: defining relations + 400 constructed-equivalent pairs + invariant-distinguished negatives). **Still OWNER-GATED**: whether to route `==` through it (a semantics change to eval.ml + Lean Step + proofs) is a language-design decision; Lean correctness (Garside/Dehornoy) remains research-grade |
63
-
| TG-8 | Each dialect (braid-calculus, quantum-circuit, skein-algebra, string-diagram, virtual-knot) is a conservative extension of core | TP |Lean 4 per-dialect | P3 |1w each | NOT STARTED|
63
+
| TG-8 | Each dialect (braid-calculus, quantum-circuit, skein-algebra, string-diagram, virtual-knot) is a conservative extension of core | TP |OCaml model + Lean per-dialect | P3 |— |**TEMPLATE LANDED (virtual-knot)**: `compiler/lib/dialect_vk.ml` models VBₙ ⊃ Bₙ as core + a virtual layer that DELEGATES to `Braid_equiv` on the real fragment, so conservativity holds by construction; `compiler/test/tg8` (2311 assertions) verifies faithful embedding, core-delegation, invariant agreement, proper extension, virtual involution, honest undecided-frontier. Remaining: surface-syntax parser integration, the other 4 dialects (replicate the template), and a Lean conservativity proof|
64
64
| TG-9 | LSP diagnostics are a subset of `HasType` failures (no LSP-only diagnostics) | INV | Audit + refactor | P2 | — |**LANDED** (`tangle-lsp` delegates all diagnostics to `tanglec --check` ⇒ `compiler/lib/check.ml`; hand-rolled LSP-only false positives removed. Subset holds by construction. Tests: `test_check.ml` + tangle-lsp unit/delegation tests) |
65
65
| TG-10 | Echo-types integrated into the type system: `Echo[ρ,τ]` former + `echoClose`/`lower`/`residue`/`echoAdd`/`echoEq` + product type (`pair`/`fst`/`snd`), with Progress/Preservation/Determinism/TypeSafety extended to cover them and the non-injectivity / residue-recovery capstones proven | TP / DOM | Lean 4 | P1 | — |**LANDED** (`proofs/Tangle.lean` §ECHO-TYPES) |
66
66
@@ -70,12 +70,13 @@ assumptions each rests on, see PROOF-NARRATIVE.md.
70
70
## Scoping of the remaining obligations (2026-06-14)
71
71
72
72
Concrete approach, effort, risk, and dependencies for what is left after
73
-
TG-0/1/2/3/4/5/9/10 landed. **Landable rungs of TG-6 and TG-7 also landed**
74
-
(2026-06-14): TG-6 now has a `wasmi` differential test executing the generated
75
-
wasm; TG-7 has an out-of-band `braid_equiv` checker. What genuinely remains is
76
-
**prerequisite-gated, not effort-gated**: TG-8 needs a dialect to exist as code;
77
-
TG-7's *semantics change* needs an owner decision; TG-6's *full bisimulation*
78
-
and TG-7's *Lean correctness proof* are research-grade.
73
+
TG-0/1/2/3/4/5/9/10 landed. **Landable rungs of TG-6, TG-7, and TG-8 also
74
+
landed** (2026-06-14): TG-6 a `wasmi` differential test; TG-7 an out-of-band
75
+
`braid_equiv` checker; TG-8 a virtual-knot conservative-extension template. What
76
+
genuinely remains is **owner-gated or research-grade**: TG-7's *semantics
77
+
change* (decision); TG-8's *surface-syntax integration + other 4 dialects +
78
+
Lean conservativity proof*; TG-6's *full source↔wasm bisimulation* and TG-7's
0 commit comments