Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

random numbers in rules cause trouble #2

Open
ongardie opened this issue May 25, 2016 · 2 comments
Open

random numbers in rules cause trouble #2

ongardie opened this issue May 25, 2016 · 2 comments

Comments

@ongardie
Copy link
Collaborator

@vidbina ran into an issue where using urandomRange() in a rule got the simulator confused about which rules were active vs inactive. See this conversation on Twitter: https://twitter.com/ongardie/status/735474014798413825. I suggested using a rule-for to hoist the random number generation out of the rule and into the simulator.

Similarly, since the bananas model generates a random number of bananas to bring back from the store, we can't effectively use the model checker on it.

I think the possibly bad conditions are these:

  1. during model checking, any rule generates a random number,
  2. during simulation, a rule (active or inactive) generates a random number that affects control flow.

Hrm, that's a bit difficult to warn about because of the "affects control flow", will have to think more.

@dgryski
Copy link

dgryski commented Jun 8, 2016

The solution Spin takes when checking a model that includes randomness is to try all the possibilities. For the bananas case, that means each trip to the store means 9 (0..8) more states to check.

@ongardie-sfdc
Copy link
Collaborator

ongardie-sfdc commented Jul 5, 2016

There's more related discussion on the runway-dev thread Does urandom function nondeterministically in modelchecking mode?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants