-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ShiViz module error because operator definition override not visible when instance marked local #37
Comments
This works:
The underlying issue is that TLC apparently does not honour the re-definition of ---- MODULE dual_writes_TTrace ----
EXTENDS TLCExt, Json, dual_writes, Sequences
CONSTANTS ClientA, ClientB
_trace ==
<<
([StorageValues |-> (Database :> 0 @@ Cache :> 0),pc |-> (ClientA :> "WriteDatabase" @@ ClientB :> "WriteDatabase")]),
([StorageValues |-> (Database :> ClientA @@ Cache :> 0),pc |-> (ClientA :> "WriteCache" @@ ClientB :> "WriteDatabase")]),
([StorageValues |-> (Database :> ClientB @@ Cache :> 0),pc |-> (ClientA :> "WriteCache" @@ ClientB :> "WriteCache")]),
([StorageValues |-> (Database :> ClientB @@ Cache :> ClientB),pc |-> (ClientA :> "WriteCache" @@ ClientB :> "Done")]),
([StorageValues |-> (Database :> ClientB @@ Cache :> ClientA),pc |-> (ClientA :> "Done" @@ ClientB :> "Done")])
>>
----
_TETrace == _trace
_TEPosition == TLCGet("level")
_prop ==
~<>[](
StorageValues = ((Database :> ClientB @@ Cache :> ClientA))
/\
pc = ((ClientA :> "Done" @@ ClientB :> "Done"))
)
----
_init ==
/\ StorageValues = _TETrace[1].StorageValues
/\ pc = _TETrace[1].pc
----
_next ==
/\ \E i,j \in DOMAIN _TETrace:
/\ \/ j = i + 1
/\ StorageValues = _TETrace[i].StorageValues
/\ StorageValues' = _TETrace[j].StorageValues
/\ pc = _TETrace[i].pc
/\ pc' = _TETrace[j].pc
-----------------------------------------------------------------------------
LOCAL FnHost ==
LET host[i \in DOMAIN _TETrace] ==
(*************************************************************************)
(* The pc value that has been modified in (the current) state n compared *)
(* to the predecessor state n-1. *)
(*************************************************************************)
IF i = 1 THEN "--"
ELSE IF _TETrace[i-1].pc = _TETrace[i].pc
THEN host[i-1] \* pc variable has not changed.
ELSE CHOOSE p \in DOMAIN _TETrace[i-1].pc :
_TETrace[i-1].pc[p] # _TETrace[i].pc[p]
IN TLCEval(host)
Host == FnHost[_TEPosition]
-----------------------------------------------------------------------------
LOCAL clock(n) ==
IF n = 1 THEN [p \in DOMAIN _TETrace[n].pc |-> 0] \* In the init state, all clocks are 0.
ELSE [p \in DOMAIN _TETrace[n].pc |-> IF p = FnHost[n]
THEN 1
ELSE 0]
LOCAL sum(F, G) ==
[d \in DOMAIN F |-> F[d] + G[d]]
LOCAL FnClock ==
LET vclock[i \in DOMAIN _TETrace] ==
IF i = 1
THEN clock(i)
ELSE sum(TLCEval(vclock[i-1]), clock(i))
IN TLCEval(vclock)
Clock ==
(*************************************************************************)
(* The pc variable formatted as a Json object as required by ShiViz. *)
(*************************************************************************)
FnClock[_TEPosition]
_expression ==
[
StorageValues |-> StorageValues
,pc |-> pc
,h |-> Host
,c |-> Clock
]
============================================================================= |
Btw. the |
Thank you! How can I generate the trace spec? I added the most recent CommunityModules-deps.jar to the library path locations, but I'm getting
There are no errors in the user or progress output. |
Don't bother with the trace spec--this should work with the Toolbox too. I hope to look into it tomorrow. About |
The fix is to change the third line in ShiViz.tla from:
to
Regression introduced with a39cb8a |
the case of Toolbox, this causes the definition override of `_TETrace` to be invisible. In turn, TLC will then try to evaluate the TLA+ definition of `_TETrace` as defined in Tooblox.tla: Attempted to enumerate S \ T when S: Nat is not enumerable. This is a regression caused by commit a39cb8a Fixes Github issue #37 #37 [Bug]
FWIW: TLC's behavior WRT |
Thanks @lemmy! Another unrelated problem I had was that |
@Alexander-N If you want |
I have been trying to use the ShiViz module in this spec without success. After I add either
Host
orClock
to the error-trace exploration I'm getting the following error (Toolbox version 1.7.1):Error seems to persist after overwriting
Nat
with1..100
.The text was updated successfully, but these errors were encountered: