Open siraben opened 2 years ago
@nimble-code what is the expected parse for the option :: b -> x = 3;
in Spin? Is this an ltl_expr
?
just talking about spin itself: it's two statements: a side-effect free expression (b) followed by an assignment
Ah, this is because ->
is interpreted as a statement separate in place of ;
?
So these two programs should be equivalent
init {
if
:: 3; 4
fi;
}
init {
if
:: 3 -> 4
fi;
}
yes!
there is a notation for conditional expressions as well: (i -> t : e) is the Promela equivalent of C's (i ? t : e) sometimes very handy, eg to define conditional rv operations:
chan q[3] = [0] of { mtype } sender: q[(P->1:2)]!msg receiver: q[(Q->1:0]?msg
rendezvous is now only possible when P is true at the sender and Q is true at the receiver
with the query
((assignment) @asgn)
has the following highlightingand has the parse tree