[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlaplus] Re: Actions Debugging



Interestingly, there is a workaround for "breakpoint".  If purposely add mistake into condition after "response[1] = "SUSPENDED"", TLA+ will raise java.lang.RuntimeException exception and print out full behaviour.

ResendRequest ==       /\ responses # << >>

                       /\ \E i \in 1..Len(responses):                          

                           LET response == responses[i]

                            IN 

                             /\ response[1] = "SUSPENDED"

                             /\ response[3] = "SUSPENDED"

                             /\ requests' = Append(requests, <<"SENT", response[2]>>)

                             /\ responses' = Tail(responses)


Here I added "response[3] = "SUSPENDED"" condition which raised exception because tuple response only has length 2.

This is just to check that TLC has traversed a behaviour which has condition "/\ response[1] = "SUSPENDED"" evaluated to TRUE.






понедельник, 1 февраля 2021 г. в 14:19:23 UTC+3, Oleg Levchenko:
Is there any way in TLC to debug spec?

For example, I have an action "ResendRequest" which is not "fired", i.e. TLC shows it has 0 distinct states.

Is there any way in TLC to set a breakpoint on a particular condition so that I could see why my action doesn't fire?

Example is below.

ResendRequest ==       /\ responses # << >>

                       /\ \E i \in 1..Len(responses):                          

                           LET response == responses[i]

                            IN 

                             /\ response[1] = "SUSPENDED"

                             /\ requests' = Append(requests, <<"SENT", response[2]>>)

                             /\ responses' = Tail(responses)




It would be convenient to set a breakpoint on a condition "response[1] = "SUSPENDED"" so that I could see why behaviours traversing ResendRequest don't fire this action, i.e. why its not enabled.


Oleg.

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/347f269f-6663-4e4e-b33a-1135b3efc93dn%40googlegroups.com.