Source/Packages

Compiler.Planning.Resources

packages/compiler/planning/src/Compiler/Planning/Resources.alpha

636 lines34 declarations25.9 KiBSHA-256 773ccd6b9504

def · lines 549–565

resourcePlacementForRole

Full file
These lookups consume an admitted schedule. Resolve each logical role once; nesting full collection scans for every candidate would make routing cubic.
549def resourcePlacementForRole =
550  (lambda unrestricted role : Nat .
551    (stdListFold
552      (family ResourcePlacement)
553      (family StdOption Nat)
554      (lambda unrestricted placement : (family ResourcePlacement) .
555        (lambda unrestricted next : (family StdOption Nat) .
556          (eliminate
557            StdBool
558            (lambda unrestricted flag : (family StdBool) . (family StdOption Nat))
559            (stdBoolFromNatural (naturalEqual (resourcePlacementRole placement) role))
560            (branch
561              StdTrue
562              .
563              (constructor StdOption StdSome Nat (resourcePlacementEndpoint placement)))
564            (branch StdFalse . next))))
565      (constructor StdOption StdNone Nat)))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.