Computation engines
An important feature of the tool is its engines.
PRISM is a symbolic model checker: its basic underlying data structures are BDDs and MTBDDs.
When performing numerical computation, however, the tool can use one of three engines.
The first is implemented purely in MTBDDs (and BDDs); the second uses sparse matrices;
and the third is a hybrid, using a combination of the other two.
The choice of engine ("MTBDD", "sparse" or "hybrid") will not affect the results of model checking -
all engines perform the same calculations
(although in a few cases, some types of computation can only be performed with certain engines).
Performance (time and space), however, may vary significantly and if you are using too much time/memory with one engine, it may be worth experimenting. Below, we briefly summarise the key characteristics of each engine.
- The hybrid engine is enabled by default in PRISM. It uses a combination of symbolic and explicit data structures (as used in the MTBDD and sparse engines, respectively). In general it provides the best compromise between time and memory usage: it (almost) always uses less memory than the sparse engine, but is typically slightly slower. The size of model which can be handled with this engine is quite predictable. The limiting factor in terms of memory usage comes from the storage of 2-4 (depending on the computation being performed) arrays of 8-byte values, one for each state in the model. So, a typical PC can handle models with between 107 and 108 states (one vector for 107 states uses approximately 75 MB).
- The sparse engine can be a good option for smaller models where model checking takes a long time. For larger models, however, memory usage quickly becomes prohibitive. As a rule of thumb, the upper limit for this engine, in terms of model sizes which can be handled, is about a factor of 10 less than the hybrid engine.
- The MTBDD engine is much more unpredictable in terms of performance but, when a model exhibits a lot of structure and regularity, can be very effective. This engine has been successfully applied to extremely large structured (but non-trivial) models, in cases where the other two engines cannot be applied. The MTBDD engine often performs poorly when the model (or solutions computed from it) contain lots of distinct probabilities/rates; it performs best when there are few such values. For this reason the engine is often successfully applied to MDP models, but much less frequently to CTMCs. When using the MTBDD engine, the variable ordering of your model is especially important. This topic is covered in the FAQ section.
When using the PRISM GUI, the engine to be used for model checking can be selected from the "Engine" option under the "PRISM" tab of the "Options" dialog. From the command-line, engines are activated using the -mtbdd
, -sparse
and -hybrid
(or -m
, -s
and -h
, respectively) switches, e.g.:
prism poll2.sm -tr 1000 -s
For further information and technical details about PRISM's implementation and engines, see: [Par02],[KNP04b].
Note also that precise details regarding the memory usage of the current engine are displayed during model checking (from the GUI, check the "Log" tab). This can provide valuable feedback when experimenting with different engines.