Replies: 1 comment 2 replies
-
action A = not(enabled(B)) & x <- x + 1
action B = not(enabled(A)) & x <- x - 1 In TLA+, it is not technically possible, as names have to be defined before they are used, but even there one can probably write some strange things. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello
In our current language specification, we state that the
enabled
operator is only available in temporal mode. I believe we should allow it (or a renamed version of it such ascondition
) in state mode as well. Here's why and how.Why
Looking at the tic-tac-toe spec from this tutorial:
It has a bunch of pairs of definitions (i.e.
CanWin
andWin
,CanBlockWin
andBlockWin
) that represent the same action, but one of them encapsulates only the condition part.While writing this spec in Quint, my intuition was to do something like:
and therefore not have to define any of the
Can*
operators.How
I believe the main reason we are not using
enabled
in this context is some implementation difficulty, so here's how I envision it. First of all,enabled
(or whatever name we choose) should have effect signature(Read[r1] & Update[u1]) => Read[r1]
- meaning it swallows any updates and the result effect is eitherPure
(ifr1 = {}
) orRead[vars]
. The implementation for swallowing updates is a simple expression replacement:Note
We are discussing the simulator/interpreter for Quint and I believe this is very useful for interactive simulation (it's how I did it in my thesis).
WDYT @konnov @shonfeder @Kukovec @p-offtermatt @rodrigo7491 @thpani ?
Beta Was this translation helpful? Give feedback.
All reactions