Commit be1d62d
ABI: make Idris2 proofs genuinely compile + add machine-checked theorems (#32)
* Add SPDX header to LICENSE and set Cargo.toml license field
The governance/licence-consistency check requires an SPDX-License-Identifier
header on the LICENSE file and a `license` field in the manifest. The LICENSE
body is MPL-2.0 text, so stamp `SPDX-License-Identifier: MPL-2.0` (matching the
actual body) and set `license = "MPL-2.0"` (replacing `license-file`).
Verified with standards/scripts/check-licence-consistency.sh (passes).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DF9CcCuL4YJoqs26eHsYiA
* Normalize licensing to MPL-2.0 (code) + CC-BY-SA-4.0 (docs)
Make the repo's licensing single and consistent, matching the wokelangiser
reference policy and the merged iseriser pattern:
- Remove contradictory PMPL-1.0-or-later / Palimpsest self-claims from README
badges/footers, QUICKSTART, RSR_OUTLINE, STATE-VISUALIZER, and machine-readable
governance (META, stapeln, deny.toml allow-list, copilot/AGENTIC SPDX
directives, Trust/Must LICENSE-content checks, per-project CLAUDE.md).
- Encode the docs split in REUSE dep5: *.adoc/*.md/docs/** -> CC-BY-SA-4.0,
everything else -> MPL-2.0.
- READMEs show MPL-2.0 (code) + CC-BY-SA-4.0 (docs) badges; full texts live in
LICENSES/; root LICENSE stays MPL-2.0 for GitHub's licence chip.
Preserves legitimate non-self references: cargo-deny's AGPL deny-list, the
"never use AGPL" estate policy, and the Contributor Covenant CoC.
Verified: standards/scripts/check-licence-consistency.sh passes; no residual
PMPL/Palimpsest self-claims remain.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DF9CcCuL4YJoqs26eHsYiA
* Fix Idris2 ABI proofs to genuinely compile and verify under 0.7.0
The scaffolded ABI under src/interface/abi was never compiler-checked.
This makes all four modules build cleanly (zero errors, zero warnings)
with /usr/local/bin/idris2 0.7.0 and adds real machine-checked theorems.
Types.idr:
- Replace %runElab thisPlatform (ElabReflection not enabled) with plain Linux.
- DecEq Result: replace uncompilable "decEq _ _ = No absurd" catch-all with
explicit off-diagonal No (\case Refl impossible) cases for all 56 distinct
ordered constructor pairs.
- createHandle: solve the {auto 0 nonNull : So (ptr /= 0)} proof via
choose (ptr /= 0) instead of an unsolved Just (MkHandle ptr).
- Rename the duplicate NimObject record to NimObjectDef (it collided with the
NimObject constructor of NimTypeKind).
- Fix CPtr to return a concrete pointer-sized integer type per platform.
- Fix cSizeOf/cAlignOf which tried to pattern-match on the type-level
functions CInt/CSize (illegal); match concrete Bits widths instead.
- import Decidable.Equality.
Layout.idr:
- paddingFor: use minus (Nat has no Neg) instead of (-).
- Add sound decDivides : (n m : Nat) -> Maybe (Divides n m) via div + decEq.
- alignUpCorrect: was an unsound universally-quantified Refl proof; now a
sound decision returning Maybe (Divides align (alignUp size align)).
- checkCABI: implement decFieldsAligned over the Vect and return a real
CABICompliant witness (or Left) instead of the ?fieldsAlignedProof hole.
- offsetInBounds: was an unsound universally-quantified So; now returns
Maybe (So ...) decided via choose.
- verifyLayout: supply the erased sizeCorrect/aligned proofs explicitly
(choose + decDivides) instead of leaving them unsolved.
- Concrete nimBufferLayout/nimResultLayout: supply {sizeCorrect = Oh} and
{aligned = DivideBy k Refl}.
- nimBufferLayoutValid/nimResultLayoutValid: build the FieldsAligned witness
directly (one DivideBy per field) instead of holes; qualify layout names.
- Rename shadowing implicit n to k in Vect signatures.
- import Data.Nat, Decidable.Equality.
Foreign.idr:
- Declare prim__getString before the generation wrappers so it resolves to
the user Bits64 -> String type rather than the builtin Ptr String shape.
Proofs.idr (new):
- nimBufferCompliant, nimResultCompliant: CABICompliant proofs built directly.
- okIsZero, nullPointerIsFour, okDistinctFromError: result-encoding facts.
Buildability:
- git mv flat files into Nimiser/ABI/ to match module namespaces.
- Add nimiser-abi.ipkg (modules Types, Layout, Foreign, Proofs).
- Add **/build/, *.ttc, *.ttm to .gitignore.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DF9CcCuL4YJoqs26eHsYiA
---------
Co-authored-by: Jonathan D.A. Jewell <paraordinate@yahoo.co.uk>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 6908e75 commit be1d62d
6 files changed
Lines changed: 235 additions & 44 deletions
File tree
- src/interface/abi
- Nimiser/ABI
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
Lines changed: 15 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
53 | 62 | | |
54 | 63 | | |
55 | 64 | | |
| |||
102 | 111 | | |
103 | 112 | | |
104 | 113 | | |
105 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
106 | 117 | | |
107 | 118 | | |
108 | 119 | | |
| |||
121 | 132 | | |
122 | 133 | | |
123 | 134 | | |
124 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
125 | 138 | | |
126 | 139 | | |
127 | 140 | | |
128 | 141 | | |
129 | 142 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | 143 | | |
136 | 144 | | |
137 | 145 | | |
| |||
Lines changed: 73 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | | - | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
43 | 58 | | |
44 | 59 | | |
45 | 60 | | |
46 | 61 | | |
47 | 62 | | |
48 | 63 | | |
49 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
50 | 67 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 68 | + | |
| 69 | + | |
54 | 70 | | |
55 | 71 | | |
56 | 72 | | |
| |||
82 | 98 | | |
83 | 99 | | |
84 | 100 | | |
85 | | - | |
| 101 | + | |
86 | 102 | | |
87 | 103 | | |
88 | 104 | | |
| |||
91 | 107 | | |
92 | 108 | | |
93 | 109 | | |
94 | | - | |
| 110 | + | |
95 | 111 | | |
96 | 112 | | |
97 | 113 | | |
98 | | - | |
| 114 | + | |
99 | 115 | | |
100 | 116 | | |
101 | 117 | | |
102 | 118 | | |
103 | 119 | | |
104 | 120 | | |
105 | | - | |
| 121 | + | |
106 | 122 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
111 | 132 | | |
112 | 133 | | |
113 | 134 | | |
| |||
148 | 169 | | |
149 | 170 | | |
150 | 171 | | |
151 | | - | |
| 172 | + | |
152 | 173 | | |
153 | 174 | | |
154 | 175 | | |
| |||
200 | 221 | | |
201 | 222 | | |
202 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
203 | 236 | | |
204 | 237 | | |
205 | 238 | | |
206 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
207 | 243 | | |
208 | 244 | | |
209 | 245 | | |
| |||
224 | 260 | | |
225 | 261 | | |
226 | 262 | | |
| 263 | + | |
| 264 | + | |
227 | 265 | | |
228 | 266 | | |
229 | 267 | | |
| |||
239 | 277 | | |
240 | 278 | | |
241 | 279 | | |
| 280 | + | |
| 281 | + | |
242 | 282 | | |
243 | 283 | | |
244 | 284 | | |
245 | | - | |
246 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
247 | 291 | | |
248 | 292 | | |
249 | 293 | | |
250 | | - | |
251 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
252 | 299 | | |
253 | 300 | | |
254 | 301 | | |
| |||
262 | 309 | | |
263 | 310 | | |
264 | 311 | | |
265 | | - | |
| 312 | + | |
| 313 | + | |
266 | 314 | | |
267 | | - | |
268 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 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 | + | |
0 commit comments