Commit abea39a
committed
ArghDA M4: Idris2 backend + --backend selector — genuinely multi-backend
The second backend, on the M1 trait. arghda now drives two provers, chosen
at the CLI with `--backend agda|idris2`.
Idris2 is a core estate language (it owns ABIs — the Idris2-ABI / Zig-FFI
pattern), so it's a first-class backend, not merely a prover.
- `src/prover/idris2.rs` — `Idris2` impl: `idris2 --check --source-dir <root>
<file>` (the `-i` analog, ground-truthed against Idris2 0.7.0), exit-code
-only verdict (0→Proven, ran-nonzero→Error, absent→Unavailable). Dotted
module names reuse `graph::module_name_of`; `.idr` `module_to_path`; an
Idris2 import parser (`import [public] Mod [as Alias]`, top-level — no
`open`); `Main.idr` root discovery.
- `src/lint/idris2.rs` — `Idris2EscapeHatch` flags `believe_me`/
`assert_total`/`assert_smaller`/`idris_crash` + `%default partial`. Named
`escape-hatch` on purpose so it reuses the reasoning-graph's amber cap —
a `believe_me` is treated identically across backends.
- `src/main.rs` — new `--backend agda|idris2` on scan/check/dag/reason via
`backend_for()`; unknown backend errors cleanly. (Wire first — the backend
is reachable, not just present.)
- CLI `about` now reflects multi-backend (Agda, Idris2).
- Tests: +9 unit (backend identity, `.idr` path mapping, import parser incl.
public/alias, check_file honesty; escape-hatch rule) +3 integration (the
graph/dag/reason path is hermetic — text parsing, no binary needed). Suite
93 green; clippy -D warnings, fmt, SPDX clean.
- Dogfooded with REAL idris2 on PATH: `check --backend idris2` →
proven-eligible; `reason --backend idris2 --check` → live typechecks, Main
cone proven+wired, Orphan proven-but-unwired (the honest wired-vs-sound
distinction).
- STATE.a2ml records M4 = 90% (.ipkg roots + totality-hole lint are the
documented follow-on 10%).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012MpYSh6Wy8YMBH2E3qVyT71 parent 417b011 commit abea39a
20 files changed
Lines changed: 566 additions & 29 deletions
File tree
- .machine_readable/6a2
- build/ttc/2023090800
- Data
- src
- lint
- prover
- tests
- fixtures/idris2
- Data
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
63 | 79 | | |
64 | 80 | | |
65 | 81 | | |
| |||
104 | 120 | | |
105 | 121 | | |
106 | 122 | | |
107 | | - | |
108 | | - | |
109 | | - | |
| 123 | + | |
| 124 | + | |
110 | 125 | | |
| 126 | + | |
111 | 127 | | |
112 | 128 | | |
113 | 129 | | |
| |||
119 | 135 | | |
120 | 136 | | |
121 | 137 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
126 | 143 | | |
127 | 144 | | |
128 | 145 | | |
| |||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
0 commit comments