Skip to content

Commit 73adbcb

Browse files
fix(abi): remove duplicate allTake in Boj.SafetyLemmas (core proofs green) (#237)
Fixes the pre-existing Idris2 failure surfaced on #234/#236 (not caused by either — they just triggered the path-gated Idris2 job by touching a `.idr`). ## Root cause `allTake` was defined **twice** in `src/abi/Boj/SafetyLemmas.idr`: - lines ~122–130 — `{p} -> {n} -> {xs} -> allRec p xs = True -> allRec p (take n xs) = True` - lines ~213–221 — same lemma, implicit args in a different order (`{p} -> {xs} -> {n}`) → `Error: Boj.SafetyLemmas.allTake is already defined` → the **core ABI package `boj.ipkg` failed** type-check (`PASS=104 FAIL=1`). It was masked normally because the Idris2 job is path-gated and skips unless a `.idr` changes. ## Fix Kept the **first** definition — a complete, **total** proof (no `postulate`, no `believe_me`) — and removed the redundant second copy. No proof is weakened or stubbed. Both callers use inferred implicits, so the removed copy's argument order didn't matter to them: - `Boj/SafePromptInjection.idr:168` — `MkDelimiterCharsafe (take n cs) {prf = allTake prf}` - `Boj/SafeHTTP.idr:139` — `MkHeaderCharsafe (take n cs) {prf = allTake prf}` ## Verification Expected: `scripts/typecheck-proofs.sh` → **PASS=105 FAIL=0**. Idris2 isn't available in the authoring environment, so the **Idris2 type-check CI job is the proof verification** here — it should go from failing to green on this PR (and this is the first PR that *should* pass it cleanly when the job runs). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- _Generated by [Claude Code](https://claude.ai/code/session_01XrPAh7eBSUcVKauTVdXH9Y)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent f953c45 commit 73adbcb

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

src/abi/Boj/SafetyLemmas.idr

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,6 @@ allNotImpliesAnyFalse {p} {xs = x :: xs'} prf with (p x) proof pEq
210210
allNotImpliesAnyFalse {p} {xs = x :: xs'} prf | False =
211211
allNotImpliesAnyFalse {xs = xs'} prf
212212

213-
||| If `allRec p xs = True`, then `allRec p (take n xs) = True`.
214-
export
215-
allTake : {p : a -> Bool} -> {xs : List a} -> {n : Nat} ->
216-
allRec p xs = True -> allRec p (take n xs) = True
217-
allTake {n = Z} _ = Refl
218-
allTake {xs = []} {n = S _} _ = Refl
219-
allTake {p} {xs = x :: xs'} {n = S n'} prf with (p x) proof eq
220-
allTake {p} {xs = x :: xs'} {n = S n'} prf | True = allTake {xs = xs'} {n = n'} prf
221-
allTake {p} {xs = x :: xs'} {n = S n'} prf | False = absurd prf
222-
223213
||| Convert a Bool lte witness to LTE.
224214
export
225215
fromLteTrue : (a, b : Nat) -> (a <= b) = True -> LTE a b

0 commit comments

Comments
 (0)