You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.7 KiB

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