def condition_at

stelliferous@0.0.2.0 · proofs/boolean_logic.bend:51

import stelliferous@0.0.2.0/proofs/boolean_logic.bend as BooleanLogic
import Base

51# A missing condition is True, the neutral element, not an array read.
52def condition_at(conditions: List<&2,Bool>,index: Nat) -> Bool:
53  match conditions:
54    case Nil{}: True{}
55    case last <> prefix:
56      match index:
57        case 0n: last
58        case 1n+previous: condition_at(prefix,previous)

Uses (3)

Used by (1)