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.

33 lines
898 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 Trace
  13. VARIABLE toReplay
  14. TraceInit ==
  15. /\ toReplay = Trace
  16. /\ action' := "Init"
  17. /\ Init
  18. TraceNext ==
  19. /\ Len(toReplay) > 0
  20. /\ toReplay' = Tail(toReplay)
  21. \* Here is the trick. We restrict the action to the expected one,
  22. \* so the other actions will be pruned
  23. /\ action' := Head(toReplay)
  24. /\ Next
  25. ================================================================================