4.2 Arbitrary models
4.2.2 Universal expectation quantiles
Now, universal expectation quantiles are considered. Obviously, for each utility bound u P Q we have the following:
qus @ExpUąu(energy ď?) = 8 iff e P N : ExpUtil min s (energy ď e) ą u( = H iff sup ePN ExpUtilmin s (energy ď e) ď u
iff for each e P N there is some scheduler Se such that ExpUtilSe
s (energy ď e) ď u We first observe that for reasoning about ExpUtilmin
s (energy ď e) it suffices to consider schedulers that stay forever in ZU as soon as they have reached some state in ZU, see Lemma 4.2.5 below.
With abuse of notations, we interpret ZU as a set of states or as a set of states and actions. Thus, if π = s0α0s1α1s2α2 . . .is an infinite path then:
π |ù ♦ZU iff sk PZU for some k P N
π |ù lZU iff sk PZU and rewu(sk, αk) = 0 for all k P N.
Moreover, π |ù l(ZU Ñ lZU) if and only if either ZU X tsj : j P Nu = H or there is some k P N with ZU X ts0, . . . , sk´1u = H and suff (π, k) |ù lZU, where
suff (π, k) = skαksk+1αk+1sk+2αk+2 . . . denotes the suffix of π starting at position k.
Lemma 4.2.5. Let S be a scheduler for M. Then, there exists a scheduler S1 for M such that for each state s and each energy bound e P N:
ExpUtilS1 s (energy ď e) ď ExpUtil S s(energy ď e) and PrS1 s l(ZU Ñ lZU) = 1
Proof. Again, let T be a finite-memory scheduler realising the zero-utility end compon- ents, i.e., PrT
t(lZU) = 1 for each state t P ZU. Given an arbitrary scheduler S, we define S1 to be a scheduler that behaves as S until some ZU-state has been reached, in which case S1 switches mode and behaves as T from then one.
Lemma 4.2.6. If S is a scheduler for M such that PrS
s(Lim(UD)) ą 0, then
sup ePN
ExpUtilS
s(energy ď e) = 8 Proof. We first observe that
ExpUtilS
s(true) = sup ePN
ExpUtilS
s(energy ď e)
is the expected total utility under scheduler S from state s. The claim then follows from the fact that the accumulated utility value of the prefixes along paths whose limit is a utility-divergent end component converges to 8. The assumption PrS
s(Lim(UD)) ą 0 yields that these paths have positive measure.
4.2 Arbitrary models
An immediate consequence of Lemma 4.2.6 is as follows:
Corollary 4.2.7. If Prmin
s (Lim(UD)) ą 0 then sup ePN
ExpUtilmin
s (energy ď e) = 8. Now, we address the case Prmin
s (Lim(UD)) = 0, in which case Pr
max
s (Lim(ZU)) = 1.
We will rely on the following assumptions that can be ensured by some adequate preprocessing. Lemma 4.2.5 allows to suppose that M satisfies the following property: (A1) Whenever t P ZU and P (t, α, t1) ą 0 then t1
PZU and rewu(t, α) = 0.
Furthermore, we suppose that t |ù D♦ZU for all states t in M. Hence, there is a scheduler S such that from all states t, the limit of almost all S-paths is a zero-utility end component. In particular:
(A2) Prmax
M,t(♦ZU ) = 1 for all states t
Let V be a deterministic memoryless scheduler for M such that PrV
M,t(♦ZU ) = 1 for all states t and
(A3) ExpUtilV
M,t(♦ZU ) = ExpUtilminM,t(♦ZU ) for all states t
The existence of such a (deterministic and memoryless) scheduler V has been shown by de Alfaro [Alf99]. Note that ExpUtilV
M,t(♦ZU ) is the expected total utility from t under scheduler V.
Lemma 4.2.8. Suppose assumptions (A1) and (A2) hold. Then, for all u P Q and all
states s of M:
sup ePN
ExpUtilmin
M,s(energy ď e) = ExpUtilminM,s(♦ZU )
Proof. To prove “ě’’ we consider a deterministic memoryless scheduler V minimising the expected total utility (see (A3)). Then:
ExpUtilmin
M,s(♦ZU ) = ExpUtilVM,s(♦ZU ) =ExpUtilVM,s(true) =sup ePN ExpUtilV M,s(energy ď e) ěsup ePN ExpUtilmin M,s(energy ď e) The remaining task is to prove “ď’’. Let
umin =sup ePN
ExpUtilmin
M,s(energy ď e) For each e P N there is a (deterministic) scheduler Se such that
ExpUtilSe
s (energy ď e) ď u min
The sequence (Se)ePN can be used to generate a scheduler S such that for each k P N there are infinitely many e P N with S(ρ) = Se(ρ)for all finite paths ρ of length at most k. For this scheduler S and each e P N, we have:
ExpUtilS s(energy ď e) = sup kPN ExpUtilS s (energy ď e) ^ (steps ď k) ď umin
where steps serves as a step counter. Thus: sup
ePN
ExpUtilS
s(energy ď e) ď umin In particular, PrS
s(Lim(UD)) = 0 by Lemma 4.2.6. Therefore, Pr S s(Lim(ZU)) = 1 and: ExpUtilS s(♦ZU ) = ExpUtil S s(true) =sup ePN ExpUtilS s(energy ď e) Putting things together, we obtain:
ExpUtilmin
s (♦ZU ) ď ExpUtil S
s(♦ZU ) ď umin This yields the claim.
Corollary 4.2.9 (Infinite universal expectation quantiles). Under assumptions (A1)
and (A2), for each u P Q, the following statements are equivalent:
(a) qus @ExpUąu(energy ď?) = 8
(b) sup ePN
ExpUtilmin
s (energy ď e) ď u
(c) Prmax
s (♦ZU ) = 1 and ExpUtilmins (♦ZU ) ď u
Statements (c) of both, Corollary 4.2.4 and Corollary 4.2.9, provide criteria to check whether a given expectation quantile has a finite value. Those checks can be done in polynomial time. Therefore, an immediate consequence is as follows:
Corollary 4.2.10. The following two problems are in P:
• decide whether qus DExpUąu(energy ď?) = 8
• decide whether qus @ExpUąu(energy ď?) = 8
So, the statements (c) of the referred corollaries serve as the basis for the precompu- tations of the expectation quantiles (see Section 5.2 for details on the importance of precomputations for the quantile calculations).
5 Implementation
Since the presented computation methods were designed in order to analyse and optimise the energy efficiency of adaptive systems, it is of high interest to have reliable tools for supporting an energy-efficient analysis based on the so far presented methods. Therefore, the current chapter introduces a realisation of the framework for providing quantiles as an instrument for the analysis. The probabilistic model checker Prism [KNP11] hereby serves as the basis for the implementation, since an integration of the methods into Prism allows one to have support for some of the necessary fundamental methods that are required for the computation of quantiles in Markovian models. For example, Prism delivers some of the necessary infrastructure for the handling of the Markovian models themselves or the related reward structures, and one can therefore utilise the shipped model-support and focus on the implementation of the computation methods for the quantiles. Another important fact is that Prism is a well-established tool within the formal methods community. So, the integration of the quantile computations into Prism might help to make the presented framework publicly available to a large audience. And moreover there exists a variety of already created models for a large number of protocols. Those protocols cover various areas of application and can be analysed using the presented framework immediately.
Before starting to describe the integration into Prism, we first take a look at computational optimisations that can be done in order to improve the calculations of quantiles and that help to decrease the memory consumption of the computations as well as improving the timings needed for doing the desired analysis. All the described optimisations have been integrated into the implementation in order to improve the performance of the calculations.
5.1 Computation optimisations
Since model checking is a data- and compute-intensive task it is very important to provide different optimisation techniques to reduce the memory- and the time- requirements of the performed analysis. Since a reduction in the consumed memory can cause an increase in computation-times, and as reduced computation-times may need an increased amount of memory one needs to find a suitable trade-off between the utilised resources for the desired analysis. Therefore, different mechanisms to adapt the performed calculations to varying needs are proposed in the following with respect to the computation of quantiles. The provided methods mainly rely on structural information inherently given by the type of linear programs that need to be solved when computing quantile queries. Therefore, there exist a number of technological possibilities that have
a thorough impact on the performance of the quantile computations. In the following we want to outline the possibilities and go into some necessary details.