Skip to content

Commit ad8988f

Browse files
committed
The trace validation still faces challenges, including the fact that nodes deactivating are not logged in the implementation. This leads to a rejected trace when a seemingly active node passes the token.
TLC's limitation in supporting the composition of actions (compare section 7.3 (page 76ff) of Lamport's Specifying Systems) prevents the TraceSpec from defining its next-state relation by conjoining Deactivate \cdot PassToken. However, this limitation can be overcome by defining a suitable action that deactivates the node when it passes the token.
1 parent 98c4d40 commit ad8988f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

specifications/ewd998/EWD998ChanTrace.tla

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,21 @@ TraceLog ==
3434

3535
-----------------------------------------------------------------------------
3636

37+
DeactivateAndPassToken ==
38+
\E i \in Node:
39+
/\ PassToken(i)!2
40+
/\ PassToken(i)!3
41+
/\ active' = [active EXCEPT ![i] = FALSE]
42+
/\ UNCHANGED counter
43+
3744
TraceSpec ==
3845
\* Because of [A]_v <=> A \/ v=v' , the following formula is logically
3946
\* equivalent to the (canonical) Spec formual Init /\ [][Next]_vars .
4047
\* However, TLC's breadth-first algorithm does not explore successor
4148
\* states of a *seen* state. Since one or more states may appear one or
4249
\* more times in the the trace, the UNCHANGED vars combined with the
4350
\* TraceView that includes TLCGet("level") is our workaround.
44-
Init /\ [][Next \/ UNCHANGED vars]_vars
51+
Init /\ [][Next \/ UNCHANGED vars \/ DeactivateAndPassToken]_vars
4552

4653
-----------------------------------------------------------------------------
4754

@@ -100,8 +107,7 @@ IsPassToken(l) ==
100107
/\ \A idx \in DOMAIN inbox'[snd]:
101108
inbox'[snd][idx].type # "tok"
102109
\* Sender has to be inactive to pass the token, i.e
103-
/\ ~active[snd]
104-
/\ UNCHANGED <<active, counter>>
110+
/\ UNCHANGED <<counter>>
105111

106112
IsRecvToken(l) ==
107113
\* Log statement was printed by the receiver.
@@ -221,6 +227,7 @@ TraceAlias ==
221227
enabled |->
222228
[
223229
InitToken |-> ENABLED InitiateProbe,
230+
DeAndPass |-> ENABLED DeactivateAndPassToken,
224231
PassToken |-> ENABLED \E i \in Node \ {0} : PassToken(i),
225232
SendMsg |-> ENABLED \E i \in Node : SendMsg(i),
226233
RecvMsg |-> ENABLED \E i \in Node : RecvMsg(i),

0 commit comments

Comments
 (0)