Commit 1692561
ABI: make Idris2 proofs genuinely compile + add machine-checked theorems (#38)
* 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 idrisiser Idris2 ABI proofs to genuinely compile and verify
The src/interface/abi ABI was scaffolded from a template and never
compiler-checked. This makes all of it typecheck cleanly under Idris2
0.7.0 (zero errors, zero warnings) with genuine, machine-checked proofs.
Types.idr:
- Replace the %runElab thisPlatform stub (needs ElabReflection) with a
plain value (Linux).
- DecEq Result: replace the non-compiling `decEq _ _ = No absurd`
catch-all with explicit off-diagonal disequality cases for all 30
ordered distinct constructor pairs (\case Refl impossible).
- createHandle: solve the {auto 0 nonNull : So (ptr /= 0)} obligation via
Data.So.choose instead of leaving it unsolved.
Layout.idr:
- paddingFor: use Data.Nat.minus instead of Nat subtraction (no Neg).
- Add sound decDivides decision procedure (div + decEq) producing real
Divides witnesses; replace the unsound `alignUpCorrect ... = DivideBy
... Refl` with alignUpDivides built on decDivides.
- checkCABI: implement decFieldsAligned over the Vect of fields and build
a genuine FieldsAligned witness; drop the ?fieldsAlignedProof hole.
- offsetInBounds: change the unsound universally-quantified So return type
to Maybe (So ...) decided via choose.
- Add three concrete C-ABI struct layouts (proofEngineContext,
proofObligation, handleData) with explicit erased proofs
{sizeCorrect = Oh} and {aligned = DivideBy k Refl}; add verifyAllLayouts.
Proofs.idr (new): machine-checked theorems —
- proofEngineContextCompliant / proofObligationCompliant /
handleDataCompliant: CABICompliant witnesses built directly from
per-field DivideBy k Refl proofs (multiplication reduces at typecheck).
- okIsZero, proofFailureIsFive: pin the FFI result-code encoding.
- okNotNullPointer: distinct codes encode distinctly.
Build packaging:
- git mv flat files to src/interface/abi/Idrisiser/ABI/{Types,Layout,
Foreign}.idr to match module namespaces.
- Add src/interface/abi/idrisiser-abi.ipkg.
- .gitignore: add **/build/, *.ttc, *.ttm.
No believe_me / assert_total / idris_crash / postulate / %hint / holes.
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 7f1691c commit 1692561
6 files changed
Lines changed: 272 additions & 30 deletions
File tree
- src/interface/abi
- Idrisiser/ABI
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
File renamed without changes.
Lines changed: 122 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | | - | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | | - | |
55 | | - | |
56 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
57 | 77 | | |
58 | 78 | | |
59 | 79 | | |
| |||
126 | 146 | | |
127 | 147 | | |
128 | 148 | | |
129 | | - | |
| 149 | + | |
130 | 150 | | |
131 | 151 | | |
132 | 152 | | |
| |||
135 | 155 | | |
136 | 156 | | |
137 | 157 | | |
138 | | - | |
| 158 | + | |
139 | 159 | | |
140 | 160 | | |
141 | 161 | | |
142 | | - | |
| 162 | + | |
143 | 163 | | |
144 | 164 | | |
145 | 165 | | |
146 | 166 | | |
147 | | - | |
| 167 | + | |
| 168 | + | |
148 | 169 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
155 | 236 | | |
156 | 237 | | |
157 | 238 | | |
| |||
189 | 270 | | |
190 | 271 | | |
191 | 272 | | |
192 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
193 | 276 | | |
194 | 277 | | |
195 | 278 | | |
196 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
197 | 292 | | |
198 | 293 | | |
199 | 294 | | |
| |||
222 | 317 | | |
223 | 318 | | |
224 | 319 | | |
225 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
226 | 324 | | |
227 | | - | |
228 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 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 | + | |
Lines changed: 45 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
210 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
211 | 214 | | |
212 | 215 | | |
213 | 216 | | |
| |||
216 | 219 | | |
217 | 220 | | |
218 | 221 | | |
219 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
220 | 252 | | |
221 | 253 | | |
222 | 254 | | |
| |||
228 | 260 | | |
229 | 261 | | |
230 | 262 | | |
231 | | - | |
232 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
233 | 266 | | |
234 | 267 | | |
235 | | - | |
236 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
237 | 272 | | |
238 | 273 | | |
239 | 274 | | |
| |||
0 commit comments