github.com/aakash4dev/cometbft@v0.38.2/spec/light-client/supervisor/supervisor_001_draft.tla (about) 1 ------------------------- MODULE supervisor_001_draft ------------------------ 2 (* 3 This is the beginning of a spec that will eventually use verification and detector API 4 *) 5 6 EXTENDS Integers, FiniteSets 7 8 VARIABLES 9 state, 10 output 11 12 vars == <<state, output>> 13 14 CONSTANT 15 INITDATA 16 17 Init == 18 /\ state = "Init" 19 /\ output = "none" 20 21 NextInit == 22 /\ state = "Init" 23 /\ \/ state' = "EnterLoop" 24 \/ state' = "FailedToInitialize" 25 /\ UNCHANGED output 26 27 NextVerifyToTarget == 28 /\ state = "EnterLoop" 29 /\ \/ state' = "EnterLoop" \* replace primary 30 \/ state' = "EnterDetect" 31 \/ state' = "ExhaustedPeersPrimary" 32 /\ UNCHANGED output 33 34 NextAttackDetector == 35 /\ state = "EnterDetect" 36 /\ \/ state' = "NoEvidence" 37 \/ state' = "EvidenceFound" 38 \/ state' = "ExhaustedPeersSecondaries" 39 /\ UNCHANGED output 40 41 NextVerifyAndDetect == 42 \/ NextVerifyToTarget 43 \/ NextAttackDetector 44 45 NextOutput == 46 /\ state = "NoEvidence" 47 /\ state' = "EnterLoop" 48 /\ output' = "data" \* to generate a trace 49 50 NextTerminated == 51 /\ \/ state = "FailedToInitialize" 52 \/ state = "ExhaustedPeersPrimary" 53 \/ state = "EvidenceFound" 54 \/ state = "ExhaustedPeersSecondaries" 55 /\ UNCHANGED vars 56 57 Next == 58 \/ NextInit 59 \/ NextVerifyAndDetect 60 \/ NextOutput 61 \/ NextTerminated 62 63 InvEnoughPeers == 64 /\ state /= "ExhaustedPeersPrimary" 65 /\ state /= "ExhaustedPeersSecondaries" 66 67 68 ============================================================================= 69 \* Modification History 70 \* Last modified Sun Oct 18 11:48:45 CEST 2020 by widder 71 \* Created Sun Oct 18 11:18:53 CEST 2020 by widder