Quantitative Temporal Logic Yoram Hirshfeld and Alexander Rabinovich School Mathematical Science Sackler Faculty of Exact Sciences Tel Aviv University Tel Aviv, Israel 69978 e-mail:
[email protected],
[email protected] fax: 972-3-6409357
Abstract
We de ne a quantitative Temporal Logic that is based on a simple modality within the framework of Monadic Predicate Logic. Its canonical model is the real line (and not an !sequence of some type). We prove its decidability using general theorems from Logic (and not Automata theory). We show that it is as expressive as any alternative suggested in the literature. Keywords: Quantitative Temporal Logic. Continuous time Model.
1 Introduction
1.1 Summary of the Results Temporal Logic (TL) is a convenient framework for reasoning about the evolving of a system in time. This made TL a popular subject in the Computer Science Community and it enjoyed extensive research during the last 20 years. In temporal logic the relevant properties of the system are described by Atomic Propositions that hold at some points in time and not at others. More complex properties are described by formulas built from the atoms using Boolean connectives and Modalities (temporal connectives): a k-place modality C transforms statements '1; : : :; 'k on points possibly other than the given point t0 to a statement C ('1; : : :; 'k ) on the point t0 . The rule that speci es when is the statement C ('1; : : :; 'k ) true for the given point is called Truth Table in [GHR94]. The choice of the particular modalities with their truth table determines the dierent temporal logics. The most basic modality is the one place \diamond" modality }X saying \X holds some time in the future". Its truth table is usually formalized by '} (t0) (9t > t0 )X (t) [GHR94]. The truth table of } is a formula of the Monadic Logic of Order (MLO). MLO is a fundamental formalism in Mathematical Logic, part of the general framework of Predicate Logic. Its formulas are built using atomic propositions X (t) (similar to the atoms X of TL), atomic relations between elements t1 = t2 , t1 < t2 and using Boolean connectives and ( rst order) quanti ers 9t and 8t (occasional we shall be interested in second order MLO that has also quanti ers 9X and 8X ). 1
Practically all the modalities used in the literature have their truth table de ned in MLO and as a result every formula of the temporal logic translates directly into an equivalent formula of MLO. Therefore, the dierent temporal logics may be considered a convenient way to use fragments of MLO. There is a lot to be gained from adopting this point of view: the rich theory concerning MLO and in particular the decidability results concerning MLO apply to TL. MLO can also serve as a yardstick by which to check the strength of the temporal logic chosen: a temporal logic is expressively complete if every formula of MLO with single variable t0 is equivalent to a temporal formula. An expressively complete temporal logic is as strong as can be expected. Actually the notion of expressive completeness refers to a temporal logic and to a model (or a class of models) since the question if two formulas are equivalent depends on the domain over which they are evaluated. Any ordered set with monadic predicates is a model for TL and MLO, but the main, canonical , intended models are the non-negative integers hN; t0 ?1 as follows: if ' is a formula of MLO1 then we use the shorthand: (5)
0 +1 (9t)t0 ' 9t(t0 < t < t0 + 1 ^ '(t))
(6)
0 (9t)t0 ?1 ' 9t(t0 ? 1 < t < t0 ^ '(t))
De nition. Quantitative Monadic Logic of Order (QMLO) is the fragment of MLO which is 1
built from the atomic formulas t1 < t2 ; t1 = t2 ; X (t) (t; t1; t2 variables) using Boolean connectives, 8
rst order quanti ers and the following rule: if '(t) is a formula of QMLO with t its only rst order t >t0 ?1 0 The following observation characterizes the expressive power of QTL.
Theorem 2 Let ? be an expressive complete set of modalities (over the reals) for rst-order MLO.
For every formula p over the modalities f?; }1; }-1 g there is a formula (t0 ) of QMLO eectively computable from p such that (t0 ) is equivalent (over the reals) to p. For every formula (t0 ) of QMLO there is a formula p over the modalities f?; }1 ; }-1 g eectively computable from (t0 ) such that (t0 ) is equivalent (over the reals) to p.
Proof Straightforward induction.
4 The Expressive Power of QMLO 4.1 General bounded quanti ers
At rst glance the modalities }-1 and 31 may seem insucient to express more general modalities like }[5;7) de ned by the table 9t: t0 + 5 t < t0 + 7 ^ X (t). However this is not the case. 1 0 +n+m We shall rst show that one can use more general quanti ers in QMLO: (9t)t0 +n , (9t)>t0 +n and quanti ers with weak inequality replacing the strict inequality in one or both ends of the interval, where n is an integer and m is a positive natural number. t0 0 when First (t0; X ) says that there is a rst point past t0 for which X (t) holds: (7)
First (t0; X ) 9t1 [t0 < t1 ^ X (t1) ^ 8t(t0 < t < t1 ! :X (t))]
it is not dicult to see that once a rst solution to X (t) is granted then the last conjunct in (b) is equivalent to X (t0 + 1) (note, however, that X (t0 + 1) by itself is not de nable in QMLO and its addition would lead to undecidability). t0 +1 0 +1 Hence quanti ers (9t)t0 are de nable in QMLO. Let us list some more laws t0 +1 9t :t > t ^ X (t ) (c) (9t)t10 +1 X (t) (8t)>t 1 1 1 0 0. t (8t1 )>t 1 2
Theorem 3 The extension L of QMLO by the following rules is expressive equivalent to QMLO
over the canonical model. if (t) is an L formula with the only free variable t then the following are L formulae: 0 +n+m 1. (9t)t0 +n (t) , where n is an integer and m a positive natural number. 0 +n 2. (9t)t10 +n (t) and (9t)?1 (t), where n is an integer.
9
3. Any of the quanti ers in (1) or (2) with weak order replacing one or both occurrences of the strong equality.
Henceforth, we will freely use these generalized quanti ers which are de nable in QMLO and also the corresponding modalities like 2n which is de ned by (8t)tt00 +n X1 (t) and 3[n;m] which is de ned by (9t)tt00 ++nm X1(t).
4.2 Modalities in Real Time Logics Here are the de nitions of some modalities that were used before: (e) Pnueli's Age1(X ) modality is dual to }-1 0 Age1(X ) (8t)t0 ?1 X (t)
(f) Wilke's relative distance construct \the rst time X (t) occurs after t0 is in distance smaller than larger than or equal to n"[Wilke94] tt00 +n X (t) ^ (8t)t0 :X (t) (g) The . modality of [HRS98]: .(n;n+m) X \there is a rst instance of X (t) among the points in 0 this is the interval (t0 + n; t0 + n + m)". For n = 0 this is First(t0; X ) ^ (9t)>t 0 t1 0 +n?1 The logic MITL [AFH96] is based on an in nite set of modalities until I where I is a non-singular interval with integer endpoints - these modalities are called constrained until modalities. The MLO1 truth table for example for the formula X until[5;8) Y is 9t:t0 + 5 t < t0 + 8 ^ Y (t) ^ (8t0 : t0 < t0 < t!X (t0)). It is shown in [AFH96] that the operators like our 31 are de nable in this logic. Unfortunately the fundamental dual operator }-1 is not discussed there and in fact we can show that it cannot be expressed using this set of modalities. What is called MITL in [HRS98] is the logic based on untilI operators and the dual since operators sinceI . The modality }-1 is easily expressed using these since operators. In the sequel we we will refer only to the version with both until and since operators. (h) until(n;n+m) can be de ned as P until(n;n+m) Q 2(0;n] (P ^ (P until Q)) ^ 3(n;m)Q. Similar de nitions work for since and for half open or closed intervals. Hence, MITL and QTL are expressive equivalent.
5 Decidability We want to show that there is an algorithm which given a formula '(Z ) of QTL determines if ' is valid in hR+ ; 0; 0 there is an open interval (t1 ; t0) where either Yi persists or :Yi persists". Di;j : \If at t0 Yi holds and if at t0 Xj persists already for at least as long as Xi then Yj holds in an interval (t; t0 ] for some t < t0 ." The formula Timer of QMLO and the formula Timer of MLO are related by the following main Lemma:
Lemma 5 (Reduction of Quantitative Properties to Pure Monadic Properties) The pred-
icates P1 Pn Q1; : : :Qn over hR+ ; 0;