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
{{ message }}
Repository navigation
sort.bend fails bend --verdict on 2.0.36 (bend#1182, bend#1483), so it cannot be imported by a --verdict gate #25
Suggestions, either of which would help until bend fixes them:
Run --verdict in the mathlib gate, so a module that cannot be imported under --verdict is caught here.
Restate the affected lemmas to avoid both forms, e.g. a plain recursive "every element is >= lo" predicate instead of the List.all template lambda in internal_least. A downstream copy that does this, specialised to one element type, checks under --verdict on 2.0.36.
Thanks for the careful report. I reproduced both points on bend 2.0.36: sort.bend from 0.6.0.0, 0.7.0.0, 0.7.1.0 and 0.7.2.0 checks and fails --verdict, and a file that imports sort.bend and uses nothing from it fails --verdict too, while the same file importing list.bend passes.
bend-mathlib 0.7.3.0 (0xf8a2f05bbfb67041ce3d1eaece892a1a) takes your second suggestion. internal_least is now a recursive Bool def instead of List.all with a lambda over lo. Only internal helpers changed; every public statement is the same. On 2.0.36 that removes all 20 defs that were out of scope for bendlang/bend#1483. sort_by_sorted_nat, msort_by_sorted_nat and merge_by_sorted_nat now translate to BendTT, as isort_by_sorted_nat already did.
It does not make sort.bend importable under --verdict yet. 13 defs are still out of scope, all with no model for an abstract ~le_trans or ~le_total: the generic insert_by_sorted, isort_by_sorted, merge_by_sorted, msort_by_sorted, sort_by_sorted and their helpers. Those hypotheses are part of the published signatures, so I can't drop them without breaking callers. With the model search from bendlang/bend#1263 (closed upstream; I ran its branch, which is based on 2.0.35), 0.7.3.0 gets ALL PROOFS CHECK from --verdict for sort, algebra, order and all. So bendlang/bend#1182 is now the only thing between this package and a clean --verdict.
On your first suggestion: CI already runs --verdict on every module. nat, bool, list, string, maybe, equal and perm must pass. algebra, order, sort and all are on a list that fails as soon as one of them starts passing, so it gets moved up. From this release that list also fails if any of them is out of scope for a reason other than no model, so a bendlang/bend#1483-style term can't come back unnoticed. The README and the agent skill now say which modules a --verdict project can import.
I'll keep this open until a bend release fixes bendlang/bend#1182, then move sort to the must-pass list. If a sort module that imports cleanly under --verdict today would help you (Nat only, no ~le_* hypotheses), tell me which element types you need. I didn't want to duplicate the proofs without knowing someone would use it.
Update: Bend's main branch now has bendlang/bend#1580 (merged, not yet in a release), which takes a ~ constant's model from a concrete call of the law. With Nat calls of the remaining laws added in f571950, every bend-mathlib module, sort.bend included, prints ALL PROOFS CHECK under bend --verdict at bend main e5527d5.
On the released bend 2.0.37 nothing changes yet: algebra, order, sort and all are still out of scope only by "no model", and CI now runs the kernel on the rest of those files. When the next Bend release ships, I'll move the pin, put all four modules on CI's must-pass --verdict list, release bend-mathlib 0.7.4.0 and close this issue.
Fixed in bend-mathlib 0.7.4.0, which works with Bend 2.0.38. That release includes bendlang/bend#1580, which takes a ~ constant's model from concrete calls of its law, so every module passes bend --verdict, including sort, algebra, order and all. A project that checks with --verdict can now import any of them:
importbend-mathlib@0.7.4.0/sort.bendasMSort
I checked this from an empty package cache: a file importing nat, sort and all from the hub prints ALL PROOFS CHECK under --verdict. CI and release.ts now require --verdict on every module, so this stays true. Thanks for reporting it, and for the 2.0.38 port in #26.
Activity
Release bend-mathlib 0.7.3.0 (0xf8a2f05bbfb67041ce3d1eaece892a1a): so…
MuhDur commentedon Oct 12, 2026
Thanks for the careful report. I reproduced both points on bend 2.0.36:
sort.bendfrom 0.6.0.0, 0.7.0.0, 0.7.1.0 and 0.7.2.0 checks and fails--verdict, and a file that importssort.bendand uses nothing from it fails--verdicttoo, while the same file importinglist.bendpasses.bend-mathlib 0.7.3.0 (
0xf8a2f05bbfb67041ce3d1eaece892a1a) takes your second suggestion.internal_leastis now a recursive Bool def instead ofList.allwith a lambda overlo. Only internal helpers changed; every public statement is the same. On 2.0.36 that removes all 20 defs that were out of scope for bendlang/bend#1483.sort_by_sorted_nat,msort_by_sorted_natandmerge_by_sorted_natnow translate to BendTT, asisort_by_sorted_natalready did.It does not make
sort.bendimportable under--verdictyet. 13 defs are still out of scope, all withno model foran abstract~le_transor~le_total: the genericinsert_by_sorted,isort_by_sorted,merge_by_sorted,msort_by_sorted,sort_by_sortedand their helpers. Those hypotheses are part of the published signatures, so I can't drop them without breaking callers. With the model search from bendlang/bend#1263 (closed upstream; I ran its branch, which is based on 2.0.35), 0.7.3.0 getsALL PROOFS CHECKfrom--verdictforsort,algebra,orderandall. So bendlang/bend#1182 is now the only thing between this package and a clean--verdict.On your first suggestion: CI already runs
--verdicton every module.nat,bool,list,string,maybe,equalandpermmust pass.algebra,order,sortandallare on a list that fails as soon as one of them starts passing, so it gets moved up. From this release that list also fails if any of them is out of scope for a reason other thanno model, so a bendlang/bend#1483-style term can't come back unnoticed. The README and the agent skill now say which modules a--verdictproject can import.I'll keep this open until a bend release fixes bendlang/bend#1182, then move
sortto the must-pass list. If a sort module that imports cleanly under--verdicttoday would help you (Nat only, no~le_*hypotheses), tell me which element types you need. I didn't want to duplicate the proofs without knowing someone would use it.MuhDur commentedon Oct 18, 2026
Update: Bend's main branch now has bendlang/bend#1580 (merged, not yet in a release), which takes a
~constant's model from a concrete call of the law. With Nat calls of the remaining laws added in f571950, every bend-mathlib module,sort.bendincluded, printsALL PROOFS CHECKunderbend --verdictat bend main e5527d5.On the released bend 2.0.37 nothing changes yet:
algebra,order,sortandallare still out of scope only by "no model", and CI now runs the kernel on the rest of those files. When the next Bend release ships, I'll move the pin, put all four modules on CI's must-pass--verdictlist, release bend-mathlib 0.7.4.0 and close this issue.Release bend-mathlib 0.7.4.0 (0xcdaf59a0332a2e0cdb289bf7a32fba62): be…
MuhDur commentedon Oct 21, 2026
Fixed in bend-mathlib 0.7.4.0, which works with Bend 2.0.38. That release includes bendlang/bend#1580, which takes a
~constant's model from concrete calls of its law, so every module passesbend --verdict, includingsort,algebra,orderandall. A project that checks with--verdictcan now import any of them:I checked this from an empty package cache: a file importing
nat,sortandallfrom the hub printsALL PROOFS CHECKunder--verdict. CI andrelease.tsnow require--verdicton every module, so this stays true. Thanks for reporting it, and for the 2.0.38 port in #26.