Source/Packages

Representation.ParticipantTree

packages/representations/src/Representation/ParticipantTree.alpha

283 lines25 declarations11.9 KiBSHA-256 327ac80c5242

def · lines 93–111

participantTreeChildStart

Full file
The first role of child `index`: the node, then every earlier child.
93def participantTreeChildStart =
94  (lambda unrestricted fanout : Nat .
95    (lambda unrestricted role : Nat .
96      (lambda unrestricted size : Nat .
97        (lambda unrestricted index : Nat .
98          (let unrestricted below =
99            (naturalPredecessor size)
100            in
101            (let unrestricted children =
102              (participantTreeChildCount fanout size)
103              in
104              (let unrestricted base =
105                (naturalDivideUnchecked below children)
106                in
107                (naturalAdd
108                  (succ role)
109                  (naturalAdd
110                    (naturalMultiply index base)
111                    (naturalMinimum index (naturalModuloUnchecked below children)))))))))))

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.