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.

37 lines
942 B

  1. ------------------ MODULE TendermintAccTrace_004_draft -------------------------
  2. (*
  3. When Apalache is running too slow and we have an idea of a counterexample,
  4. we use this module to restrict the behaviors only to certain actions.
  5. Once the whole trace is replayed, the system deadlocks.
  6. Version 1.
  7. Igor Konnov, 2020.
  8. *)
  9. EXTENDS Sequences, Apalache, TendermintAcc_004_draft
  10. \* a sequence of action names that should appear in the given order,
  11. \* excluding "Init"
  12. CONSTANT
  13. \* @type: TRACE;
  14. Trace
  15. VARIABLE
  16. \* @type: TRACE;
  17. toReplay
  18. TraceInit ==
  19. /\ toReplay = Trace
  20. /\ action' := "Init"
  21. /\ Init
  22. TraceNext ==
  23. /\ Len(toReplay) > 0
  24. /\ toReplay' = Tail(toReplay)
  25. \* Here is the trick. We restrict the action to the expected one,
  26. \* so the other actions will be pruned
  27. /\ action' := Head(toReplay)
  28. /\ Next
  29. ================================================================================