Use of PRISM typically starts with the construction of a probabilistic model,
i.e. the conversion of a description in the PRISM language to an MDP, DTMC or CTMC, as appropriate.
During this process, PRISM computes the set of states in the model which are reachable from the initial states
and the transition matrix which represents the model.
There are a selection of sample PRISM model files in the examples
directory of the distribution.
From the command-line, simply type:
prism model
where model
is the name of the file containing the model description.
In the GUI, select menu option "Model | Open Model" and choose a file.
The model will be displayed in the editor in the "Model" tab of the GUI window.
The file is parsed upon loading. If there are no errors, information about the modules, variables,
and other components of the model is displayed in the panel to the left and a green tick will be visible.
If there are errors in the file, a red cross will appear instead and the errors will be highlighted in the model editor.
To view details of the error, position the mouse pointer over the source of the error (or over the red cross).
Alternatively, select menu option "Model | Parse Model" and the error message will be displayed in a message box.
Model descriptions can, of course, also be typed from scratch into the GUI's editor.
Once the file has been parsed successfully, the model can be built by selecting "Model | Build Model". If there are no errors during model construction, the number of states and transitions in the model will be displayed in the bottom left corner of the window.
The presence of deadlock states in the model,
i.e. states which are reachable but from which there are no outgoing transitions, constitutes an error. From the GUI, you are offered the opportunity to automatically add self-loops to these states to resolve the situation.
The same can be achieved from the command-line by using the -fixdl
switch.
Otherwise, the deadlock states are displayed (in the GUI, they appear in the "Log" tab of the main window). Note that if you choose to fix the deadlocks by adding self-loops, you can determine in which states this occurred by model checking the property "deadlock"
. Another useful technique in this situation is to generate a random path in the simulator in the hope of reaching a deadlock state. This will give you useful information about how the state can be reached.