Commit 6c1a419
ABI: make Idris2 proofs genuinely compile + add machine-checked theorems (#34)
* 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(abi): make Idris2 ABI proofs genuinely compile and verify under 0.7.0
The src/interface/abi/{Types,Layout,Foreign}.idr files were scaffolded from a
template and never compiler-checked. This makes them typecheck cleanly (zero
errors, zero warnings) under Idris2 0.7.0 with real, non-faked proofs, and adds
a machine-checked theorem module.
Buildability:
- Moved flat files into the Lustreiser.ABI namespace dir
(src/interface/abi/Lustreiser/ABI/{Types,Layout,Foreign}.idr) so file paths
match module namespaces.
- Added src/interface/abi/lustreiser-abi.ipkg listing all four modules.
Systemic fixes:
- Types.thisPlatform: replaced the %runElab stub (needs ElabReflection) with a
plain value (Linux).
- DecEq TemporalOperator and DecEq Result: replaced the non-compiling
`decEq _ _ = No absurd` catch-all with explicit off-diagonal cases
`No (\case Refl impossible)` for every ordered pair of distinct constructors.
- createHandle: replaced `Just (MkHandle ptr)` (unsolved `So (ptr /= 0)` auto
proof) with a `choose`-based smart constructor supplying {nonNull = ok}.
- Layout.paddingFor: `alignment - ...` (no Neg for Nat) -> `minus alignment ...`.
- Added decDivides (sound Maybe (Divides n m) via div + decEq) and replaced the
unprovable alignUpCorrect/Refl with alignUpDivides routed through decDivides.
- checkCABI: implemented decFieldsAligned and removed the ?fieldsAlignedProof
hole; returns a genuine CABICompliant witness or Left.
- offsetInBounds: changed the unsound universally-true `So (...)` return type to
`Maybe (So (...))` decided via choose.
- Concrete StructLayout values (lustrePortLayout, lustreContextLayout) now supply
their erased auto-implicit proofs explicitly ({sizeCorrect = Oh},
{aligned = DivideBy 4 Refl}; 32 = 4 * 8).
- verifyLayout now discharges both erased obligations with real witnesses.
- Lifted NodeLayout's invalid record `where` helper (totalBufferSize) to a
top-level function.
- Renamed shadowing Vect-length implicits to unique names to clear all
"implicitly bind lowercase names" warnings.
- Foreign: declared prim__getString locally per-function (where blocks) matching
the working reference, fixing the Bits64/Ptr String unification error.
Real theorems (src/interface/abi/Lustreiser/ABI/Proofs.idr):
- lustrePortCompliant, lustreContextCompliant: CABICompliant proofs built
directly from per-field DivideBy k Refl witnesses (offset = k * alignment).
- okIsZero, deadlineViolationIsFive, clockErrorIsSix: pin the result-code
encoding the Zig FFI depends on.
- preIsStateful, fbyIsStateful, whenIsStateless, mergeIsStateless: pin the
temporal-operator state classification.
Build: `cd src/interface/abi && idris2 --build lustreiser-abi.ipkg` exits 0 with
zero errors and zero warnings.
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 7479e0b commit 6c1a419
6 files changed
Lines changed: 296 additions & 55 deletions
File tree
- src/interface/abi
- Lustreiser/ABI
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
Lines changed: 15 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
174 | 177 | | |
175 | 178 | | |
176 | 179 | | |
| |||
211 | 214 | | |
212 | 215 | | |
213 | 216 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | 217 | | |
220 | 218 | | |
221 | 219 | | |
| |||
237 | 235 | | |
238 | 236 | | |
239 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
240 | 241 | | |
241 | 242 | | |
242 | 243 | | |
| |||
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
258 | 262 | | |
259 | 263 | | |
260 | 264 | | |
| |||
282 | 286 | | |
283 | 287 | | |
284 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
285 | 292 | | |
286 | 293 | | |
287 | 294 | | |
| |||
294 | 301 | | |
295 | 302 | | |
296 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
297 | 307 | | |
298 | 308 | | |
299 | 309 | | |
| |||
Lines changed: 91 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
| 39 | + | |
39 | 40 | | |
40 | | - | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
45 | 58 | | |
46 | 59 | | |
47 | 60 | | |
48 | 61 | | |
49 | 62 | | |
50 | 63 | | |
51 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
52 | 71 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
57 | 75 | | |
58 | 76 | | |
59 | 77 | | |
| |||
95 | 113 | | |
96 | 114 | | |
97 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
98 | 122 | | |
99 | 123 | | |
100 | 124 | | |
| |||
107 | 131 | | |
108 | 132 | | |
109 | 133 | | |
110 | | - | |
111 | | - | |
112 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
113 | 137 | | |
114 | 138 | | |
115 | 139 | | |
116 | 140 | | |
117 | 141 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | 142 | | |
122 | 143 | | |
123 | 144 | | |
| |||
147 | 168 | | |
148 | 169 | | |
149 | 170 | | |
150 | | - | |
| 171 | + | |
151 | 172 | | |
152 | 173 | | |
153 | 174 | | |
154 | 175 | | |
155 | 176 | | |
156 | 177 | | |
157 | 178 | | |
158 | | - | |
| 179 | + | |
159 | 180 | | |
160 | 181 | | |
161 | 182 | | |
| |||
164 | 185 | | |
165 | 186 | | |
166 | 187 | | |
167 | | - | |
| 188 | + | |
168 | 189 | | |
169 | 190 | | |
170 | 191 | | |
171 | | - | |
| 192 | + | |
172 | 193 | | |
173 | 194 | | |
174 | 195 | | |
175 | 196 | | |
176 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
177 | 214 | | |
178 | | - | |
| 215 | + | |
179 | 216 | | |
180 | 217 | | |
181 | 218 | | |
182 | 219 | | |
183 | | - | |
184 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
185 | 225 | | |
186 | 226 | | |
187 | 227 | | |
| |||
202 | 242 | | |
203 | 243 | | |
204 | 244 | | |
| 245 | + | |
| 246 | + | |
205 | 247 | | |
206 | 248 | | |
207 | 249 | | |
| |||
218 | 260 | | |
219 | 261 | | |
220 | 262 | | |
| 263 | + | |
| 264 | + | |
221 | 265 | | |
222 | 266 | | |
223 | 267 | | |
| |||
240 | 284 | | |
241 | 285 | | |
242 | 286 | | |
243 | | - | |
| 287 | + | |
244 | 288 | | |
245 | 289 | | |
246 | 290 | | |
| |||
253 | 297 | | |
254 | 298 | | |
255 | 299 | | |
256 | | - | |
257 | | - | |
| 300 | + | |
| 301 | + | |
258 | 302 | | |
259 | | - | |
| 303 | + | |
260 | 304 | | |
261 | 305 | | |
262 | 306 | | |
263 | 307 | | |
264 | | - | |
| 308 | + | |
265 | 309 | | |
266 | 310 | | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
272 | 316 | | |
273 | 317 | | |
274 | 318 | | |
| |||
282 | 326 | | |
283 | 327 | | |
284 | 328 | | |
285 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
286 | 333 | | |
287 | 334 | | |
288 | 335 | | |
289 | | - | |
290 | | - | |
291 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
292 | 344 | | |
293 | 345 | | |
294 | | - | |
295 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
0 commit comments