Commit b67f59e
ABI Layer 2: prove cost conservation (additivity) + budget compliance — flagship Idris2 proof (#32)
## Summary
Raises eclexiaiser's Idris2 ABI to **Layer 2** with its first flagship
semantic proof. eclexiaiser's headline is adding
energy/carbon/resource-cost awareness; the foundational guarantee is
that accounting **conserves** cost. This proves `additivity` (`totalCost
(xs ++ ys) = totalCost xs + totalCost ys`, by induction) — accounting
neither loses nor invents cost — plus `WithinBudget` budget compliance
as a decidable proposition.
Mirrors the estate flagship-proof pattern: ledger model, the
conservation equality, sound+complete `Dec`, certifier proven sound,
positive + negative controls.
## Changes
- Adds `src/interface/abi/Eclexiaiser/ABI/Semantics.idr` — `totalCost`,
`additivity`, `WithinBudget`/`decWithinBudget`, `certifyBudgetSound`,
and negative control `certifyOverRejects`.
- Registers the module in `eclexiaiser-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 eclexiaiser-abi.ipkg` →
exit 0, zero warnings. **Adversarial check**: a deliberately-false proof
(accepting an over-budget ledger) 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 b1d4db5 commit b67f59e
2 files changed
Lines changed: 109 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 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
0 commit comments