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
proof(SafeJson): DISCHARGE anyMatchesTAny + singleKeyPath; fix appendLengthInc; make path accessors total
Completes the work of PR #138, verified end-to-end against a clean
Idris2 0.8.0 + contrib toolchain (idris2 --check builds all 5 SafeJson
modules with 0 errors).
Discharges two SafeJson.Proofs OWEDs:
- anyMatchesTAny: 6-arm case-split on JsonValue; each concrete head
reduces through the catch-all `matchesType _ TAny = True` by Refl
(matchesType stays `covering` — a concrete head per arm is enough).
- singleKeyPath: with-pattern on `lookup k obj`, both arms by Refl
(Maybe-identity).
Two corrections PR #138 as-authored required but missed:
1. getPath / getSegment are made `total` in SafeJson.Access. They were
`covering` via the module `%default covering` (contrary to the PR's
claim that they were already total). Idris2 0.8.0 does not reduce
`covering` definitions during proof conversion, so singleKeyPath
cannot discharge while they remain covering — reverting the
annotation reproduces the `singleKeyPath` Mismatch failure. Both are
structurally total: getSegment is non-recursive, getPath decreases on
the path list.
2. appendLengthInc (from PR #127) had its `lengthSnoc` arguments
swapped. `Data.List.Equalities.lengthSnoc` takes the element first
(`lengthSnoc x xs`), so `lengthSnoc arr v` does not type-check under
Idris2 0.8.0 contrib. This pre-existing error blocks the entire
SafeJson.Proofs module from compiling on main, so it had to be fixed
for any of these proofs to be checkable. Corrected to `lengthSnoc v arr`.
No believe_me / postulate / idris_crash / assert_total introduced.
Refs #138, #127, proven#90 #107#119.
https://claude.ai/code/session_01MN5vzRR4MK2dkDNaHqqRDy
0 commit comments