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.

77 lines
2.6 KiB

  1. ----------------------------- MODULE MC_PBT -------------------------------
  2. CONSTANT
  3. \* @type: ROUND -> PROCESS;
  4. Proposer
  5. VARIABLES
  6. \* @type: PROCESS -> ROUND;
  7. round, \* a process round number
  8. \* @type: PROCESS -> STEP;
  9. step, \* a process step
  10. \* @type: PROCESS -> DECISION;
  11. decision, \* process decision
  12. \* @type: PROCESS -> VALUE;
  13. lockedValue, \* a locked value
  14. \* @type: PROCESS -> ROUND;
  15. lockedRound, \* a locked round
  16. \* @type: PROCESS -> PROPOSAL;
  17. validValue, \* a valid value
  18. \* @type: PROCESS -> ROUND;
  19. validRound \* a valid round
  20. \* time-related variables
  21. VARIABLES
  22. \* @type: PROCESS -> TIME;
  23. localClock, \* a process local clock: Corr -> Ticks
  24. \* @type: TIME;
  25. realTime \* a reference Newtonian real time
  26. \* book-keeping variables
  27. VARIABLES
  28. \* @type: ROUND -> Set(PROPMESSAGE);
  29. msgsPropose, \* PROPOSE messages broadcast in the system, Rounds -> Messages
  30. \* @type: ROUND -> Set(PREMESSAGE);
  31. msgsPrevote, \* PREVOTE messages broadcast in the system, Rounds -> Messages
  32. \* @type: ROUND -> Set(PREMESSAGE);
  33. msgsPrecommit, \* PRECOMMIT messages broadcast in the system, Rounds -> Messages
  34. \* @type: Set(MESSAGE);
  35. evidence, \* the messages that were used by the correct processes to make transitions
  36. \* @type: ACTION;
  37. action, \* we use this variable to see which action was taken
  38. \* @type: PROCESS -> Set(PROPMESSAGE);
  39. receivedTimelyProposal, \* used to keep track when a process receives a timely VALUE message
  40. \* @type: <<ROUND,PROCESS>> -> TIME;
  41. inspectedProposal \* used to keep track when a process tries to receive a message
  42. \* Invariant support
  43. VARIABLES
  44. \* @type: ROUND -> TIME;
  45. beginRound, \* the minimum of the local clocks at the time any process entered a new round
  46. \* @type: PROCESS -> TIME;
  47. endConsensus, \* the local time when a decision is made
  48. \* @type: ROUND -> TIME;
  49. lastBeginRound, \* the maximum of the local clocks in each round
  50. \* @type: ROUND -> TIME;
  51. proposalTime, \* the real time when a proposer proposes in a round
  52. \* @type: ROUND -> TIME;
  53. proposalReceivedTime \* the real time when a correct process first receives a proposal message in a round
  54. INSTANCE TendermintPBT_002_draft WITH
  55. Corr <- {"c1", "c2"},
  56. Faulty <- {"f3", "f4"},
  57. N <- 4,
  58. T <- 1,
  59. ValidValues <- { "v0", "v1" },
  60. InvalidValues <- {"v2"},
  61. MaxRound <- 5,
  62. MaxTimestamp <- 10,
  63. MinTimestamp <- 2,
  64. Delay <- 2,
  65. Precision <- 2
  66. \* run Apalache with --cinit=CInit
  67. CInit == \* the proposer is arbitrary -- works for safety
  68. Proposer \in [Rounds -> AllProcs]
  69. =============================================================================