Skip to content

ABI: make Idris2 proofs genuinely compile + add machine-checked theorems#31

Merged
hyperpolymath merged 3 commits into
mainfrom
claude/iseriser-proofs-review-rtdcwb
Jun 26, 2026
Merged

ABI: make Idris2 proofs genuinely compile + add machine-checked theorems#31
hyperpolymath merged 3 commits into
mainfrom
claude/iseriser-proofs-review-rtdcwb

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Idris2 ABI proofs — genuinely compile + machine-checked theorems

Part of the family-wide ABI-proofs review. The hand-written ABI did not typecheck under Idris2 0.7.0; this makes it real and verified, following the merged iseriser reference.

Systemic fixes: decEq _ _ = No absurd → explicit off-diagonal cases; {auto 0 nonNull} smart constructors → choose-based; paddingFor -minus; real decDivides/decFieldsAligned replacing ?fieldsAlignedProof; honest offsetInBounds; thisPlatform de-%runElab'd; buildable nested layout + ipkg; new Proofs.idr with real theorems.

Verified: idris2 --build clean (0/0); adversarial re-verify found no believe_me/postulate/holes.

🤖 Generated with Claude Code


Generated by Claude Code

Jonathan D.A. Jewell and others added 3 commits June 26, 2026 11:20
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
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
The src/interface/abi ABI files were scaffolded from a template and never
compiler-checked. This makes the whole ABI build clean under Idris2 0.7.0
(idris2 --build otpiser-abi.ipkg: zero errors, zero warnings) with genuine
proofs throughout (no believe_me/assert/postulate/holes).

Types.idr:
- Replace the non-compiling `decEq _ _ = No absurd` catch-alls with explicit
  off-diagonal cases (No (\case Refl impossible)) for SupervisorStrategy and
  the 7-constructor Result enum; add `import Decidable.Equality`.
- Fix createHandle smart constructor to discharge the {auto 0 nonNull} proof
  via `choose (ptr /= 0)`.
- Replace `thisPlatform = %runElab ...` (needs ElabReflection) with a plain
  value (Linux).
- Reorder ChildType before ChildSpec (use-before-definition).
- Fix HasWorkers.HasChildWorker unbindable implicit by naming the tail vector.
- Fix CPtr: `Bits (ptrSize p)` is ill-typed (Bits is an interface); map each
  platform to a concrete pointer-width integer type.
- Make treeSize/workerCount/treeDepth pass totality with explicit structural
  folds over the child Vect (recursion through `map` was not seen as total).

Layout.idr:
- paddingFor: replace `alignment - (...)` (Nat has no Neg) with `minus`;
  import Data.Nat.
- Add sound `decDivides`/`decFieldsAligned` decision procedures; rewrite
  `checkCABI` to use them instead of a `?fieldsAlignedProof` hole.
- Make `alignUpDivides`/`verifyLayout` discharge the StructLayout obligations
  via `choose` + `decDivides` (division never reduces under Refl).
- Supply concrete StructLayout proofs explicitly: {sizeCorrect = Oh} and
  {aligned = DivideBy k Refl}.
- offsetInBounds: change the unsound universally-quantified `So (...)` to a
  decidable `Maybe (So (...))` via `choose`.
- Rename shadowing implicit `n` bindings to `k`.

Foreign.idr:
- Move the prim__getString foreign declaration above its first use so its
  `Bits64 -> String` type is in scope (forward ref was resolving to the
  support `Ptr String` variant and failing to unify).

Proofs.idr (new): machine-checked theorems —
- supervisorNodeCompliant / childSpecCompliant / genServerCallbackCompliant:
  direct FieldsAligned witnesses (one DivideBy per field) proving each
  concrete layout is C-ABI compliant.
- okIsZero, nullPointerIsFour, okDistinctFromMalformed: pin the Result wire
  encoding; strategyEncodingRoundTrips re-exports the round-trip theorem.

Buildability: move flat files to Otpiser/ABI/ nested layout; add
otpiser-abi.ipkg; ignore Idris build artefacts (**/build/, *.ttc, *.ttm).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DF9CcCuL4YJoqs26eHsYiA
@hyperpolymath hyperpolymath marked this pull request as ready for review June 26, 2026 14:53
@hyperpolymath hyperpolymath merged commit 8d1c48e into main Jun 26, 2026
21 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants