OrdinaryConditionDeclaration.valid: def of bendvy-ecs-core@0.1.0.4 Import: import bendvy-ecs-core@0.1.0.4/ordinary_condition_declaration.bend as OrdinaryConditionDeclaration Lines 80-86 of bendvy-ecs-core@0.1.0.4/ordinary_condition_declaration.bend: https://jend.leeeet.dev/read.txt?path=bendvy-ecs-core@0.1.0.4/ordinary_condition_declaration.bend&start_line=80&end_line=86 import Base # Structural validation only. Trusted closed constructors establish provenance. # Check width/name length agreement, representable slot range and slot bounds. # Structural validation only: trusted constructors establish correspondence # between predicates, names and plan; this is not runtime authority validation. def valid(~S:Data,entries:Entries) -> Bool: match entries: case Entries{+width,plan,names}:Bool.and(Nat.is_eq(width,List.length(&2,String,names)),Bool.and(Nat.is_le(width,1n+U32.to_nat(4294967295)),slots(~S,plan,width))) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.length https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/ordinary_condition_declaration.bend&name=Entries https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/ordinary_condition_declaration.bend&name=slots