AbilityRegistry¶
Complete selected asymmetric reference profile. Definitions and supplied fixtures are distinct from the three teaching specializations; review and qualification are stated in the bound evidence and release.
Package reference-profile, input revision 2. Exact prepared source; CC0 1.0.
This is a definition inventory. Start with the learning chapters for the contract and its assumptions.
keys · operator
reference-profile · input revision 2 · CC0 1.0
keys==KeysOfKindSA(registry,"Conditional")Exact module download · Source bundle and reproduction instructions
Resolved project definitions: KeysOfKindSA
nativeKeys · operator
reference-profile · input revision 2 · CC0 1.0
nativeKeys=={ConditionalKey96(registry[key].definition) : key \in keys}Exact module download · Source bundle and reproduction instructions
Resolved project definitions: ConditionalKey96, keys
event · operator
reference-profile · input revision 2 · CC0 1.0
event==uses[id]Exact module download · Source bundle and reproduction instructions
p · operator
reference-profile · input revision 2 · CC0 1.0
p==procedures[event.abilityInstance]Exact module download · Source bundle and reproduction instructions
Resolved project definitions: event
row · operator
reference-profile · input revision 2 · CC0 1.0
row==catalog[index[id]]Exact module download · Source bundle and reproduction instructions
turn · operator
reference-profile · input revision 2 · CC0 1.0
turn==turnUses[id]Exact module download · Source bundle and reproduction instructions
ActivityHeaderSA · operator
reference-profile · input revision 2 · CC0 1.0
ActivityHeaderSA == {"id","kind","source","provider","sourceItemInspection","statedZones","rulesOnlyZones","ownPermissionModifier", "ownCostModifier","ownProgressRequirement","ownClaimObjectiveAdditionalCost","allowsProgress"}Exact module download · Source bundle and reproduction instructions
ActivityShapeSA · operator
reference-profile · input revision 2 · CC0 1.0
ActivityShapeSA(ids) == [id : ids,kind : STRING,source : SourceShapeSA,provider : STRING,sourceItemInspection : BOOLEAN,
statedZones : SUBSET STRING,rulesOnlyZones : SUBSET STRING,ownPermissionModifier : BOOLEAN,ownCostModifier : BOOLEAN,
ownProgressRequirement : BOOLEAN,ownClaimObjectiveAdditionalCost : BOOLEAN,allowsProgress : BOOLEAN]Exact module download · Source bundle and reproduction instructions
Resolved project definitions: SourceShapeSA
AdmitConditionalSnapshotSA · operator
reference-profile · input revision 2 · CC0 1.0
AdmitConditionalSnapshotSA(catalog,basis,ledger,uses,turnUses,index,procedures,template,view,capture) ==
IF ~BasisValidSA(catalog,basis) THEN FALSE
ELSE IF ~UseProvenanceValidSA(catalog,uses,turnUses,index,procedures) THEN FALSE
ELSE ConditionalBindingSA(catalog,basis,ledger,template,view,capture)Exact module download · Source bundle and reproduction instructions
Resolved project definitions: BasisValidSA, ConditionalBindingSA, UseProvenanceValidSA
AdmitPaidContextSA · operator
reference-profile · input revision 2 · CC0 1.0
AdmitPaidContextSA(catalog,basis,ledger,uses,turnUses,index,procedures,template,key,view,capture) ==
IF ~BasisValidSA(catalog,basis) THEN FALSE
ELSE IF ~UseProvenanceValidSA(catalog,uses,turnUses,index,procedures) THEN FALSE
ELSE PaidBindingSA(catalog,basis,ledger,index,turnUses,template,key,view,capture)Exact module download · Source bundle and reproduction instructions
Resolved project definitions: BasisValidSA, PaidBindingSA, UseProvenanceValidSA
BasisSA · operator
reference-profile · input revision 2 · CC0 1.0
BasisSA(revision,registry,objects,permissions) ==
[revision |-> revision,registry |-> registry,objects |-> objects,rulePermissions |-> permissions]Exact module download · Source bundle and reproduction instructions
BasisValidSA · operator
reference-profile · input revision 2 · CC0 1.0
BasisValidSA(catalog,basis) ==
/\ basis.revision \in Nat /\ RegistryValidSA(catalog,basis.registry)
/\ basis.rulePermissions \subseteq {catalog[key].source.rule : key \in DOMAIN catalog}Exact module download · Source bundle and reproduction instructions
Resolved project definitions: RegistryValidSA
CatalogValidSA · operator
reference-profile · input revision 2 · CC0 1.0
CatalogValidSA(catalog) ==
IF ~IsFunctionValueSA(catalog) THEN FALSE
ELSE IF ~IsFiniteSet(DOMAIN catalog) THEN FALSE
ELSE IF ~(\A key \in DOMAIN catalog : IsNaturalValueSA(key)) THEN FALSE
ELSE IF ~(DOMAIN catalog \subseteq Nat \ {0}) THEN FALSE
ELSE IF ~(\A key \in DOMAIN catalog : RowValidSA(catalog[key])) THEN FALSE
ELSE \A a,b \in DOMAIN catalog :
IF catalog[a].kind=catalog[b].kind THEN (catalog[a].nativeId=catalog[b].nativeId => a=b) ELSE TRUEExact module download · Source bundle and reproduction instructions
Resolved project definitions: IsFunctionValueSA, IsNaturalValueSA, RowValidSA
CommonActivitySA · operator
reference-profile · input revision 2 · CC0 1.0
CommonActivitySA(basis,ledger) ==
[ActivityContext9 EXCEPT !.activeRules=basis.rulePermissions,!.instances=ConditionalActivityRows96(ledger.instances),
!.departureHolds=EmptySA,!.persistentAbilities={},!.lingeringAbilities={}]Exact module download · Source bundle and reproduction instructions
Resolved project definitions: ActivityContext9, ConditionalActivityRows96, EmptySA
ConditionalBindingSA · operator
reference-profile · input revision 2 · CC0 1.0
ConditionalBindingSA(catalog,basis,ledger,template,view,capture) ==
IF ~BasisValidSA(catalog,basis) THEN FALSE
ELSE IF ~LedgerDomainSA(ledger) THEN FALSE
ELSE capture=MinimalCaptureSA(basis) /\ view=ConditionalSnapshotFromRegistrySA(catalog,basis,ledger,template)Exact module download · Source bundle and reproduction instructions
Resolved project definitions: BasisValidSA, ConditionalSnapshotFromRegistrySA, LedgerDomainSA, MinimalCaptureSA
ConditionalDefinitionValidSA · operator
reference-profile · input revision 2 · CC0 1.0
ConditionalDefinitionValidSA(d) ==
IF ~IsFunctionValueSA(d) THEN FALSE
ELSE IF ~RecordFieldsSA(d,ConditionalHeaderSA) THEN FALSE
ELSE IF ~IsFunctionValueSA(d.syntax) \/ ~IsFunctionValueSA(d.activity) THEN FALSE
ELSE IF ~RecordFieldsSA(d.syntax,SyntaxHeaderSA) \/ ~RecordFieldsSA(d.activity,ActivityHeaderSA) THEN FALSE
ELSE IF ~IsNaturalValueSA(d.syntax.id) \/ ~IsNaturalValueSA(d.activity.id) THEN FALSE
ELSE IF ~RuleSourceValidSA(d.syntax.source) \/ ~RuleSourceValidSA(d.activity.source) THEN FALSE
ELSE IF d.syntax \notin SyntaxShapeSA(Nat) THEN FALSE
ELSE IF d.activity \notin ActivityShapeSA(Nat) THEN FALSE
ELSE IF d.instructions \notin Seq(Nat) THEN FALSE
ELSE IF d.trigger \notin [kinds : SUBSET STRING,subject : STRING,actor : STRING,side : STRING] THEN FALSE
ELSE IF d.partsByInstruction \notin [SubIds6(d.instructions) -> SUBSET Nat] THEN FALSE
ELSE IF d.primaryKind \notin STRING \/ d.primaryCondition \notin Nat \/ d.instructionHasWould \notin BOOLEAN \/
d.triggerRequirements \notin SUBSET Nat \/ d.effectChoices \notin SUBSET (SUBSET Nat) \/
d.optionalParts \notin SUBSET Nat \/ d.delayedEffect \notin Nat \/ d.thisTraversal \notin BOOLEAN THEN FALSE
ELSE /\ RuleSourceValidSA(d.syntax.source) /\ d.activity.provider \in {"Printed","Rule"}
/\ ConditionalDefinitionValid96(d)Exact module download · Source bundle and reproduction instructions
Resolved project definitions: ConditionalDefinitionValid96, ActivityHeaderSA, ActivityShapeSA, ConditionalHeaderSA, IsFunctionValueSA, IsNaturalValueSA, RecordFieldsSA, RuleSourceValidSA, SyntaxHeaderSA, SyntaxShapeSA, SubIds6
ConditionalDefinitionsSA · operator
reference-profile · input revision 2 · CC0 1.0
ConditionalDefinitionsSA(registry) ==
LET keys==KeysOfKindSA(registry,"Conditional")
nativeKeys=={ConditionalKey96(registry[key].definition) : key \in keys}
IN [native \in nativeKeys |-> registry[CHOOSE key \in keys : ConditionalKey96(registry[key].definition)=native].definition]Exact module download · Source bundle and reproduction instructions
Resolved project definitions: ConditionalKey96, keys, nativeKeys
ConditionalHeaderSA · operator
reference-profile · input revision 2 · CC0 1.0
ConditionalHeaderSA == {"syntax","activity","primaryKind","primaryCondition","instructions","instructionHasWould",
"trigger","triggerRequirements","effectChoices","optionalParts","partsByInstruction","delayedEffect","thisTraversal"}Exact module download · Source bundle and reproduction instructions
ConditionalPresentSA · operator
reference-profile · input revision 2 · CC0 1.0
ConditionalPresentSA(registry) == {registry[key].nativeId : key \in KeysOfKindSA(registry,"Conditional")}Exact module download · Source bundle and reproduction instructions
Resolved project definitions: KeysOfKindSA
ConditionalSnapshotFromRegistrySA · operator
reference-profile · input revision 2 · CC0 1.0
ConditionalSnapshotFromRegistrySA(catalog,basis,ledger,template) ==
[SnapshotWithConditionalRegistry96(template,ledger) EXCEPT
!.definitions=ConditionalDefinitionsSA(basis.registry),!.present=ConditionalPresentSA(basis.registry),!.objects=basis.objects,
!.ordinaryActivity=[native \in DOMAIN ConditionalDefinitionsSA(catalog) |-> SourceDefaultActivitySA(basis,native.source)],
!.activity=CommonActivitySA(basis,ledger),!.activationEpoch=ConditionalEpochMap96(ledger,ConditionalDefinitionsSA(basis.registry)),
!.activationSerial=ledger.activationSerial]Exact module download · Source bundle and reproduction instructions
Resolved project definitions: ConditionalEpochMap96, SnapshotWithConditionalRegistry96, CommonActivitySA, ConditionalDefinitionsSA, ConditionalPresentSA, SourceDefaultActivitySA
EmptySA · operator
reference-profile · input revision 2 · CC0 1.0
EmptySA == [id \in {} |-> id]Exact module download · Source bundle and reproduction instructions
FamilyTurnUsesSA · operator
reference-profile · input revision 2 · CC0 1.0
FamilyTurnUsesSA(catalog,index,turnUses,kind,source) ==
[id \in {use \in DOMAIN turnUses :
IF catalog[index[use]].kind=kind THEN catalog[index[use]].source=source ELSE FALSE} |-> turnUses[id]]Exact module download · Source bundle and reproduction instructions
IsFunctionValueSA · operator
reference-profile · input revision 2 · CC0 1.0
IsFunctionValueSA(value) == SubSeq(ToString(value),1,1) \in {"[","(","<"}Exact module download · Source bundle and reproduction instructions
IsNaturalValueSA · operator
reference-profile · input revision 2 · CC0 1.0
IsNaturalValueSA(value) ==
\A i \in 1..Len(ToString(value)) : SubSeq(ToString(value),i,i) \in {"0","1","2","3","4","5","6","7","8","9"}Exact module download · Source bundle and reproduction instructions
IsStringValueSA · operator
reference-profile · input revision 2 · CC0 1.0
IsStringValueSA(value) == SubSeq(ToString(value),1,1)="\""Exact module download · Source bundle and reproduction instructions
KeysOfKindSA · operator
reference-profile · input revision 2 · CC0 1.0
KeysOfKindSA(registry,kind) == {key \in DOMAIN registry : registry[key].kind=kind}Exact module download · Source bundle and reproduction instructions
LedgerDomainSA · operator
reference-profile · input revision 2 · CC0 1.0
LedgerDomainSA(ledger) == ledger.holds=EmptySA /\ ledger.effects=EmptySAExact module download · Source bundle and reproduction instructions
Resolved project definitions: EmptySA
MinimalCaptureSA · operator
reference-profile · input revision 2 · CC0 1.0
MinimalCaptureSA(basis) == [revision |-> basis.revision,registry |-> basis.registry,objects |-> basis.objects,rulePermissions |-> basis.rulePermissions]Exact module download · Source bundle and reproduction instructions
PaidBindingSA · operator
reference-profile · input revision 2 · CC0 1.0
PaidBindingSA(catalog,basis,ledger,index,turnUses,template,key,view,capture) ==
IF ~BasisValidSA(catalog,basis) THEN FALSE
ELSE IF ~LedgerDomainSA(ledger) THEN FALSE
ELSE IF key \notin DOMAIN basis.registry THEN FALSE
ELSE IF catalog[key].kind # "Paid" THEN FALSE
ELSE capture=MinimalCaptureSA(basis) /\ view=PaidContextFromRegistrySA(catalog,basis,ledger,index,turnUses,template,key)Exact module download · Source bundle and reproduction instructions
Resolved project definitions: BasisValidSA, LedgerDomainSA, MinimalCaptureSA, PaidContextFromRegistrySA
PaidContextFromRegistrySA · operator
reference-profile · input revision 2 · CC0 1.0
PaidContextFromRegistrySA(catalog,basis,ledger,index,turnUses,template,key) ==
[template EXCEPT !.objects=basis.objects,!.present=PaidPresentSA(basis.registry),
!.defaultActive=SourceDefaultActivitySA(basis,catalog[key].source),!.activity=CommonActivitySA(basis,ledger),
!.uses=FamilyTurnUsesSA(catalog,index,turnUses,"Paid",catalog[key].source)]Exact module download · Source bundle and reproduction instructions
Resolved project definitions: CommonActivitySA, FamilyTurnUsesSA, PaidPresentSA, SourceDefaultActivitySA
PaidDefinitionValidSA · operator
reference-profile · input revision 2 · CC0 1.0
PaidDefinitionValidSA(d) ==
IF ~IsFunctionValueSA(d) THEN FALSE
ELSE IF ~RecordFieldsSA(d,PaidHeaderSA) THEN FALSE
ELSE IF ~IsFunctionValueSA(d.syntax) \/ ~IsFunctionValueSA(d.activity) THEN FALSE
ELSE IF ~RecordFieldsSA(d.syntax,SyntaxHeaderSA) \/ ~RecordFieldsSA(d.activity,ActivityHeaderSA) THEN FALSE
ELSE IF ~IsStringValueSA(d.syntax.id) \/ ~IsStringValueSA(d.activity.id) THEN FALSE
ELSE IF ~RuleSourceValidSA(d.syntax.source) \/ ~RuleSourceValidSA(d.activity.source) THEN FALSE
ELSE IF d \notin PaidShapeSA THEN FALSE
ELSE /\ d.syntax.kind="Paid" /\ d.activity.kind="Paid"
/\ d.syntax.id \notin {"BasicRetire","Decline"}
/\ d.activity.id=d.syntax.id /\ d.activity.source=d.syntax.source
/\ RuleSourceValidSA(d.syntax.source) /\ d.activity.provider \in {"Printed","Rule"}
/\ AbilityTextValid93(d.syntax) /\ Len(d.triggerCost)>0 /\ Len(d.instructions)>0Exact module download · Source bundle and reproduction instructions
Resolved project definitions: AbilityTextValid93, ActivityHeaderSA, IsFunctionValueSA, IsStringValueSA, PaidHeaderSA, PaidShapeSA, RecordFieldsSA, RuleSourceValidSA, SyntaxHeaderSA
PaidHeaderSA · operator
reference-profile · input revision 2 · CC0 1.0
PaidHeaderSA == {"syntax","activity","triggerCost","instructions","instructionHasWould","ruleTiming","canSuppressBarrierInstructions",
"refersApproachedBarrier","refersEncounteredBarrier","approachRequirements","encounterRequirements","interfaceSubtype","otherRestrictionIds","refersHosted"}Exact module download · Source bundle and reproduction instructions
PaidPresentSA · operator
reference-profile · input revision 2 · CC0 1.0
PaidPresentSA(registry) == {registry[key].nativeId : key \in KeysOfKindSA(registry,"Paid")}Exact module download · Source bundle and reproduction instructions
Resolved project definitions: KeysOfKindSA
PaidShapeSA · operator
reference-profile · input revision 2 · CC0 1.0
PaidShapeSA == [syntax : SyntaxShapeSA(STRING),activity : ActivityShapeSA(STRING),
triggerCost : Seq([kind : STRING,amount : Nat]),instructions : Seq(Nat),instructionHasWould : BOOLEAN,ruleTiming : STRING,
canSuppressBarrierInstructions : BOOLEAN,refersApproachedBarrier : BOOLEAN,refersEncounteredBarrier : BOOLEAN,
approachRequirements : ReferenceShapeSA,encounterRequirements : ReferenceShapeSA,
interfaceSubtype : [present : BOOLEAN,name : STRING],otherRestrictionIds : SUBSET Nat,refersHosted : BOOLEAN]Exact module download · Source bundle and reproduction instructions
Resolved project definitions: ActivityShapeSA, ReferenceShapeSA, SyntaxShapeSA
RecordFieldsSA · operator
reference-profile · input revision 2 · CC0 1.0
RecordFieldsSA(value,fields) ==
IF ~IsFunctionValueSA(value) THEN FALSE
ELSE IF ~(\A key \in DOMAIN value : IsStringValueSA(key)) THEN FALSE
ELSE DOMAIN value=fieldsExact module download · Source bundle and reproduction instructions
Resolved project definitions: IsFunctionValueSA, IsStringValueSA
ReferenceShapeSA · operator
reference-profile · input revision 2 · CC0 1.0
ReferenceShapeSA == [subtypes : SUBSET STRING,activated : BOOLEAN,otherIds : SUBSET Nat]Exact module download · Source bundle and reproduction instructions
RegistryValidSA · operator
reference-profile · input revision 2 · CC0 1.0
RegistryValidSA(catalog,currentRegistry) ==
IF ~CatalogValidSA(catalog) THEN FALSE
ELSE IF ~IsFunctionValueSA(currentRegistry) THEN FALSE
ELSE IF ~(\A key \in DOMAIN currentRegistry : IsNaturalValueSA(key)) THEN FALSE
ELSE IF ~(DOMAIN currentRegistry \subseteq DOMAIN catalog) THEN FALSE
ELSE \A key \in DOMAIN currentRegistry :
IF ~RowValidSA(currentRegistry[key]) THEN FALSE
ELSE IF currentRegistry[key].kind # catalog[key].kind THEN FALSE
ELSE currentRegistry[key]=catalog[key]Exact module download · Source bundle and reproduction instructions
Resolved project definitions: CatalogValidSA, IsFunctionValueSA, IsNaturalValueSA, RowValidSA
RowHeaderSA · operator
reference-profile · input revision 2 · CC0 1.0
RowHeaderSA == {"kind","nativeId","source","definition"}Exact module download · Source bundle and reproduction instructions
RowValidSA · operator
reference-profile · input revision 2 · CC0 1.0
RowValidSA(row) ==
IF ~IsFunctionValueSA(row) THEN FALSE
ELSE IF ~RecordFieldsSA(row,RowHeaderSA) THEN FALSE
ELSE IF ~IsStringValueSA(row.kind) THEN FALSE
ELSE IF row.kind \notin {"Paid","Conditional"} THEN FALSE
ELSE IF ~RuleSourceValidSA(row.source) THEN FALSE
ELSE IF row.kind="Paid" THEN
IF ~PaidDefinitionValidSA(row.definition) THEN FALSE
ELSE ToString(row.nativeId)=ToString(row.definition.syntax.id) /\ row.source=row.definition.syntax.source
ELSE IF ~ConditionalDefinitionValidSA(row.definition) THEN FALSE
ELSE ToString(row.nativeId)=ToString(row.definition.syntax.id) /\ row.source=row.definition.syntax.sourceExact module download · Source bundle and reproduction instructions
Resolved project definitions: ConditionalDefinitionValidSA, IsFunctionValueSA, IsStringValueSA, PaidDefinitionValidSA, RecordFieldsSA, RowHeaderSA, RuleSourceValidSA
RuleSourceValidSA · operator
reference-profile · input revision 2 · CC0 1.0
RuleSourceValidSA(source) ==
IF ~IsFunctionValueSA(source) THEN FALSE
ELSE IF ~RecordFieldsSA(source,{"kind","object","rule"}) THEN FALSE
ELSE IF ~IsNaturalValueSA(source.object) THEN FALSE
ELSE IF ~IsStringValueSA(source.kind) \/ ~IsStringValueSA(source.rule) THEN FALSE
ELSE IF source \notin SourceShapeSA THEN FALSE
ELSE IF source.kind # "Rule" THEN FALSE ELSE source.object=0 /\ source.rule # "NoValue"Exact module download · Source bundle and reproduction instructions
Resolved project definitions: IsFunctionValueSA, IsNaturalValueSA, IsStringValueSA, RecordFieldsSA, SourceShapeSA
SourceDefaultActivitySA · operator
reference-profile · input revision 2 · CC0 1.0
SourceDefaultActivitySA(basis,source) == FALSEExact module download · Source bundle and reproduction instructions
SourceShapeSA · operator
reference-profile · input revision 2 · CC0 1.0
SourceShapeSA == [kind : {"Rule","Object"},object : Nat,rule : STRING]Exact module download · Source bundle and reproduction instructions
SyntaxHeaderSA · operator
reference-profile · input revision 2 · CC0 1.0
SyntaxHeaderSA == {"id","kind","side","controller","cardKind","source","units","arrowAfterFlags","barrierInstructionPrefix","paidPrefix"}Exact module download · Source bundle and reproduction instructions
SyntaxShapeSA · operator
reference-profile · input revision 2 · CC0 1.0
SyntaxShapeSA(ids) == [id : ids,kind : STRING,side : SetupPlayers,controller : SetupPlayers,cardKind : STRING,
source : SourceShapeSA,units : Seq(UnitShapeSA),arrowAfterFlags : BOOLEAN,barrierInstructionPrefix : BOOLEAN,
paidPrefix : [present : BOOLEAN,bold : BOOLEAN,colon : BOOLEAN]]Exact module download · Source bundle and reproduction instructions
Resolved project definitions: SourceShapeSA, UnitShapeSA, SetupPlayers
UnitShapeSA · operator
reference-profile · input revision 2 · CC0 1.0
UnitShapeSA == [id : Nat,category : STRING,subtype : STRING,primary : BOOLEAN,value : Int]Exact module download · Source bundle and reproduction instructions
UseProvenanceValidSA · operator
reference-profile · input revision 2 · CC0 1.0
UseProvenanceValidSA(catalog,uses,turnUses,index,procedures) ==
IF ~CatalogValidSA(catalog) THEN FALSE
ELSE IF DOMAIN uses # DOMAIN turnUses \/ DOMAIN index # DOMAIN uses THEN FALSE
ELSE IF ~(\A id \in DOMAIN index : IsNaturalValueSA(index[id])) THEN FALSE
ELSE IF ~(\A id \in DOMAIN index : index[id] \in DOMAIN catalog) THEN FALSE
ELSE \A id \in DOMAIN uses :
LET row==catalog[index[id]] event==uses[id] turn==turnUses[id] IN
IF event.abilityInstance \notin DOMAIN procedures THEN FALSE
ELSE LET p==procedures[event.abilityInstance] IN
IF p.definition.syntax.kind # row.kind THEN FALSE
ELSE /\ event.tag="AbilityUsed" /\ event.useId=id /\ event.abilityInstance=p.id
/\ p.definition=row.definition /\ p.ability.source=row.source /\ event.source=row.source
/\ event.player=row.definition.syntax.controller
/\ turn.useId=id /\ turn.turnId=p.turnId /\ turn.source=row.source
/\ IF row.kind="Paid" THEN
ToString(turn.ability)=ToString(row.nativeId)
ELSE ToString(turn.ability)=ToString(row.nativeId)Exact module download · Source bundle and reproduction instructions
Resolved project definitions: event, p, row, turn, CatalogValidSA, IsNaturalValueSA