def covers

bendvy-ecs-core@0.1.0.3 · execution_relation_failure_retention.bend:72

import bendvy-ecs-core@0.1.0.3/execution_relation_failure_retention.bend as ExecutionRelationFailureRetention
import Base
import bendvy-ecs-core@0.1.0.3/execution_composer_layout.bend as Layout

72def covers(current:Layout.Layout,+prefix:Layout.Route,+routes:List<&2,Layout.Route>) -> Bool:
73  match current:
74    case Layout.EmptyLayout{}:True{}
75    case Layout.LayoutLeaf{_,_,_,_,policy}:leaf(policy,prefix,routes)
76    case Layout.ClassifiedLayoutLeaf{_,_,_,_,_,policy}:leaf(policy,prefix,routes)
77    case Layout.LayoutPair{left,right}:Bool.and(covers(left,append(prefix,Layout.InLeft{Layout.AtLeaf{}}),routes),covers(right,append(prefix,Layout.InRight{Layout.AtLeaf{}}),routes))

Uses (7)

Used by (2)