github.com/aakash4dev/cometbft@v0.38.2/spec/light-client/accountability/TendermintAccTrace_004_draft.tla (about)

     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  
     7    Version 1.
     8  
     9    Igor Konnov, 2020.
    10   *)
    11  
    12  EXTENDS Sequences, Apalache, typedefs, TendermintAcc_004_draft
    13  
    14  \* a sequence of action names that should appear in the given order,
    15  \* excluding "Init"
    16  CONSTANT
    17    \* @type: $trace;
    18    Trace
    19  
    20  VARIABLE
    21    \* @type: $trace;
    22    toReplay
    23  
    24  TraceInit ==
    25      /\ toReplay = Trace
    26      /\ action' := "Init"
    27      /\ Init
    28  
    29  TraceNext ==
    30      /\ Len(toReplay) > 0
    31      /\ toReplay' = Tail(toReplay)
    32      \* Here is the trick. We restrict the action to the expected one,
    33      \* so the other actions will be pruned
    34      /\ action' := Head(toReplay)
    35      /\ Next
    36  
    37  ================================================================================