-
-
Notifications
You must be signed in to change notification settings - Fork 0
The Idris2 ABI surface at src/abi/ declares the FFI boundary that the
Zig shim (ffi/zig/) implements.
| Module | Purpose |
|---|---|
AbsoluteZero.ABI.Types |
Core types: Platform, Result, Instruction, ProgramState, opaque handles |
AbsoluteZero.ABI.Layout |
Memory layout proofs: field offsets, sizes, alignments per platform |
AbsoluteZero.ABI.Foreign |
%foreign declarations + safe wrappers |
AbsoluteZero.ABI.Proofs.DivMod |
Trusted div/mod lemma surface (estate-wide) |
idris2 --build absolute-zero-abi.ipkgThe package file at the repo root is absolute-zero-abi.ipkg.
src/abi/Proofs/DivMod.idr consolidates the trusted base of
number-theoretic lemmas used by ABI alignment proofs across the
hyperpolymath estate. Each axiom is individually named so discharge
can be incremental:
alignedSizeCorrect :
(size : Nat) -> (align : Nat) ->
{auto 0 nonZero : So (align /= 0)} ->
So (alignedSize size align `mod` align == 0)
divModIdentity :
(n : Nat) -> (d : Nat) ->
{auto 0 nonZero : So (d /= 0)} ->
n = (n `div` d) * d + (n `mod` d)
multModZero :
(k : Nat) -> (d : Nat) ->
{auto 0 nonZero : So (d /= 0)} ->
So ((k * d) `mod` d == 0)
addModDistrib :
(a : Nat) -> (b : Nat) -> (d : Nat) ->
{auto 0 nonZero : So (d /= 0)} ->
(a + b) `mod` d = ((a `mod` d) + (b `mod` d)) `mod` dAll four currently route through believe_me () — the Idris2 0.8.0
canonical axiom idiom. Discharge path:
-
divModIdentityis provable fromData.Nat.Division.DivisionTheoremin idris2-contrib -
multModZerofollows by induction onk -
addModDistribis inData.Nat.Equationalterritory -
alignedSizeCorrectthen chains them
Cross-estate: civic-connect's src/Abi/Layout.idr defers the same
family (alignUpDivides, mkFieldsAligned, offsetInBoundsPrf).
The intent is for those to migrate to import from
AbsoluteZero.ABI.Proofs.DivMod rather than re-postulate per repo.
A previous postulate, alignmentMatchesPlatformWord : HasAlignment t n -> So (n mod word == 0),
was deleted as unsound on 2026-05-25 (ADR-009, issue #27). HasAlignment t n
has only an information-free constructor AlignProof, so the universal
claim could derive So (1 mod 8 == 0) ≡ So False from the file's own
CNOResultLayout.alignment : HasAlignment CNOVerificationResult 1. The
single consumer (programStateAlignmentValid) is now discharged
per-instance.
See AUDIT.adoc AUDIT-2026-05-20-#27 for the full
write-up.
-
AUDIT-2026-05-20-A —
src/abi/Types.idrhas 5 pre-existing errors blocking standalone typecheck under Idris2 0.8.0 (missingDecidable.Equalityimport;%runElabwithoutElabReflection;MkStateHandle ptrnot supplyingnonNullproof;No absurdlacksUninhabitedinstances). Independent of #27.