Commit f4d6a44
ABI Layer 2: prove array-rewrite semantics preservation (+´⌽ ⇒ +´) — flagship Idris2 proof (#33)
## Summary
Raises bqniser's Idris2 ABI to **Layer 2** with its first flagship
semantic proof. bqniser's headline is detecting array patterns and
rewriting them as optimised BQN primitives; the correctness obligation
is that a rewrite is **semantics-preserving**. This proves a concrete
BQN rewrite — `+´⌽𝕩 ⇒ +´𝕩` (drop the reverse before a fold-sum) — via
`sumRev : bsum (brev xs) = bsum xs` (summation is reverse-invariant),
proven by induction.
Mirrors the estate flagship-proof pattern: array model, the equivalence
proven by induction, certifier proven sound, non-vacuous negative
control.
## Changes
- Adds `src/interface/abi/Bqniser/ABI/Semantics.idr` — `bsum`/`brev`,
`sumSnoc`, `sumRev` (the rewrite equivalence), `certifyRewriteSound`,
and negative control `revChangesOrder`.
- Registers the module in `bqniser-abi.ipkg`.
## RSR Quality Checklist
### Required
- [x] Tests pass — ABI builds clean (see Testing)
- [x] Linter clean — zero warnings
- [x] No banned language patterns
- [x] No banned functions — genuine proof
- [x] SPDX headers present
- [x] No secrets
### As Applicable
- [x] ABI/FFI changes validated — additive proof; FFI untouched
## Testing
Verified with **Idris2 0.7.0**: `idris2 --build bqniser-abi.ipkg` → exit
0, zero warnings. **Adversarial check**: a deliberately-false proof
(`brev [1,2] = [1,2]`) was rejected. `build/` removed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
---
_Generated by [Claude
Code](https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 8fc1ddf commit f4d6a44
2 files changed
Lines changed: 96 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
0 commit comments