Closed andredidier closed 10 years ago
André, our understanding of internal choice is that it may resolve immediately; reducing to either of the left or right branches (referencing D23.4b). So, I'd argue that Stop is a valid behaviour of ChaosE :).
It's true, @joey-coleman, I'll change the title. It should eventually allow unwanted
to be chosen, so it depends on how the interpreter resolves a non-deterministic choice (maybe being fair on choosing either behaviour).
It may be possible to force communication on unwanted
by simply reversing the order of the arguments, or "hiding" the Stop
in another action (even (Skip;Stop)
may be sufficient. Many of the non-det choices in the interpreter are made based on the random number generator, so it is possible to set a seed, but I do not know the details for resolving internal choice. I'll look into it at the next opportunity.
So, I checked the code (relevant code is in ActionInspectionVisitor.java) and there is indeed a call to a RNG that resolves this. The RNG is created (and seeded) in AbstractInspectionVisitor.java, but we have no exposed configuration to change the seed, so the simulator always runs the same sequence of random choices every time.
I'll open a separate enhancement issue for exposing that parameter; otherwise I think this can be closed.
On the following code, an expected trace is, for example
<a,b,a>
(and the process then terminates). To explain, we need to understand the parallelism ofNFTSimple
andChaosE
. After the communication ofa
, the processNFTSimple
can communicateunwanted.1
andunwanted.100
and terminate. The processChaosE
can non-deterministically choose to communicate bothunwanted.1
andunwanted.100
or block them on the parallelism withStop
behaviour. The current interpreter behaviour only considers theStop
behaviour ofChaosE
, blocking theunwanted
events.I tested on revision 88f896a.