Source/Packages

Representation.ParticipantGroup

packages/representations/src/Representation/ParticipantGroup.alpha

569 lines74 declarations21.7 KiBSHA-256 55e38fbe127e

def · lines 364–403

participantAdmit

Full file
Admission is linear in the compact description, not its cardinality. A budget limits index structure and lookup depth, not the number of roles. Empty, overlapping, wrapped or padded membership never enters a plan.
364def participantAdmit =
365  (lambda unrestricted group : (family ParticipantGroup) .
366    (lambda unrestricted nodeBudget : Nat .
367      (lambda unrestricted depthBudget : Nat .
368        (participantRequire
369          (family ParticipantIndex)
370          (naturalNonzero (bytes-length (participantIdentityOf group)))
371          (constructor ParticipantGroupFailure ParticipantEmptyIdentity)
372          (participantRequire
373            (family ParticipantIndex)
374            (naturalAnd
375              (naturalNonzero (participantUniverseOf group))
376              (naturalLessOrEqual (participantUniverseOf group) participantWordLimit))
377            (constructor ParticipantGroupFailure ParticipantUniverseBounds)
378            (participantRequire
379              (family ParticipantIndex)
380              (naturalLessOrEqual (participantEpochOf group) participantWordLimit)
381              (constructor ParticipantGroupFailure ParticipantEpochBounds)
382              (stdResultBind
383                (family ParticipantGroupFailure)
384                (family ParticipantIndex)
385                (family ParticipantIndex)
386                (participantCompileSelection (participantSelectionOf group))
387                (lambda unrestricted indexed : (family ParticipantIndex) .
388                  (participantRequire
389                    (family ParticipantIndex)
390                    (naturalLess (participantUpperOf indexed) (participantUniverseOf group))
391                    (constructor ParticipantGroupFailure ParticipantOutsideUniverse)
392                    (participantRequire
393                      (family ParticipantIndex)
394                      (naturalAnd
395                        (naturalLessOrEqual (participantNodesOf indexed) nodeBudget)
396                        (naturalLessOrEqual (participantDepthOf indexed) depthBudget))
397                      (constructor ParticipantGroupFailure ParticipantIndexBudget)
398                      (constructor
399                        StdResult
400                        StdSuccess
401                        (family ParticipantGroupFailure)
402                        (family ParticipantIndex)
403                        indexed)))))))))))

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.