The state space of a probabilistic model described in the PRISM language is the set of all possible valuations of its variables. The set of initial states of the model can be specified in one of two ways. The most common approach is simply to specify an initial value for each variable in the model. This is done in the declaration of each variable, as illustrated in Example 1 and as discussed in the previous section. If the initial value of a variable is omitted from its declaration, it is taken to be the minimum value of the variable's range.
This approach results in a single initial state.
It is also possible to construct a model with multiple initial states.
This is done using the init...endinit
construct,
which can be placed anywhere in the file except within a module definition,
and removing any initial values from variable declarations.
Between the init
and endinit
keywords, there should be a
predicate over all the variables of the model.
Any state which satisfies this predicate is an initial state.
Consider Example 1.
As it stands, there is a single initial state (0,0)
(i.e. x=0
and y=0
).
If we remove the init 0
part of both variable declarations
and add the following to the end of the file:
there will be three initial states: (0,0)
, (0,1)
and (0,2)
.
Similarly, we could instead add:
in which case there would be two initial states: (0,1)
and (1,0)
.