def below
import bend-ml-llama@0.2.1.0/main.bend as BendMlLlamaimport Base
import bend-ml-tensor-array@0.1.19.0/main.bend as TA
1268# every candidate's id is below n
1269def below(cs: List<&2, Cand>, +n: Nat) -> Bool:
1270 match cs:
1271 case Nil{}:
1272 True{}
1273 case Con{Cand{v, i}, t}:
1274 # bend-lint: disable-next bend-lint-rules/performance/eager_branch -- below only appears in the laws' types; no program runs it not-expected-because: proofs only, nothing to measure
1275 Bool.and(TA.leb(1n+i, n), below(t, n))