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(abi/idris): make Types.idr typecheck total — sound decidable type equality (#50)
The Idris 2 ABI never typechecked. Fixes:
- `module Types` only resolves when checked from its own directory; added a
minimal `phronesis-abi.ipkg` (no deps; `idris2 --typecheck phronesis-abi.ipkg`)
so it has a defined source root and is CI-checkable.
- `decEqTy` punted ALL compound types (TyList/TyTuple/TyMap/TyFun) to a wildcard
catch-all `decEqTy _ _ = No (\case Refl impossible)`, which is UNSOUND
(`TyList a = TyList b` is inhabited by Refl when a = b) and which Idris
rejects under `%default total`. Rewritten: compound heads decided structurally
via constructor injectivity, mutually with a new field-list decider
`decEqTys` (for TyTuple/TyFun); the distinct-head off-diagonal pairs are
enumerated (Idris will not accept `Refl impossible` under a wildcard `_ _`).
- Removed two unfinished holes about RUNTIME PRIMITIVES that the object logic
cannot prove without `believe_me`: `widenPreservesSign` (Int→Double cast sign;
its type was also malformed — `Bool` in a `Type` position) and `addCommInt`
(Int commutativity). They are not part of the type-safety core; removing them
keeps the module total and escape-hatch-free.
`idris2 --typecheck phronesis-abi.ipkg` exits 0 under `%default total`: no holes,
no `believe_me`/`assert_*`/postulates. The type-safety content — intrinsic
`Value : PhroTy -> Type`, total+sound `decEqTy`/`decEqTys`, `widen`, `addSafe` —
genuinely checks. SPDX header unchanged.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments