Skip to content

Commit 8957363

Browse files
QTT solo-core mechanisation: F1.4 + R2–R5 + M1 + S1–S3c + E4 + contractile overhaul (#111)
## Summary Large mechanisation milestone — the dev branch accumulates all proof work since v0.3.0 (post-PR #110). ### Coq solo-core advances (Coq 8.18.0, `−R . SoloCore`, axiom-free throughout) **F1.4 — Separated QTT context + both products + preservation (complete)** - Separated `tctx` (types) + `uvec` (quantities); `uadd` genuinely commutative/associative - Additive `&` (`TWith`, shared D, `Fst`/`Snd`) + multiplicative `⊗` (`TTensor`, split D, `LetPair`) - `ht_subst` open-context substitution lemma; `Theorem preservation : Preservation. Qed.` - `Theorem progress : Preservation. Qed.` — both axiom-free (`Print Assumptions` closed) **R2–R5 — Semiring functorisation + affine sub-usage + decidability** - R2: parametric soundness functor over any QTT semiring (tropical min-plus instance) - R3: affine sub-usage layer (`affine_pres` distinct) - R5: verified usage-walk checker ≡ static context-splitting (`check_sound`, `check_complete`, `check_correct`) - R5b: decidability of the affine judgement (`aff_type_dec`) **M1 — Me dialect + elaboration into Solo (mechanised translation)** - M1.0: `me_tm` AST + `translate : me_tm → solo_tm` - M1.1: universal elaboration adequacy (Visual Soundness, axiom-free) - M1.1b: universal linear-use `me_wt` spanning all `me_tm`; `MeIf` faithful **S1–S3c — Ensemble session-π core (n-party, axiom-free)** - S1.0: session-typed π-calculus (`SessionPi.v`); duality involution; well-typed ping-pong - S1.1a/b: communication-redex SR + full closed-system SR over `(νc)(P∣Q)` - S1.2: session fidelity + progress/deadlock-freedom - S1.3: n-ary labelled choice + equi-recursive `μ` type-layer + structural congruence preserves typing - S2: Duet by projection (axis-2 STRUCTURE; `proj_g` + `merge`) - S2.2: global choice + recursion by projection - S3a: n-party projection totality (first n≥3 theorem) - S3b: static n-party configuration - S3c.0–S3c.3: full label-union merge (`umerge`) + union-projection + n-ary located semantics + head-coupled message subject reduction (first earned n-party safety) **E4 — Echo-types residue-measure SEAM (Coq mirror, axiom-free)** - Coq mirror of the echo-types residue SEAM; `EchoMode` (Linear/Affine); `EchoResidue` ### Contractile overhaul The RSR-template-copied `Bustfile.a2ml` / `Dustfile.a2ml` both incorrectly described my-lang as "the canonical template for RSR compliance". my-lang is a **consumer** of the RSR template. Replaced with properly-scoped per-intent named files: - `bust/proof-ci-gate-absent.a2ml` — F5 gap (proofs.yml absent; axiom-regression mode) - `bust/idris2-parity-lag.a2ml` — Idris2 twin lags Coq on F1.4 (`?todo_preservation`, issue #108) - `dust/uninstall-coq-toolchain.a2ml` — clean Coq toolchain removal procedure - `dust/detach-echo-types-plugin.a2ml` — extract `TEcho`/`MkEcho`/`Weaken` as plugin crate `bust/` and `dust/` are **multi-file by design** — one bust entry per failure-mode, one dust entry per cleanup intention. ## Test plan - [ ] `coq_makefile -f _CoqProject -o CoqMakefile && make -f CoqMakefile` exits 0 in `proofs/verification/coq/solo-core/` - [ ] `Print Assumptions preservation.` → "Closed under the global context" for all headline theorems - [ ] `idris2 --build solo-core.ipkg` exits 0 (Idris2 parity tracked separately, issue #108) - [ ] `cargo test` exits 0 - [ ] `.machine_readable/contractiles/bust/*.a2ml` and `dust/*.a2ml` each have ≥1 file (Mustfile check) - [ ] No `Admitted` / stray `Axiom` in the Coq source https://claude.ai/code/session_01BwV2DWsjkBiNP3oscimMLV --- _Generated by [Claude Code](https://claude.ai/code/session_01BwV2DWsjkBiNP3oscimMLV)_
2 parents 45b770b + 99dc80d commit 8957363

96 files changed

Lines changed: 9909 additions & 2175 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/proofs.yml

Lines changed: 289 additions & 5 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,5 @@ CoqMakefile.conf
7070
*.vos
7171
*.glob
7272
.*.aux
73+
.*.d
7374
.lia.cache

.machine_readable/6a2/README.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// SPDX-License-Identifier: MPL-2.0
2+
// Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
23
// Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
34
# A2ML 6a2 Directory
45

.machine_readable/6a2/STATE.a2ml

Lines changed: 50 additions & 53 deletions
Large diffs are not rendered by default.

.machine_readable/contractiles/README.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// SPDX-License-Identifier: MPL-2.0
2+
// Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
23
// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
34
= Contractiles (my-lang)
45
:toc:

.machine_readable/contractiles/bust/Bustfile.a2ml

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# bust/idris2-parity-lag.a2ml — Failure mode: Idris2 twin lags Coq canonical
3+
# Author: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
4+
#
5+
# Verb: bust
6+
# Scope: my-lang Idris2 mechanised solo-core (twin of the canonical Coq core)
7+
# Failure mode: Idris2 ?todo_preservation open while Coq F1.4 is closed
8+
9+
@abstract:
10+
The Idris2 twin of the mechanised solo-core is behind the Coq canonical.
11+
F1.4 preservation is discharged in Coq (axiom-free, PR #104) but
12+
?todo_preservation remains open on the Idris2 track (issue #108).
13+
This is a parity-lag failure mode: the spec the Rust checker must
14+
satisfy is split across two mechanisations that are not in sync.
15+
@end
16+
17+
## Failure Mode
18+
19+
### idris2-preservation-open
20+
- class: parity_lag
21+
- description: ?todo_preservation in proofs/verification/idris/ is not discharged.
22+
The Idris2 twin cannot independently verify F1.4 preservation.
23+
- detection: "grep -r '?todo_preservation' proofs/verification/idris/ 2>/dev/null | grep -c ."
24+
- recovery_probe: "test -z \"$(grep -r '?todo_preservation' proofs/verification/idris/ 2>/dev/null)\""
25+
- recovery_path: >
26+
Discharge ?todo_preservation on the Idris2 track following the Coq template.
27+
Key: open-context substitution generalisation (ht_subst analogue in Idris2).
28+
Subst2 is subst0 u1 (subst0 (shift 0 u2) t) — carry the shifted-substituend
29+
lemma from the Coq ContextProps.v track.
30+
- expected_recovery_time_seconds: 14400
31+
- escalation: File GitHub issue (already filed as #108); track as in_progress in Intentfile
32+
- status: declared
33+
- notes: Coq F1.4 is done. The open-context subst2 generalisation is the template.
34+
35+
### idris2-build-broken
36+
- class: build_integrity
37+
- description: idris2 --build for the solo-core package fails; the Idris2
38+
mechanised core does not compile.
39+
- detection: "cd proofs/verification/idris && idris2 --build solo-core.ipkg 2>&1 | grep -q 'error'"
40+
- recovery_path: >
41+
Run idris2 --build; fix type errors. Usually triggered by upstream
42+
Idris2 API changes. Pin the Idris2 version in CI to 0.7.0 until the
43+
solo-core is updated.
44+
- expected_recovery_time_seconds: 1800
45+
- status: declared
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# bust/proof-ci-gate-absent.a2ml — Failure mode: proof CI not running
3+
# Author: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
4+
#
5+
# Verb: bust
6+
# Scope: my-lang (QTT multi-dialect language with mechanised Coq + Idris2 solo-core)
7+
# Failure mode: F5 gap — the proof CI leg is absent or disabled
8+
9+
@abstract:
10+
The mechanised solo-core proofs (Coq + Idris2) are not machine-checked in CI.
11+
This is the F5 gap: progress/preservation/axiom-freedom are locally verified
12+
but not enforced on every push. A regression that slips an `Admitted` into the
13+
substitution chain would pass CI silently.
14+
@end
15+
16+
## Failure Mode
17+
18+
### proof-ci-gate-absent
19+
- class: ci_gap
20+
- description: .github/workflows/proofs.yml missing or disabled; Coq + Idris2 proofs
21+
are not machine-checked on push. Any `Admitted` or axiom regression
22+
reaches main silently.
23+
- injection_probe: "mv .github/workflows/proofs.yml /tmp/proofs.yml.bak"
24+
- recovery_probe: "mv /tmp/proofs.yml.bak .github/workflows/proofs.yml"
25+
- detection: "test -f .github/workflows/proofs.yml && grep -q 'coqc\|coq_makefile' .github/workflows/proofs.yml"
26+
- recovery_path: Restore proofs.yml; see Intentfile.a2ml probe 'proof-ci'
27+
- expected_recovery_time_seconds: 300
28+
- status: declared
29+
- notes: F5 intent recorded in Intentfile.a2ml; mirrors echo-types' agda.yml pattern
30+
31+
### axiom-regression
32+
- class: proof_integrity
33+
- description: An `Admitted`, `admit`, or stray `Axiom` enters the substitution /
34+
preservation dependency cone without CI catching it.
35+
- detection: "coqtop -R proofs/verification/coq/solo-core SoloCore -e 'Require Import SoloCore. Print Assumptions preservation.' 2>/dev/null | grep -q 'Closed under the global context'"
36+
- recovery_path: >
37+
Identify the regression via `Print Assumptions preservation.` in coqtop.
38+
Remove the admitted term; discharge the obligation or file a Bustfile entry
39+
for the open proof obligation.
40+
- expected_recovery_time_seconds: 3600
41+
- status: declared
42+
- notes: CI currently checks this via proofs.yml axiom-free steps for all headline theorems

.machine_readable/contractiles/dust/Dustfile.a2ml

Lines changed: 0 additions & 62 deletions
This file was deleted.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# dust/detach-echo-types-plugin.a2ml — Cleanup intention: detach echo-types integration
3+
# Author: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
4+
#
5+
# Verb: dust
6+
# Scope: my-lang echo-types integration in the type system
7+
# Cleanup intention: detach the echo-types formal integration as a standalone plugin
8+
# if the project adopts a plugin architecture or needs to ship echo-types separately
9+
10+
@abstract:
11+
How to cleanly detach the echo-types type-system integration from my-lang's
12+
core type checker, exposing it as a plugin/optional extension rather than a
13+
built-in. This is advisory — echo-types are currently integrated into the
14+
type system as TEcho/MkEcho/Weaken and are not optional. Detachment would
15+
be a significant architectural change requiring a clear extension boundary.
16+
@end
17+
18+
## Cleanup Intention
19+
20+
### scope
21+
- description: Separate echo-types from the core QTT type system into a plugin layer
22+
- trigger: Plugin architecture adoption; shipping echo-types as a standalone crate
23+
- authority: Requires ADR update in META.a2ml; review with echo-types maintainer
24+
25+
## Steps
26+
27+
### 1-define-extension-boundary
28+
- description: Identify the minimal interface for echo-types integration
29+
- notes: >
30+
Current integration points in Typing.v / solo-core:
31+
- TEcho former type constructor
32+
- MkEcho / Weaken term constructors
33+
- T_Echo / T_Weaken typing rules
34+
- EchoMode (Linear/Affine) thin poset
35+
- EchoResidue (weakened representation)
36+
A plugin boundary must expose all five without coupling the core to
37+
the echo-types Coq/Agda formalisations.
38+
39+
### 2-extract-echo-module
40+
- description: Move TEcho/MkEcho/Weaken/T_Echo/T_Weaken into a separate Coq module
41+
- run: "cp proofs/verification/coq/solo-core/Typing.v /tmp/Typing.v.bak"
42+
- corrective: >
43+
Create proofs/verification/coq/solo-core/EchoIntegration.v with the echo
44+
constructors; update Typing.v to Import EchoIntegration. This is the
45+
boundary-extraction slice.
46+
47+
### 3-extract-echo-crate
48+
- description: Extract echo-types Rust integration into a separate crate
49+
- corrective: >
50+
Create crates/my-lang-echo/ with the TEcho representation; make
51+
crates/my-lang/ depend on it optionally via a feature flag.
52+
Update Cargo.toml: [features] echo = ["my-lang-echo"].
53+
54+
### 4-update-checker
55+
- description: Gate TEcho handling in the type checker behind the echo feature flag
56+
- corrective: >
57+
In crates/my-lang/src/checker.rs: wrap TEcho/MkEcho arms in
58+
#[cfg(feature = "echo")] or return a FeatureGated error.
59+
60+
### 5-update-6a2-state
61+
- description: Update STATE.a2ml to reflect echo-types as plugin, not built-in
62+
- corrective: >
63+
In 6a2/STATE.a2ml: update echo_integration_status from 'built_in' to 'plugin'.
64+
Add an ADR in META.a2ml documenting the boundary decision.
65+
66+
## Completion Criteria
67+
- run: "cargo build --no-default-features 2>&1 | grep -v echo | grep -c error || true"
68+
- notes: Build without echo feature should succeed (zero non-echo errors)
69+
- severity: advisory

0 commit comments

Comments
 (0)