You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Idris2 ABI proofs so they genuinely compile under Idris2 0.7.0
The src/interface/abi scaffold was generated from a template and never
compiler-checked. This makes the phronesiser ABI typecheck cleanly
(idris2 --build phronesiser-abi.ipkg: exit 0, zero warnings, zero errors)
with genuine, machine-checked proofs.
Fixes:
- Types.idr: replace the catch-all `decEq _ _ = No absurd` in the Result,
DeonticModality and HarmSeverity DecEq instances with explicit
off-diagonal `No (\case Refl impossible)` cases (the catch-all does not
compile: no Uninhabited (x = y) instance).
- Types.idr: createHandle now obtains a real `So (ptr /= 0)` via `choose`
instead of leaving MkHandle's auto proof unsolved.
- Types.idr: thisPlatform is a plain value (Linux); the %runElab stub
needed ElabReflection and did not compile.
- Types.idr: drop non-compiling/unsound template cruft (CPtr matching the
type-level Bits/ptrSize, cSizeOf/cAlignOf matching on the type-level
CInt/CSize, and vacuous HasSize/HasAlignment whose lone constructor
proved any size). Real size/alignment is proven in Layout/Proofs.
- Layout.idr: paddingFor uses Nat `minus` (Nat has no Neg); add sound
decDivides; concrete StructLayouts supply explicit {sizeCorrect = Oh}
and {aligned = DivideBy k Refl}; checkCABI builds a real CABICompliant
via decFieldsAligned; offsetInBounds returns Maybe (So ...) via choose;
constraintArrayMonotonic proved via a genuine scaleLteRight lemma
(induction on LTE) + plusLteMonotoneLeft, returning LTE not So.
- New Proofs.idr: CABICompliant witnesses for all three concrete layouts
built directly from DivideBy (offset = k * alignment), plus result/
modality/severity encoding theorems and constraint-array sizing facts.
- Nested layout src/interface/abi/Phronesiser/ABI/{Types,Layout,Foreign,
Proofs}.idr + phronesiser-abi.ipkg so namespaces match file paths.
- .gitignore: ignore Idris2 build artefacts (**/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
0 commit comments