Skip to content

Commit 7f157c8

Browse files
committed
Trace validation has begun to reject traces due to the presence of termination ("trm") messages in the implementation, which are not included in the EWD998 model. This represents the first discrepancy that has been discovered between the specifications and the actual code, but it is something that could have easily been spotted through a manual comparison between the two.
To resolve this issue, the TraceNextConstraint has been defined to allow for "trm" messages and is based on finite stuttering, similar to the way the IsRecvToken is handled.
1 parent 55e9a64 commit 7f157c8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

specifications/ewd998/EWD998ChanTrace.tla

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,20 @@ IsDeactivate(l) ==
165165
/\ active' = [active EXCEPT ![node] = FALSE]
166166
/\ UNCHANGED <<color, inbox, counter>>
167167

168+
IsTrm(l) ==
169+
\* "trm" messages are not part of EWD998, and, thus, not modeled in EWD998Chan. We map
170+
\* "trm" messages to (finite) stuttering, essentially, skipping the "trm" messages in
171+
\* the log. One could have also preprocessed/filtered the trace log, but the extra
172+
\* step is not necessary.
173+
/\ l.event \in {"<", ">"}
174+
/\ l.pkt.msg.type = "trm"
175+
\* The (mere) existance of a "trm" message implies that *all* nodes have terminated.
176+
/\ \A n \in Node: ~active[n]
177+
\* Careful! Without UNCHANGED vars, isTrm is true of all states of the high-level spec
178+
\* if the current line is a trm message. In general, it is good practice to constrain
179+
\* all spec variables!
180+
/\ UNCHANGED vars
181+
168182
TraceNextConstraint ==
169183
\* We could have used an auxiliary spec variable for i , but TLCGet("level") has the
170184
\* advantage that TLC continues to show the high-level action names instead of just Next.
@@ -186,6 +200,7 @@ TraceNextConstraint ==
186200
\/ IsSendMsg(logline)
187201
\/ IsRecvMsg(logline)
188202
\/ IsDeactivate(logline)
203+
\/ IsTrm(logline)
189204

190205
-----------------------------------------------------------------------------
191206

0 commit comments

Comments
 (0)