|
| 1 | +<!-- SPDX-License-Identifier: PMPL-1.0-or-later --> |
| 2 | +# Architecture |
| 3 | + |
| 4 | +Three layers, loosely coupled. |
| 5 | + |
| 6 | +## 1. Proof layer (`proofs/`) |
| 7 | + |
| 8 | +The load-bearing verification. Six prover backends prove the same CNO |
| 9 | +properties from different angles: |
| 10 | + |
| 11 | +| Prover | Strength | What we prove with it | |
| 12 | +|--------|----------|------------------------| |
| 13 | +| **Coq** | Constructive, mature | Core CNO theory, statistical mechanics (Landauer), category, lambda, quantum, filesystem | |
| 14 | +| **Lean 4** | Mathlib + tooling | Modern restatement, cross-validation | |
| 15 | +| **Z3** | Automated SMT | Decidable fragments — fast counterexample search | |
| 16 | +| **Agda** | Dependent types | Type-level CNO certificates | |
| 17 | +| **Isabelle/HOL** | Production-grade | Industrial-style verification | |
| 18 | +| **Mizar** | Mathematical library | Connection to standard maths corpus | |
| 19 | + |
| 20 | +Multi-prover is intentional: each catches what the others miss. See |
| 21 | +[Proof Systems](Proof-Systems.md) for the choice rationale. |
| 22 | + |
| 23 | +## 2. Interpreter + ABI layer (`src/`, `interpreters/`, `ffi/`) |
| 24 | + |
| 25 | +* **`src/abi/`** — Idris2 type declarations for the C ABI, with formal |
| 26 | + alignment + size proofs. See [ABI](ABI.md). |
| 27 | +* **`interpreters/rescript/`** — Malbolge interpreter in ReScript with |
| 28 | + CNO detection. ReScript is the project's primary application |
| 29 | + language (per [`docs/CLAUDE.adoc`](../CLAUDE.adoc) language policy). |
| 30 | +* **`ffi/zig/`** — Zig FFI shim that the Idris2 ABI binds to. |
| 31 | + |
| 32 | +## 3. Examples + tooling (`examples/`, `verification/`, `Justfile`) |
| 33 | + |
| 34 | +* **`examples/<lang>/`** — CNOs in 23+ languages (ada, brainfuck, c, |
| 35 | + clojure, cobol, cpp, csharp, elixir, erlang, fortran, fsharp, haskell, |
| 36 | + javascript, lisp, malbolge, ocaml, php, prolog, rust, scala, scheme, |
| 37 | + special-ops, whitespace). Banned-language examples (go, java, kotlin, |
| 38 | + swift, ruby, perl) were removed 2026-05-25 per project policy. |
| 39 | +* **`verification/`** — top-level verify scripts (`verify-proofs.sh`, |
| 40 | + `setup-and-verify.sh`, `run-local-verification.sh`). |
| 41 | +* **`Justfile`** — recipes for everything; `just build-all`, `just verify`, etc. |
| 42 | + |
| 43 | +## ECHIDNA integration (external) |
| 44 | + |
| 45 | +ECHIDNA is the estate-wide neurosymbolic prover gateway, separate repo. |
| 46 | +absolute-zero calls into it via the `echidna-llm-mcp` BoJ cartridge — |
| 47 | +**never directly**. See [ECHIDNA.adoc](../../ECHIDNA.adoc). |
| 48 | + |
| 49 | +``` |
| 50 | +┌──────────────────────────┐ ┌──────────────────────────┐ |
| 51 | +│ absolute-zero │ calls │ ECHIDNA (separate) │ |
| 52 | +│ - proofs/ ├────────►│ - neural tactics │ |
| 53 | +│ - src/ │ via BoJ │ - 105 prover backends │ |
| 54 | +│ - interpreters/ │ │ - 66,674-proof corpus │ |
| 55 | +└──────────────────────────┘ └──────────────────────────┘ |
| 56 | +``` |
| 57 | + |
| 58 | +## Data flow on `just verify` |
| 59 | + |
| 60 | +``` |
| 61 | +verification/setup-and-verify.sh |
| 62 | + ├── proofs/coq → coqc -R common CNO ... |
| 63 | + ├── proofs/lean4 → lake build |
| 64 | + ├── proofs/agda → agda CNO.agda |
| 65 | + ├── proofs/isabelle → isabelle build |
| 66 | + ├── proofs/z3 → z3 *.smt2 |
| 67 | + ├── src/abi → idris2 --build absolute-zero-abi.ipkg |
| 68 | + └── cargo build --release |
| 69 | +``` |
| 70 | + |
| 71 | +## Why this taxonomy |
| 72 | + |
| 73 | +The directory layout follows the [RSR-template-repo](../RSR_OUTLINE.adoc) |
| 74 | +convention. Compliance state is tracked in [RSR_COMPLIANCE.adoc](../../RSR_COMPLIANCE.adoc). |
0 commit comments