byte x;
if
::(x == 0) -> ...
::(x > 0) -> ...
fi
Is there a default value of a global variable? Or the model checker checks for all possible interleavings, that is, in this case, use all possible states with both (x==0)
and (x>0)
.
byte x;
if
::(x == 0) -> ...
::(x > 0) -> ...
fi
Is there a default value of a global variable? Or the model checker checks for all possible interleavings, that is, in this case, use all possible states with both (x==0)
and (x>0)
.
According to Promela doc variables are initialized to zero by default.
Checking for all possible initial values of variables would increase the state space exponentially.
Do it like this;
if
:: x = 0
:: x = 1
:: x = 2
// if you need more, add more
fi
or if you really want all values, 0 to 255
byte x = 0;
do
:: x <= 254 -> x++
:: break
od
which will break or increment on each iteration, thus generating all possible values. Or, as you (and I) now know, use:
select (i : 0 .. 255)