Sources for the calculation of quantiles
All the referenced archives are based on the probabilistic model checker PRISM in version 4.3.1. They do extend PRISM in order to support the calculation of quantiles over Markovian models. The focus of my work was on the computation of quantiles using the explicit engine of PRISM. Whereas the support for the different symbolic engines provided by PRISM (Hybrid, Sparse, MTBDD) was done by Joachim Klein.- Quantiles integrated into PRISM
This version uses PRISM as it is and just extends it by integrating the computation of quantiles. As a consequence this version can be easily integrated into PRISM in order to provide the presented quantile-based framework with PRISM. - Quantiles integrated into PRISM using
BitSetInterface
In contrast to the previous version the base classes of PRISM were slightly changed by replacing each usage of the classBitSet
with the usage of the tailored data structureBitSetInterface
. The main advantage is that small sets of indices (or states) are not stored usingBitSet
s. Instead a dynamic adapting data structure is used that uses integer-arrays for the storage of a few elements, and as soon as more elements need to be stored, the storage automatically utilisesBitSet
s. The analysed protocols revealed that this improved both the calculation speed and the memory consumption for the computation of quantiles when using PRISMs explicit engine.
This version was used for calculating the results presented in the monograph ‘Formal Methods for Probabilistic Energy Models’. - Quantiles integrated into PRISM using
BitSet
only
Here, we do not use the self-adapting storage described previously. We only utilise the classBitSet
as it is shipped with the programming language JAVA. The analysed protocols revealed that the utilisation ofBitSet
s for the calculation of quantiles in the explicit engine restricted the applicability of the calculation of quantiles in many cases. Therefore, a lot of protocols could not be analysed using this implementation.
The only reason for considering this version is for demonstrating the impact of the self-adapting data structure on the performance of the quantile calculations.
tar
with the options -czf
in order to obtain a compressed archive.
The best way for decompressing the archive is to use
tar -xzf archive.tar.gz
Specifying a quantile query in PRISM
For the following it is assumed that the reader is familiar with PRISM and is able to build and verify a model using the possibilities that are provided by PRISM. Since there exists support for a variety of quantile queries we will give a short introduction concerning the different possibilities. At first we differentiate between quantiles that aim at fulfilling some (constrained) reachability formula with some desired probability (reachability quantiles), and expectation quantiles that aim at optimising the accumulation of two reward functions. Before continuing I want to introduce a useful interactive tool that presents an overview over the different syntactic possibilities for reachability quantiles and their interplay. It was written by Joachim Klein and can be found here. It allows to explore the different variants for (probability) quantiles, conversion between the two syntax notations and exploration of the transformations between quantiles. Those transformations allow to rely on a limited number of base cases for implementing the computations. In the explicit engine of PRISM, the computation of quantiles is supported for DTMCs and MDPs, while the implementation for the symbolic engines is currently limited to MDPs. Additionally, there is support for computing time-bounded reachability quantiles for CTMCs, as introduced below.Reachability quantiles
The reachability quantiles can be partitioned into plain reachability quantiles and quantiles under side conditions. Plain reachability quantiles can be specified using the following syntax (called normal-form): Quantile (Ex, P>0.5 [ F<=_q goal ], R{"try"})
It is as well possible to specify a step-bounded quantile by simply dropping the specification of the reward structure:
Quantile (Ex, P>0.5 [ F<=_q goal ])
quantile (min t, Pmax>0.5 [ F{reward{"try"}<=t} goal ])
quantile (min s, Pmax>0.5 [ F{steps<=s} goal ])
quantile (min t, Pmax>{0, 0.01, [0.05:0.95:0.1], 0.99} [ F{reward{"try"}<=t} goal ])
0.05, 0.15, 0.25, 0.35, ..., 0.85, 0.95
0, 0.01, 0.05, 0.15, 0.25, 0.35, ..., 0.85, 0.95, 0.99
Reachability quantiles under side conditions
The previously considered plain reachability quantiles can be extended by the specification of some ω-regular side condition. Now, the objective is to compute the specified reachability quantile and at the same time fulfilling this side condition. The specification of such a quantile can be done by the following (at the moment only the syntax for the normal-form supports the specification of quantiles under side conditions): Quantile (Ex, P>0.5 [ (F<=_q success) & (G(boost_1=0)) ], R{"energy"})
Reward-bounded reachability properties
Since the algorithm for the computation of quantiles relies on an iterated computation of reward-bounded reachability probabilities, the employed computation methods can be used as well for the computation of reward-bounded reachability probabilities, without the need to introduce a counter to the model. In contrast to a quantile query a reward-bounded reachability query is already equipped with a certain bound determining the exact number of iterations that need to be performed in order to calculate the demanded reachability probabilities. The utilisation of the quantile backend hereby takes advantage of all the improvements that were implemented for the computation of quantiles. An example for a reward-bounded reachability property is as follows: Pmax=? [ F{reward{"energy"}<=200} goal ]
Pmax=? [ F{reward{"energy"}<=200,reward{"send_messages"}<=5} goal ]
Reachability quantiles over CTMCs
The presented implementation supports quantiles with upper or lower time bounds on simple path formulas over continuous-time Markov chains. The utilised algorithm consists of a combination of an exponential search with a succeeding binary search in order to find the demanded quantile value. The exponential search determines the smallest i ∈ Ν such that the probability for the given path formula is greater than the specified probability threshold for the first time. Afterwards, a binary search will be performed in the interval [2i-1, 2i]. An example query is as follows: quantile (min t, P>=0.5 [ F{time<=t} goal ])
-quantileCtmcPrecision <x>
over the command line.
There exists the possibility to start the computation with a more coarse-grained precision and to dynamically refine the precision of the computation until the user-defined accuracy can be guaranteed for the resulting value.
This allows to relax the precision when it is not necessary.
In order to enable this option from the command line one needs to specify the switch -quantileCtmcStartPrecision <x>
, where x
corresponds to the desired starting precision.
Setting x
to 0 deactivates this dynamic adaptation-behaviour and all necessary computations use the precision specified for the final result.
For now the implemented algorithm only supports quantiles with upper or lower time bounds on simple path formulas.
Expectation quantiles
Expectation quantiles investigate the interplay of two reward functions. So, instead of handling just one reward function we take another one into account. We minimise the accumulation of one reward and try to increase the accumulation of the second reward. An expectation quantile can be specified using the following query: expQuantile (Ex, Exp R{"utility"} > 5.5 [ R{"energy"} <= ? ])
expQuantile (Ex, Exp R{"utility"} > {[0:10:1], [20:100:10], 200, 500} [ R{"energy"} <= ? ])
expQuantile (Un, Exp R{"utility"} > 5.5 [ R{"energy"} <= ? ])
Adapting the performance of the computation of quantiles
There are multiple possibilities to increase the performance of the computation of quantile queries. This allows to adapt the performance to different applications that have varying characteristics. Using the command-line flagprism -help
-valuesStorage <name> .......... Specify the method to store the values for the successors of positive reward states / transitions ([ALL_STATES, POS_REWARD_SUCCS_UNIFORM, POS_REWARD_SUCCS_INDIVIDUAL]) [default: ALL_STATES]
-lpSolverOnly <n> .............. Use the LP solver exclusively for all calculations (the number gives the bound for the calculations)
-multiStateMethod <name> ........ Specify the method to solve multi-state sets ([VALUE_ITERATION, INTERVAL_ITERATION, LP_SOLVER]) [default: VALUE_ITERATION]
-parallelPoolSize <n> .......... Specify the number of parallel threads for quantile-calculations
-parallelForPositiveRewards .... Exploit parallelism of J8 for parallel computations of positive-reward states. The degree of parallelity is controllable via -parallelPoolSize <n>
-parallelForZeroRewards ........ Exploit parallelism of J8 for parallel computations of zero-reward states. The degree of parallelity is controllable via -parallelPoolSize <n>
-quantileCtmcStartPrecision <x> Set precision for quantile-calculations using CTMCs. Whenever a more precise computation is needed, the precision will adapt automatically. Setting to 0 will deactivate this behaviour and all calculations will be carried out using PRISMs standard-setting [default: 0]
-quantileCtmcPrecision <x> ..... Set value of epsilon for quantile-convergence in CTMCs [default: 1e-6]
-lpSolverOnly <n> .............. Use the LP solver exclusively for all calculations (the number gives the bound for the calculations)
-multiStateMethod <name> ........ Specify the method to solve multi-state sets ([VALUE_ITERATION, INTERVAL_ITERATION, LP_SOLVER]) [default: VALUE_ITERATION]
-parallelPoolSize <n> .......... Specify the number of parallel threads for quantile-calculations
-parallelForPositiveRewards .... Exploit parallelism of J8 for parallel computations of positive-reward states. The degree of parallelity is controllable via -parallelPoolSize <n>
-parallelForZeroRewards ........ Exploit parallelism of J8 for parallel computations of zero-reward states. The degree of parallelity is controllable via -parallelPoolSize <n>
-quantileCtmcStartPrecision <x> Set precision for quantile-calculations using CTMCs. Whenever a more precise computation is needed, the precision will adapt automatically. Setting to 0 will deactivate this behaviour and all calculations will be carried out using PRISMs standard-setting [default: 0]
-quantileCtmcPrecision <x> ..... Set value of epsilon for quantile-convergence in CTMCs [default: 1e-6]
Analysed protocols
In the following we list the material for the protocols that have been analysed within the dissertation ‘Formal Methods for Probabilistic Energy Models’. We start by giving the material for the selected protocols from the benchmark suite of PRISM:- Self-Stabilising Protocol: analysed models and properties (plot)
- Asynchronous Leader-Election Protocol: analysed models and properties (plot)
- Synchronous Leader-Election Protocol: analysed models and properties (plot)
- Randomised Consensus Shared Coin Protocol: analysed models and properties (plot)
- Energy-Aware Job-Scheduling Protocol:
- reachability quantiles:
- one shared resource:
- minimal energy: analysed models and properties (plot)
- maximal utility: analysed models and properties (plot)
- under side conditions:
- prohibit turbo mode: analysed models and properties (plot)
- force turbo mode after first deadline-miss: analysed models and properties (plot)
- round-robin scheduling: analysed models and properties (plot, zoomed)
- two shared resources:
- minimal energy: analysed models and properties (plot)
- maximal utility: analysed models and properties (plot)
- one shared resource:
- expectation quantiles: analysed models and properties (plot)
- reachability quantiles:
- Energy-Aware Bonding Network Device: analysed models and properties (plot)
- HAECubie Demonstrator:
- reachability quantiles: analysed models and properties (plot)
- expectation quantiles: analysed models and properties (plot)
- Tandem Queueing Network: analysed models and properties