|
| 1 | +// SPDX-License-Identifier: PMPL-1.0-or-later |
| 2 | += proofs/coq/ — Coq Filesystem Proofs (CIC Foundation) |
| 3 | + |
| 4 | +Coq (Calculus of Inductive Constructions) provides the CIC foundation |
| 5 | +for the valence-shell formal specs and serves as the OCaml extraction |
| 6 | +target. The primary source of truth is Lean 4 (`../lean4/`); Coq |
| 7 | +cross-validates and feeds extraction. |
| 8 | + |
| 9 | +== Files |
| 10 | + |
| 11 | +[cols="2,4"] |
| 12 | +|=== |
| 13 | +| File | Role |
| 14 | + |
| 15 | +| `filesystem_model.v` |
| 16 | +| Core `Filesystem = Path -> option FSNode` model + structural lemmas. |
| 17 | + Note: this finite-domain model is the source of the |
| 18 | + `is_empty_dir_dec` axiom (justified per `STATE.a2ml |
| 19 | + [coq-proof-status] axiom-detail`). |
| 20 | + |
| 21 | +| `filesystem_composition.v` |
| 22 | +| Composition theorems. Carries one declared `admit.` at line ~199 |
| 23 | + (`single_op_reversible` OpRmdir branch — pre-existing model gap; |
| 24 | + see `STATE.a2ml [coq-proof-status] admitted-detail`). |
| 25 | + |
| 26 | +| `filesystem_equivalence.v` |
| 27 | +| State-equivalence relations. |
| 28 | + |
| 29 | +| `file_operations.v` | Per-op specs for mkdir, rmdir, touch, rm. |
| 30 | +| `file_content_operations.v`| Read/write/append; size lemmas. |
| 31 | +| `copy_move_operations.v` | `cp`/`mv` reversibility. |
| 32 | +| `permission_operations.v` | chmod/chown bit-preservation. |
| 33 | +| `symlink_operations.v` | Symlink creation + traversal. |
| 34 | +| `rmo_operations.v` | Remove-Match-Obliterate (GDPR-relevant). |
| 35 | +| `posix_errors.v` | POSIX error classification + 5/6 |
| 36 | + constructively-proved decision procedures |
| 37 | + (was 3 Axiom; full rewrite 2026-04-12, |
| 38 | + commit `1ef841c`). |
| 39 | + |
| 40 | +| `extraction.v` |
| 41 | +| OCaml extraction declarations; targets `../../impl/ocaml/`. |
| 42 | +|=== |
| 43 | + |
| 44 | +Manifests + build: |
| 45 | + |
| 46 | +* `_CoqProject` — uses `-R` recursive logical-path mapping (was `-Q`, |
| 47 | + fixed 2026-04-12 to handle subdir imports correctly). |
| 48 | +* `Justfile` — Coq-specific recipes (preferred entry point). |
| 49 | +* `Makefile.conf` — auto-emitted by `coq_makefile`; standard for the |
| 50 | + Coq toolchain. Per the 2026-04-18 audit this is acceptable under the |
| 51 | + RSR R-020 root-Makefile rule (proof-system carve-out). |
| 52 | + |
| 53 | +Build artefacts (`.glob`, `.vo`, `.vos`, `.vok`) are present in the |
| 54 | +tree but should be `.gitignore`'d (gitignore added 2026-04-12; legacy |
| 55 | +commits seeded these files pre-ignore). |
| 56 | + |
| 57 | +== Build |
| 58 | + |
| 59 | +```bash |
| 60 | +cd proofs/coq |
| 61 | +just build # via Justfile (preferred) |
| 62 | +make all # via auto-emitted Makefile |
| 63 | +``` |
| 64 | + |
| 65 | +== Proof-debt status |
| 66 | + |
| 67 | +* `admitted = 1` — `single_op_reversible` OpRmdir branch |
| 68 | + (`filesystem_composition.v:199`). |
| 69 | +* `axioms-justified = 1` — `is_empty_dir_dec` (infinite-domain |
| 70 | + decidability; migration path: switch to `FMaps.t FSNode`). |
| 71 | +* All other proofs constructively closed. |
| 72 | + |
| 73 | +Authoritative status in `../../.machine_readable/6a2/STATE.a2ml` |
| 74 | +under `[coq-proof-status]`. |
| 75 | + |
| 76 | +== See also |
| 77 | + |
| 78 | +* `../README.md` — overall proof-stack design |
| 79 | +* `../lean4/README.adoc` — primary source of truth |
| 80 | +* `../../docs/PROOF_HOLES_AUDIT.md` — full proof-debt history |
| 81 | +* `../../impl/ocaml/` — extraction target |
0 commit comments