ordinary_condition_declaration.bend checks
raw source on the hub · import bendvy-ecs-core@0.1.0.2/ordinary_condition_declaration.bend as Ordinary_condition_declaration
4 imports
import Base import ./world.bend as W import ./schedule.bend as Sch import ./schedule_provision.bend as SP
Types
type Declaration source · line 10 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-predicate:(@_:0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E> -> Pair(0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E>, Bool)) -> Data
Closed ordinary blueprint. Affine callable fields are freshly projected from the same closed declaration index; no captured owner or registered guard state. Closed named condition blueprint indexed by its World-threading predicate. Contains no captured affine guard owner or registered reader state. Predicate is trusted setup; its returned World survives regardless of Bool result.
Declaration@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-predicate:(@_:0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E> -> Pair(0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E>, Bool)) -> @name:String -> Declaration<S, C, R, E, predicate>
Closed ordinary blueprint. Affine callable fields are freshly projected from the same closed declaration index; no captured owner or registered guard state. Closed named condition blueprint indexed by its World-threading predicate. Contains no captured affine guard owner or registered reader state. Predicate is trusted setup; its returned World survives regardless of Bool result.
type Program source · line 14 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ids:Data -> Type
Owned condition-plan builder/evaluator plus ordered condition names. Ordinary constructors derive slots and descriptions from the same program. Raw construction remains trusted; this is not a registered stateful guard.
Program@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ids:Data -> @width:Nat -> @build:(@_:Ids -> 0xb2b0f04555daca474f0f77d0966945c9/schedule_provision.Plan<S>) -> @names:List<&2, String> -> @evaluate:(@_:0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E> -> @_:U32 -> Pair(0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E>, Bool)) -> Program<S, C, R, E, Ids>
type Entries source · line 18 · raw
@S:Data -> Data
Materialized condition program: width, operational plan and ordered names. Metadata is detached; it does not grant runtime registration authority.
Entries@S:Data -> @width:Nat -> @plan:0xb2b0f04555daca474f0f77d0966945c9/schedule_provision.Plan<S> -> @names:List<&2, String> -> Entries<S>
Materialized condition program: width, operational plan and ordered names. Metadata is detached; it does not grant runtime registration authority.
Definitions
def lookup source · line 93 · raw
@names:List<&2, String> -> @index:Nat -> Maybe<&2, String>
Detached name lookup by Nat position, returning None outside the list. Names are descriptive; finding one supplies no execution authority.
Templates
template named source · line 21 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-predicate:(@_:0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E> -> Pair(0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E>, Bool)) -> @name:String -> Declaration<S, C, R, E, predicate>
Name a closed predicate for ordinary condition routing and descriptions. Does not evaluate it, register a system or allocate a reader/capture owner.
template leaf_name source · line 23 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-predicate:(@_:0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E> -> Pair(0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E>, Bool)) -> @leaf:Declaration<S, C, R, E, predicate> -> String
Return the condition's authored name, without evaluating its predicate.
template system source · line 29 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ids:Data -> @-predicate:(@_:0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E> -> Pair(0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E>, Bool)) -> @-identify:(@_:Ids -> U32) -> @requirements:List<&2, 0xb2b0f04555daca474f0f77d0966945c9/schedule_provision.Requirement<S>> -> @leaf:Declaration<S, C, R, E, predicate> -> Program<S, C, R, E, Ids>
Build one system placement and its condition slot from the same leaf. identify maps authored Ids to a registration ID; requirements are explicit plan metadata. Does not invoke predicate or system body during construction.
template phase source · line 33 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ids:Data -> @name:String -> @requirements:List<&2, 0xb2b0f04555daca474f0f77d0966945c9/schedule_provision.Requirement<S>> -> Program<S, C, R, E, Ids>
Build a named phase placement with requirements and no condition slot. Phase metadata does not evaluate a guard or execute registered systems.
template barrier source · line 37 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ids:Data -> @requirements:List<&2, 0xb2b0f04555daca474f0f77d0966945c9/schedule_provision.Requirement<S>> -> Program<S, C, R, E, Ids>
Build an explicit structural barrier placement with requirements and no condition slot. Constructing the program does not apply pending commands.
template shifted source · line 39 · raw
@-S:Data -> @plan:0xb2b0f04555daca474f0f77d0966945c9/schedule_provision.Plan<S> -> @+offset:U32 -> 0xb2b0f04555daca474f0f77d0966945c9/schedule_provision.Plan<S>
template built_pair source · line 46 · raw
@-S:Data -> @-Ids:Data -> @first:(@_:Ids -> 0xb2b0f04555daca474f0f77d0966945c9/schedule_provision.Plan<S>) -> @second:(@_:Ids -> 0xb2b0f04555daca474f0f77d0966945c9/schedule_provision.Plan<S>) -> @offset:Nat -> @+ids:Ids -> 0xb2b0f04555daca474f0f77d0966945c9/schedule_provision.Plan<S>
template selected source · line 47 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @chosen:Bool -> @left:(@_:0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E> -> @_:U32 -> Pair(0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E>, Bool)) -> @right:(@_:0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E> -> @_:U32 -> Pair(0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E>, Bool)) -> @world:0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E> -> @slot:U32 -> @offset:Nat -> Pair(0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E>, Bool)
template evaluated_pair source · line 51 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @left:(@_:0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E> -> @_:U32 -> Pair(0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E>, Bool)) -> @right:(@_:0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E> -> @_:U32 -> Pair(0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E>, Bool)) -> @+offset:Nat -> @world:0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E> -> @+slot:U32 -> Pair(0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E>, Bool)
template sequence source · line 55 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ids:Data -> @first:Program<S, C, R, E, Ids> -> @second:Program<S, C, R, E, Ids> -> Program<S, C, R, E, Ids>
Compose programs in authored order, shifting right-side system condition slots by left width. Preserves names/requirements and World-threading routing; does not evaluate predicates or reorder systems by dependency.
template evaluator source · line 61 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ids:Data -> @program:Program<S, C, R, E, Ids> -> @_:0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E> -> @_:U32 -> Pair(0xb2b0f04555daca474f0f77d0966945c9/world.World<S, C, R, E>, Bool)
Consume a program to obtain its slot-indexed World-threading evaluator. Use slots from the matching materialized/validated program; arbitrary callback mutations or host effects are not transactionally isolated by this adapter.
template built source · line 64 · raw
@-S:Data -> @-Ids:Data -> @width:Nat -> @names:List<&2, String> -> @result:0xb2b0f04555daca474f0f77d0966945c9/schedule_provision.Plan<S> -> Entries<S>
template materialize source · line 68 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Ids:Data -> @declaration:Program<S, C, R, E, Ids> -> @ids:Ids -> Entries<S>
Build detached Entries from authored Ids, retaining plan order/names. Does not validate registration liveness or run guards; valid checks structural slot bounds before ordinary schedule attachment checks actual registration IDs.
template slots source · line 73 · raw
@-S:Data -> @plan:0xb2b0f04555daca474f0f77d0966945c9/schedule_provision.Plan<S> -> @+width:Nat -> Bool
Advanced structural check that each system's condition slot is below width. Does not check World association, live registrations or predicate provenance.
template valid source · line 84 · raw
@-S:Data -> @entries:Entries<S> -> Bool
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.
template plan source · line 88 · raw
@-S:Data -> @entries:Entries<S> -> 0xb2b0f04555daca474f0f77d0966945c9/schedule_provision.Plan<S>
Consume Entries and return its operational plan without evaluating guards.
template condition_name source · line 100 · raw
@-S:Data -> @entries:Entries<S> -> @slot:U32 -> Maybe<&2, String>
Return the optional authored name for a materialized condition slot. Does not validate a registration or execute the corresponding predicate.