def slots
bendvy-ecs-core@0.1.0.4 · ordinary_condition_declaration.bend:71
import bendvy-ecs-core@0.1.0.4/ordinary_condition_declaration.bend as OrdinaryConditionDeclaration
import Base
import bendvy-ecs-core@0.1.0.4/schedule.bend as Sch
import bendvy-ecs-core@0.1.0.4/schedule_provision.bend as SP
71
72
73def slots(~S:Data,plan:SP.Plan<S>,+width:Nat) -> Bool:
74 match plan:
75 case SP.Empty{}:True{}
76 case SP.Entry{Sch.System{_,slot},_}:Nat.is_lt(U32.to_nat(slot),width)
77 case SP.Entry{Sch.Phase{_},_}:True{}
78 case SP.Entry{Sch.Barrier{},_}:True{}
79 case SP.Sequence{left,right}:Bool.and(slots(~S,left,width),slots(~S,right,width))