-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
[BUG] CHOOSE semantics wrong #841
Comments
Yep, we have a non-deterministic translation of Actually, I know how to make |
The main reason for keeping |
It also relies on users switching to fold operators. Perhaps, the CommunityModules should be bundled with/included in Apalache to lower the barrier? Also, if there are no specs that rely on CHOOSE, it should probably be deterministic by default, and the option allows advanced users to explicitly switch to non-determinism. |
It will make Apalache slow by default. A faster tool with false positives that can be turned off is better than a slow tool by default. False negatives are of course bad :) |
Yeah, maybe we should place a warning or something when we start to support |
I remember that TLC did not faithfully support |
See the warning in 14.6 of Specifying Systems (p. 262). In practice, the given example is too simple, though: Welcome to the TLA+ REPL!
TLC2 Version 2.16 of Day Month 20??
Enter a constant-level TLA+ expression.
(tla+) CHOOSE s \in {1,2,3,3,2,1}: s < 3
1
(tla+) CHOOSE s \in {3,2,1}: s < 3
1 I haven't checked, but I expect this to only happen if symbolic (lazy) sets don't get normalized (enumerated) first. |
We will introduce the new operator as scheduled in #888. However, I do not understand this issue anymore. The book clearly says that it's OK for TLC to loosen semantics of |
Since this comment is public, just to keep the record that there is no bias towards TLC (as Leslie has written in private communication). The point is that our non-deterministic semantics of |
(Leslie agreed to make the aforementioned discussion public)
(*) (S = T) /\ (\A x \in S : P(x) = Q(x)) => (CHOOSE x \in S : P(x)) = (CHOOSE x \ T : Q(x))
(S = T) => (CHOOSE x \in S : P(x)) = (CHOOSE x \in T : P(x))
(+) (CHOOSE x \in S : P(x)) = (CHOOSE x \in S : P(x))
The subsequent discussion about |
Turned up on #1123, here's an example of unsoundness resulting from interactions between our inability to guard against duplicate indices and the indeterminacy of our implementation of
Run with Giving the counterexample:
|
Let's add the expensive uniqueness check in the encoding and introduce the non-deterministic version of this operator, so the user would be able to disable this check. |
Specifying Systems page 73
Note that replacing
S
withNat
causesscala.NotImplementedError: A set filter over InfSet[Int] is not implemented
TLC
The text was updated successfully, but these errors were encountered: