-
Notifications
You must be signed in to change notification settings - Fork 7
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
Short-circuit evaluation in conjunctions #44
Comments
I have a PR in progress. |
To test
After clicking on the initial state in the "Actions" tab, tla-web displays "Assertion failed". The console shows:
|
@ajdavis How does this handle |
Thanks very much @lemmy, I misunderstood how TLA+ works! I see now that your expression permits behaviors where x is incremented by one or two, so both sides must be evaluated. No short-circuiting of disjunctions. |
Yeah, short-circuiting becomes a bit more subtle when doing initial/next state generation. Short-circuiting conjunctions should be safe, though. Note that we already try to do it for conjunction lists. Note also that test suites are currently run here. I will soon add documentation on how to add/run new tests. |
Also, FALSE implies anything. -> % tlcrepl
Welcome to the TLA+ REPL!
TLC2 Version 2.18 of Day Month 20??
Enter a constant-level TLA+ expression.
(tla+) FALSE => 42 = "abc"
TRUE |
Repro for disjunct: type
TRUE \/ <<"a">>[2] = "b"
in the REPL.Expected: result TRUE, the second half isn't evaluated.
Actual: no result, "swallowing parse errors during repl evaluation" is logged in the console. The REPL tried to interpret the second half and failed with an index error.
Repro for conjunct: type
FALSE /\ <<>>[1] = "a"
in the REPL.Expected: result FALSE, the second half isn't evaluated.
Actual: no result, "swallowing parse errors during repl evaluation" is logged in the console. The REPL tried to interpret the second half and failed with an index error.
The text was updated successfully, but these errors were encountered: