Source/Packages

ParticipantGroupLaws

packages/representations/tests/ParticipantGroupLaws.alpha

262 lines49 declarations7.9 KiBSHA-256 4ede595dbb41

def · lines 74–92

member

Full file
These probes consume the admitted index. The result 0 distinguishes refusal or an absent ordinal; present role r encodes as r+1, including role zero.
74def member =
75  (lambda unrestricted group : (family ParticipantGroup) .
76    (lambda unrestricted ordinal : Nat .
77      (eliminate
78        StdResult
79        (lambda unrestricted result : (family StdResult (family ParticipantGroupFailure) (family ParticipantIndex)) .
80          Nat)
81        (participantAdmit group 16 8)
82        (branch StdFailure reason . 0)
83        (branch
84          StdSuccess
85          index
86          .
87          (eliminate
88            StdOption
89            (lambda unrestricted value : (family StdOption Nat) . Nat)
90            (participantMember index ordinal)
91            (branch StdNone . 0)
92            (branch StdSome role . (naturalAdd role 1)))))))

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.