Skip to content

Commit 16b98db

Browse files
docs: rewrite README + ROADMAP + EXPLAINME for outside readers (#113)
## Summary Refreshes the three top-level overview documents (`README.adoc`, `ROADMAP.adoc`, `EXPLAINME.adoc`) around: 1. **The actual post-2026-05-20 proof state** — the preservation reduction story (910 → 22 open goals), the Idris2 totality campaign outcome (8/9 `%default total`), the honest "Admitted" status replacing the stale "all proofs closed 2026-04-27" claim. 2. **An outside-reader audience** that needs to navigate from "what is this?" to the specific proofs / files / tests in a few clicks. ## What changed ### README.adoc - New opening positioning: dyadic linear+affine, compile-time WASM safety, no GC, no allocator runtime. Concrete enough to evaluate at a glance. - Sections reorganised: *Why "Ephapax"* / *What this is* / *What this isn't* / *Hello-world* / *Quickstart* / *Project structure* / *Formal foundations* / *Surface syntax* / *Component status* / *Documentation map* / *Quickstart files by audience* / *Related work* / *Contributing*. - **Documentation map** table links every other top-level `.adoc`/`.md` with a one-line "what it covers" — collapses the previous flat list of links into a navigable index. - **Quickstart files by audience** routes outside observers, end users, developers, and maintainers to the right file. - **Component status table** replaces ad-hoc emoji status — adds a "Notes" column with the actual blocking work per component. - **Formal foundations** section separates Coq (dynamic side) from Idris2 (structural side), names actual lemmas as Qed/Admitted, links `PRESERVATION-HANDOFF.md` for picking up the preservation work. ### ROADMAP.adoc - Replaces the stale "all Coq Admitted proofs closed 2026-04-27" v1.0 entry with the honest reduction-story state: preservation 22 open / 910 closed. - New **Formal-proof status** section with per-theorem tables for both Coq and Idris2 — single source of truth for what's Qed/Admitted/total/covering and why. - v0.1 blocker explicitly named: close `preservation` to Qed. - v1.0 explicitly requires the Idris2 `Parse/Parser.idr` covering→total upgrade. - Cross-links to README/EXPLAINME/PROOF-NEEDS/PRESERVATION-HANDOFF at the bottom so a reader landing on ROADMAP first can navigate outward. ### EXPLAINME.adoc - Quotes the new README opener (the older "dyadic language — one part affine, the other linear" line). - New §**Claim: Mechanically Proved Soundness** section walks through the per-theorem status with file:line citations and the reduction story for preservation. - §**Test Evidence** updated to "~229 tests across ~19 crates" with explicit crate names per category. - §**Design Documents** links the new `PRESERVATION-HANDOFF.md` + `PROOF-NEEDS.md` + the vision document. ## Out of scope - No proof or code changes - Tags and description on the GitHub repo itself were updated separately (description rewritten, added: `agda` / `idris2` / `webassembly` / `formal-verification` / `affine-types` / `region-calculus` / `compiler` / `operational-semantics` / `programming-language`) - Wiki — separate task (in flight) ## Test plan - [x] All cross-references resolve (verified by reading) - [x] AsciiDoc syntax valid (no compilation, but the format used is the same idioms as the rest of the estate) - [ ] CI green 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5bd9fe2 commit 16b98db

3 files changed

Lines changed: 665 additions & 257 deletions

File tree

EXPLAINME.adoc

Lines changed: 149 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
// SPDX-License-Identifier: PMPL-1.0-or-later
2-
= Ephapax -- Show Me The Receipts
2+
= Ephapax Show Me The Receipts
33
:toc:
44
:toclevels: 3
55
:icons: font
66

7-
The README makes claims. This file backs them up.
7+
The README makes claims. This file backs them up — every assertion in
8+
README.adoc is tied to a specific file, test, or proof obligation.
89

910
[quote, README]
1011
____
11-
A dyadic language -- one part affine, the other linear -- as a type system
12-
with safe memory management targeting WebAssembly.
12+
A dyadic linear+affine type system for compile-time WebAssembly
13+
memory safety. Resources are tracked through the type system so the
14+
compiler can guarantee — without a garbage collector — that no value
15+
is used after being freed, no resource is leaked, and region-scoped
16+
allocations are deallocated in bulk at scope exit.
1317
____
1418

1519
== Claim: Dyadic Type System
@@ -141,21 +145,154 @@ Test `test_region_string_allocation` verifies in-region allocation.
141145
| `conformance/` | Conformance test suite (valid/invalid programs)
142146
|===
143147

148+
== Claim: Mechanically Proved Soundness
149+
150+
*Evidence*: Two complementary formalisations, both run on every push.
151+
152+
=== Coq (`formal/`)
153+
154+
The Coq operational semantics is a small-step substitution-based
155+
calculus over the Tofte-Talpin region-linear type system.
156+
157+
[cols="3,1,2"]
158+
|===
159+
| Theorem | Status | Where
160+
161+
| `no_leaks`
162+
| ✅ Qed
163+
| `formal/Semantics.v`
164+
165+
| `subst_preserves_typing`
166+
| ✅ Qed
167+
| `formal/Semantics.v` (line 2808)
168+
169+
| `typing_ctx_transfer`
170+
| ✅ Qed
171+
| `formal/Semantics.v`
172+
173+
| `region_env_perm_typing`, `region_add_typing`, `region_shrink_preserves_typing`
174+
| ✅ Qed
175+
| `formal/Semantics.v` (lines 2960, 3042, 3107)
176+
177+
| **`preservation`**
178+
| 🟡 Admitted
179+
| `formal/Semantics.v` (Theorem at line 3207). **22 open goals** as of 2026-05-20 (was 910). See `formal/PRESERVATION-HANDOFF.md`.
180+
|===
181+
182+
The `preservation` reduction story is recent and load-bearing:
183+
184+
* **910 → 29 goals** via the standard preservation pattern
185+
(`remember (mu, R, e) as cfg eqn:Hcfg` + `inversion Hcfg; subst`
186+
inside each case). Lands as PR #102 (2026-05-20). 97% reduction.
187+
* **29 → 22 goals** via `revert mu R e mu' R' e' Hcfg Hcfg'` before
188+
`induction Hstep`, so each case's IH carries clean universal
189+
quantification over the inner step's config rather than the
190+
inconsistent outer-cfg equation. Lands as PR #106.
191+
* The remaining 22 need (a) region invariance for non-region step
192+
constructors, (b) linearity-context preservation for sibling
193+
premises in congruence cases, (c) the documented region-env
194+
weakening lemma for non-values (the S_Region_Step + T_Region_Active
195+
case the in-file comment originally identified as "the one open").
196+
197+
An earlier in-file comment (corrected by PR #92, 2026-05-20) claimed
198+
preservation was Qed-closed on 2026-04-27. That claim was
199+
unsubstantiated — `coqc` 8.18.0 rejected the proof script. The
200+
chain above is the honest closure work in progress.
201+
202+
=== Idris2 (`idris2/src/Ephapax/` + `src/formal/`)
203+
204+
Two Idris2 developments:
205+
206+
**Frontend (parser / typechecker / IR codec)** —
207+
`idris2/src/Ephapax/` is the actual Idris2-side of the two-phase
208+
pipeline. As of 2026-05-20, all 9 files compile under `%default
209+
total` (8 files) or `%default covering` (1 file, the recursive-
210+
descent parser).
211+
212+
[cols="3,1,2"]
213+
|===
214+
| Module | Default | Notes
215+
216+
| `IR/SExpr`, `Parse/Stream`, `Parse/Util`, `Parse/Lexer`, `Affine/Typecheck`
217+
| `%default total`
218+
| Fueled mutual recursion where Idris2 SCT couldn't trace structural
219+
decrease through `Stream`-indexed parsers.
220+
221+
| `IR/AST`, `IR/Decode`, `Affine/Emit`
222+
| `%default total` + 14 `covering`
223+
| `covering` markers are documented Idris2 0.8.0 SCT limits
224+
(showPrec / (/=) interface-dispatch loops, map/traverse through
225+
recursive types). Strictly stronger than the previous `%default
226+
partial` state.
227+
228+
| `Parse/Parser`
229+
| `%default covering`
230+
| LL(k) recursive descent through ~30 mutually-recursive Stream-
231+
indexed parser combinators. Fueling all of them is a substantial
232+
separate refactor, deferred to a later campaign.
233+
|===
234+
235+
**Zero `believe_me`, zero `assert_total`, zero `assert_smaller`** in
236+
the entire frontend. The campaign that achieved this (PRs #89, #90,
237+
#91, #93, #94, #96, #97, #99, #100, all merged 2026-05-20) is
238+
documented in the project memory.
239+
240+
**Region-linearity theorems** — `src/formal/` proves structural
241+
properties of the region-linear calculus:
242+
243+
[cols="3,2"]
244+
|===
245+
| Theorem | Where
246+
247+
| `noEscapeTheorem`
248+
| `src/formal/Ephapax/Formal/NoEscape.idr`
249+
250+
| `regionSafetyTheorem`
251+
| `src/formal/Ephapax/Formal/RegionSafety.idr`
252+
253+
| `noGCTheorem`
254+
| `src/formal/Ephapax/Formal/NoGC.idr`
255+
256+
| `orthogonalityLemma`
257+
| `src/formal/Ephapax/Formal/Orthogonality.idr`
258+
259+
| `splitLinearCoverage`
260+
| `src/formal/Ephapax/Formal/Qualifier.idr` (PR #85, 2026-05-19) —
261+
generalises `nonDiminishment` from head-position to all linear
262+
bindings.
263+
|===
264+
265+
All five with zero `believe_me`, zero postulates, under `%default
266+
total`.
267+
144268
== Test Evidence
145269

146-
229 tests across 19 crates, 0 failures. Key test categories:
270+
~229 tests across ~19 crates, 0 failures. Key test categories:
147271

148-
* *Type checker dyadic tests*: let vs let! semantics, branch agreement, region exit
149-
* *Desugar tests*: constructor encoding, match desugaring, exhaustiveness
150-
* *Parser tests*: surface syntax (data, match, constructors, named types)
272+
* *Type checker dyadic tests*: `let` vs `let!` semantics, branch
273+
agreement, region exit (`ephapax-typing`)
274+
* *Desugar tests*: constructor encoding, match desugaring,
275+
exhaustiveness (`ephapax-desugar`)
276+
* *Parser tests*: surface syntax (data, match, constructors, named
277+
types) (`ephapax-parser`)
151278
* *Discipline tests*: linear vs affine checker divergence
152-
* *Integration tests*: parse -> desugar -> typecheck end-to-end
279+
(`ephapax-linear`)
280+
* *Integration tests*: parse → desugar → typecheck end-to-end
281+
* *Conformance tests*: `conformance/pass/` programs must type-check,
282+
`conformance/fail/` programs must be rejected
153283

154284
== Design Documents
155285

156-
* `spec/ephapax-v2-grammar.ebnf` -- Complete v2 grammar (modules, generics, effects, traits, comptime, contracts)
157-
* `docs/specs/DESIGN-DECISIONS.adoc` -- 17 ADRs with rationale
158-
* `docs/specs/LANGUAGE-COMPARISON.adoc` -- Comparison against 10 languages
286+
* `spec/ephapax-v2-grammar.ebnf` — complete v2 grammar (modules,
287+
generics, effects, traits, comptime, contracts) — work in flight
288+
on `feat/v2-grammar-*` branches
289+
* `docs/specs/DESIGN-DECISIONS.adoc` — 17 ADRs with rationale
290+
* `docs/specs/LANGUAGE-COMPARISON.adoc` — comparison against 10 languages
291+
* `docs/vision/EPHAPAX-VISION.adoc` — design rationale, why dyadic +
292+
regions + WASM
293+
* `formal/PRESERVATION-HANDOFF.md` — per-case checklist for the 22
294+
remaining preservation goals
295+
* `PROOF-NEEDS.md` — outstanding proof obligations + leverage
159296

160297
== Questions?
161298

0 commit comments

Comments
 (0)