hierarchy_traversal.bend checks
raw source on the hub · import bendvy-ecs-core@0.1.0.7/hierarchy_traversal.bend as Hierarchy_traversal
4 imports
import Base import entity_key.bend as K import ./relation_types.bend as G import ./relation_graph.bend as Graph
Types
type Order source · line 9 · raw
Data
Raw graph helpers are trusted setup, not gameplay authority. Valid hierarchy edges have one parent per source and no cycle; traversal uses E+1 small fuel. Unsupported forged cyclic graph traversal remains an incomplete diagnostic.
DepthOrder
BreadthOrder
type Walk source · line 12 · raw
Data
Complete@ids:List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key> -> Walk
Incomplete@ids:List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key> -> @pending:List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key> -> Walk
Definitions
def finished source · line 18 · raw
@acc:List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key> -> @pending:List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key> -> Walk
def enqueue source · line 22 · raw
@order:Order -> @children:List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key> -> @rest:List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key> -> List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>
def ancestor_finished source · line 41 · raw
@state:Pair(Maybe<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>, List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>) -> Walk
def root_ids source · line 52 · raw
@ids:List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key> -> @current:0x7e321819d0ff210531780719c7674cef/entity_key.Key -> 0x7e321819d0ff210531780719c7674cef/entity_key.Key
def root source · line 56 · raw
@walk:Walk -> @target:0x7e321819d0ff210531780719c7674cef/entity_key.Key -> Maybe<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>
Templates
template budget source · line 15 · raw
@-S:Data -> @graph:0x7e321819d0ff210531780719c7674cef/relation_types.Graph<S> -> Nat
template next_desc source · line 26 · raw
@-S:Data -> @graph:0x7e321819d0ff210531780719c7674cef/relation_types.Graph<S> -> @descriptor:0x7e321819d0ff210531780719c7674cef/relation_types.Descriptor<S> -> @order:Order -> @state:Pair(List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>, List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>) -> Pair(List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>, List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>)
template descendants_loop source · line 30 · raw
@-S:Data -> @n:Nat -> @state:Pair(List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>, List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>) -> @+graph:0x7e321819d0ff210531780719c7674cef/relation_types.Graph<S> -> @+descriptor:0x7e321819d0ff210531780719c7674cef/relation_types.Descriptor<S> -> @+order:Order -> Walk
template descendants source · line 35 · raw
@-S:Data -> @+graph:0x7e321819d0ff210531780719c7674cef/relation_types.Graph<S> -> @+descriptor:0x7e321819d0ff210531780719c7674cef/relation_types.Descriptor<S> -> @target:0x7e321819d0ff210531780719c7674cef/entity_key.Key -> @order:Order -> Walk
template next_ancestor source · line 37 · raw
@-S:Data -> @graph:0x7e321819d0ff210531780719c7674cef/relation_types.Graph<S> -> @descriptor:0x7e321819d0ff210531780719c7674cef/relation_types.Descriptor<S> -> @state:Pair(Maybe<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>, List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>) -> Pair(Maybe<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>, List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>)
template ancestors_loop source · line 45 · raw
@-S:Data -> @n:Nat -> @state:Pair(Maybe<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>, List<&2, 0x7e321819d0ff210531780719c7674cef/entity_key.Key>) -> @+graph:0x7e321819d0ff210531780719c7674cef/relation_types.Graph<S> -> @+descriptor:0x7e321819d0ff210531780719c7674cef/relation_types.Descriptor<S> -> Walk
template ancestors source · line 50 · raw
@-S:Data -> @+graph:0x7e321819d0ff210531780719c7674cef/relation_types.Graph<S> -> @+descriptor:0x7e321819d0ff210531780719c7674cef/relation_types.Descriptor<S> -> @target:0x7e321819d0ff210531780719c7674cef/entity_key.Key -> Walk