2012 ACM Subject Classification Theory of computation → \to → Logic and verification
© Author: Please provide a copyright holder; licensed under Creative Commons License CC-BY 4.0
Leibniz International Proceedings in Informatics
Schloss Dagstuhl — Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany
Digital Object Identifier 10.4230/LIPIcs...
Funding This work has received support from the ANR project ERVoRS (ANR-25-CE48-6220).
Introduction
Runtime Verification (RV) is a lightweight formal verification technique [39 , 14 ] , where the system at hand is instrumented with monitors [27 , 28 ] . Each monitor M M M is a software component that corresponds to a logical formula ϕ \phi ϕ expressing some property of interest. At runtime, M M M incrementally analyses the execution of the system until it reaches a verdict w.r.t. the satisfaction or violation of ϕ \phi ϕ [39 , 2 ] . RV can mitigate two major drawbacks of exhaustive, offline techniques such as model checking. First, by trading exhaustiveness for scalability, RV does not suffer from the well-known state-space explosion problem. Second, provided that actions of interest are visible for instrumentation purposes, RV is suitable for systems where no model is known beforehand [26 ] , e.g., black-box and self-adaptive systems [42 ] .
Due to the lack of exhaustiveness, the delineation between the properties that can be handled by RV and those that cannot, i.e., the monitorability problem , becomes a central issue [49 , 14 , 3 , 10 , 31 ] . Intuitively, a formula ϕ \phi ϕ is monitorable iff its violation or satisfaction can be detected by a monitor. Consider for instance the following property:
“every request is eventually followed by a grant ”
The above classical “leads to” property can be formalised in e.g., LTL, and there exists algorithms to model-check it offline [40 , 19 , 57 ] ; it is however not monitorable . Indeed, any satisfaction verdict after a grant may be contradicted by a future request not followed by a grant (and dually, any violation verdict after a request may be contradicted by a future grant ). In technical terms, a formula ϕ \phi ϕ , expressing some property of interest, is said to be satisfaction (resp. violation) monitorable iff there exists a monitor for ϕ \phi ϕ that is both sound and satisfaction (resp. violation) complete [2 , 26 ] (other definitions of monitorability will be discussed in § 8 ). Formula ϕ \phi ϕ is said monitorable iff it is satisfaction or violation monitorable, and complete monitorable iff it is both satisfaction and violation monitorable. The monitorability problem is thus concerned with determining the largest monitorable subset of a given logic L L L .
The monitorability problem has been studied for the modal μ \mu μ -calculus, also known as the Hennessy-Milner Logic with recursion (μ \mu μ -HML) [37 , 38 ] . Notably, the maximally-expressive monitorable subset of μ \mu μ -HML, i.e., a subset within which any monitorable formula in μ \mu μ -HML is expressible, has been identified for both linear-time and branching-time semantics [2 , 26 ] . However, μ \mu μ -HML is untimed, and thus cannot express timed properties such as the following bounded response property
“every request is eventually followed by a grant within 5 time units”
Timed properties are extremely important in real-time systems, ubiquitous nowadays (see e.g., [44 , 23 ] ). There is therefore an urgent need to tackle the monitorability problem for timed logics. Even though the body of research on RV for timed systems is extensive (more in § 8 ), there was, until very recently, no work that studied monitorability in a timed setting.
In 2025, the first works around timed monitorability emerged throughout two consecutive papers. The earlier one is ours [10 ] , where we solved the monitorability problem for an expressive timed logic that we proposed, namely T l i n T^{\mathrm{lin}} T lin . The present paper is an extension of [10 ] (see below). The later one [31 ] , providing decidability results on monitorability of ω \omega ω timed regular languages, will be discussed § 8 .
Contributions.
This paper is an extension of [10 ] which enclosed the following contributions. First, we propose T l i n T^{lin} T l in , a new1 timed μ \mu μ -calculus with a linear-time interpretation, i.e., the semantics of a formula in T l i n T^{lin} T l in is defined as a set of infinite timed executions that satisfy it. In particular, we prove that T l i n T^{lin} T l in is strictly more expressive than MTL. Second, we develop a rich monitoring language called Mon, and solve the monitorability problem for T l i n T^{lin} T l in within Mon and under the assumption of reactivity of monitors. We precisely identify V T l i n VT^{lin} V T l in , S T l i n ST^{lin} S T l in and C T l i n CT^{lin} C T l in , the largest fragments (i.e., maximally-expressive subsets) of T l i n T^{lin} T l in that are violation monitorable, satisfaction monitorable and complete monitorable, respectively, and accordingly conclude that M T l i n = V T l i n ∪ S T l i n MT^{lin} = VT^{lin} \cup ST^{lin} M T l in = V T l in ∪ S T l in is the largest monitorable fragment of T l i n T^{lin} T l in . For practical reasons, we also provide automatic translators (i) from MTL to T l i n T^{lin} T l in and (ii) from T l i n T^{lin} T l in to Mon.
In addition to the above contributions of [10 ] , this extension comprises the following new results:
Section 3.2 is new. In it, we prove that T l i n T^{lin} T l in is closed under complement using a fully syntactic complementation procedure. This is necessary to handle negation in the new translation from MTL to T l i n T^{lin} T l in (see below).
Section 3.3 is completely revised and substantially extended:
We completely revise our compiler from MTL to T l i n T^{lin} T l in (§ 3.5.1 ). We show that the syntax of MTL in [10 ] , proposed in negative normal form was incomplete, leading to a semantics that cannot capture the negation of Until formulae (Remark 2.11 ). To demonstrate that this under-characterisation does not impair the expressiveness results, i.e., the containment of MTL in T l i n T^{lin} T l in , we fall back on the standard syntax of MTL with the strict Until operator and negation over arbitrary formulae (§ 2.4.1 ) and develop a new compiler thereof from MTL to T l i n T^{lin} T l in that we prove correct.
We show that T l i n T^{lin} T l in does not only embed MTL, but also the more expressive TPTL, and provide accordingly an automatic compiler from TPTL to T l i n T^{lin} T l in that we prove correct (§ 3.5.2 ).
We demonstrate that T l i n T^{lin} T l in is strictly more expressive than TPTL and therefore strictly more expressive than MTL (§ 3.5.3 ), establishing therefore a strict expressiveness hierarchy between the three logics (Figure 8 ).
In the new § 4.6 , we generalise the monitorability results of T l i n T^{lin} T l in to a more flexible monitoring framework, where monitors do not have to be reactive by design, and therefore extend our maximality results to arbitrary monitors in Mon.
In the new Section 6 and Section 7, we use T l i n T^{lin} T l in and the machinery around it (compilations from MTL and TPTL to T l i n T^{lin} T l in , and from T l i n T^{lin} T l in to Mon) as a unified framework to generalise the monitorability results to both MTL and TPTL. In particular, we show that the depth of formulae in MTL does not impact the monitorability within the identified fragments. More precisely, every MTL formula ϕ \phi ϕ is satisfaction (resp. violation) monitorable as long as every unconstrained Until sub-formula of ϕ \phi ϕ is in the scope of an even (resp. odd) number of negations.
Figure 8. Expressiveness of T l i n T^{lin} T l in
Section 8 is substantially extended to include a comparison with [31 ] , a very recent work on monitorability that appeared after the publication of [10 ] . To the best of our knowledge, this is the first complete work on timed monitorability of prominent linear-time timed logics within a unified framework.
Outline.
The rest of this paper is organised as follows. After overviewing the preliminaries in § 2 , we discuss our core contribution in Section 3 through § 7 . Section 3 defines our logic T l i n T^{lin} T l in and proves that it is more expressive than MTL (resp. TPTL), providing along the way an automatic translation from MTL (resp. TPTL) to T l i n T^{lin} T l in . In § 4 , we lay out our theoretical foundations for timed monitors and instrumentation. We then tackle the monitorability problem of T l i n T^{lin} T l in in Section 5. In § 6 , we identify important fragments of MTL with violation-, satisfaction- and complete-monitorable formulae. In § 7 , we identify analogously monitorable fragments of TPTL. § 8 compares our contributions with related work and § 9 wraps up with concluding remarks and future work directions.
Proofs. In order to avoid redundancy, only the proofs related to new contributions w.r.t. [10 ] are enclosed in the present paper. The locations of the remaining proofs within [10 ] are referred to whenever needed throughout the remainder of this paper.
Preliminaries
In this section, we introduce preliminary notions on TLTSs and timed temporal logics (MTL and TPTL). All definitions are action based , i.e., rely on the actions a system under scrutiny may perform [39 ] . In the remainder of this paper, we denote by A c t \mathrm{Act} Act a non-empty, finite set of such actions.
Timed Labelled Transition Systems
The following definition is inspired from [1 ] .
Definition 2.1. A Timed Labelled Transition System (TLTS) P P P over A c t \mathrm{Act} Act is a tuple ⟨ S P , L a b , → P ⟩ \langle S_P,\mathrm{Lab},\mathrel{\to_P}\rangle ⟨ S P , Lab , → P ⟩ where S P S_P S P is a set of states, L a b = A c t ∪ R ≥ 0 ∪ { τ } \mathrm{Lab}=\mathrm{Act}\cup\mathbb{R}_{\ge0}\cup\{\tau\} Lab = Act ∪ R ≥ 0 ∪ { τ } a set of labels, and → P ⊆ S P × L a b × S P \mathrel{\to_P}\subseteq S_P\times\mathrm{Lab}\times S_P → P ⊆ S P × Lab × S P the transition relation satisfying:
Time determinism: for every p , p ′ , p ′ ′ ∈ S P p,p',p''\in S_P p , p ′ , p ′′ ∈ S P and d ∈ R ≥ 0 d\in\mathbb{R}_{\ge0} d ∈ R ≥ 0 , if ( p , d , p ′ ) ∈ → P (p,d,p')\in\mathrel{\to_P} ( p , d , p ′ ) ∈ → P and ( p , d , p ′ ′ ) ∈ → P (p,d,p'')\in\mathrel{\to_P} ( p , d , p ′′ ) ∈ → P then p ′ = p ′ ′ p'=p'' p ′ = p ′′ ,
Time additivity: for every p , p ′ ′ ∈ S P p,p''\in S_P p , p ′′ ∈ S P and d 1 , d 2 ∈ R ≥ 0 d_1,d_2\in\mathbb{R}_{\ge0} d 1 , d 2 ∈ R ≥ 0 , ( p , d 1 + d 2 , p ′ ′ ) ∈ → P (p,d_1+d_2,p'')\in\mathrel{\to_P} ( p , d 1 + d 2 , p ′′ ) ∈ → P iff ( p , d 1 , p ′ ) ∈ → P (p,d_1,p')\in\mathrel{\to_P} ( p , d 1 , p ′ ) ∈ → P and ( p ′ , d 2 , p ′ ′ ) ∈ → P (p',d_2,p'')\in\mathrel{\to_P} ( p ′ , d 2 , p ′′ ) ∈ → P from some p ′ ∈ S P p'\in S_P p ′ ∈ S P ,
Zero delay: for every p , p ′ ∈ S P p,p'\in S_P p , p ′ ∈ S P , ( p , 0 , p ′ ) ∈ → P (p,0,p')\in\mathrel{\to_P} ( p , 0 , p ′ ) ∈ → P iff p ′ = p p'=p p ′ = p .
A transition labelled α ∈ A c t \alpha\in\mathrm{Act} α ∈ Act (resp. α ∈ R ≥ 0 \alpha\in\mathbb{R}_{\ge0} α ∈ R ≥ 0 ) is a called an action transition (resp. delay transition ). A τ \tau τ transition is a non-observable transition labelled with the special symbol τ \tau τ . We use a , a i , b , c a,a_i,b,c a , a i , b , c and d , d i d,d_i d , d i to denote, respectively, an element of A c t \mathrm{Act} Act and R ≥ 0 \mathbb{R}_{\ge0} R ≥ 0 . We recall that A c t \mathrm{Act} Act is finite. In the following, we write p 1 → α 1 p 2 → α 2 p 3 … p_1\xrightarrow{\alpha_1}p_2\xrightarrow{\alpha_2}p_3\ldots p 1 α 1 p 2 α 2 p 3 … to denote a sequence of transitions with ( p 1 , α 1 , p 2 ) , ( p 2 , α 2 , p 3 ) … ∈ → P (p_1,\alpha_1,p_2),(p_2,\alpha_2,p_3)\ldots\in\mathrel{\to_P} ( p 1 , α 1 , p 2 ) , ( p 2 , α 2 , p 3 ) … ∈ → P .
Runs.
A run in the TLTS P P P is a sequence of labels (in L a b ω ∪ L a b ∗ = L a b ∞ \mathrm{Lab}^{\omega} \cup\mathrm{Lab}^{*} = \mathrm{Lab}^{\infty} Lab ω ∪ Lab ∗ = Lab ∞ ) corresponding to a sequence of transitions. For example, if p 1 → α 1 p 2 → α 2 p 3 p_{1} \xrightarrow{\alpha_{1}} p_{2} \xrightarrow{\alpha_{2}} p_{3} p 1 α 1 p 2 α 2 p 3 then θ = α 1 α 2 ∈ L a b ∗ \theta= \alpha_{1}\alpha_{2} \in\mathrm{Lab}^{*} θ = α 1 α 2 ∈ Lab ∗ is a finite run feasible from p 1 p_{1} p 1 . If there exists an infinite transition sequence p 1 → α 1 p 2 → α 2 p 3 → α 3 … p_{1} \xrightarrow{\alpha_{1}} p_{2} \xrightarrow{\alpha_{2}} p_{3} \xrightarrow{\alpha_{3}} \ldots p 1 α 1 p 2 α 2 p 3 α 3 … , we say that run θ = α 1 α 2 α 3 … ∈ L a b ω \theta= \alpha_{1}\alpha_{2}\alpha_{3}\ldots\in\mathrm{Lab}^{\omega} θ = α 1 α 2 α 3 … ∈ Lab ω is infinite from p 1 ∈ S P p_{1} \in S_{P} p 1 ∈ S P .
Weak runs.
Let L = L a b ∖ { τ } \mathcal{L} = \mathrm{Lab} \setminus\{\tau\} L = Lab ∖ { τ } . To define weak transitions, we write p ⟶ p ′ p \longrightarrow p' p ⟶ p ′ instead of p ( → τ ) ∗ p ′ p \left(\xrightarrow{\tau}\right)^{*} p' p ( τ ) ∗ p ′ which is the reflexive-transitive closure of the relation → τ \xrightarrow{\tau} τ , and following [58 ] , we write p → α p ′ p \xrightarrow{\alpha} p' p α p ′ for α ∈ L \alpha\in\mathcal{L} α ∈ L in the following cases,
(a) p → a p ′ p \xrightarrow{a} p' p a p ′ if p ⟶ ⋅ → a ⋅ ⟶ p ′ p \longrightarrow\mathord{\cdot} \xrightarrow{a} \mathord{\cdot} \longrightarrow p' p ⟶ ⋅ a ⋅ ⟶ p ′ ,
(b) p → d p ′ p \xrightarrow{d} p' p d p ′ if there exists n ≥ 0 n \ge0 n ≥ 0 s.t. p ⟶ ⋅ → d 0 ⋅ ⟶ ⋅ → d 1 ⋅ … → d n ⋅ ⟶ p ′ p \longrightarrow\mathord{\cdot} \xrightarrow{d_{0}} \mathord{\cdot} \longrightarrow\mathord{\cdot} \xrightarrow{d_{1}} \mathord{\cdot} \ldots\xrightarrow{d_{n}} \mathord{\cdot} \longrightarrow p' p ⟶ ⋅ d 0 ⋅ ⟶ ⋅ d 1 ⋅ … d n ⋅ ⟶ p ′ where d = ∑ i ≤ n d i d = \sum_{i \le n} d_{i} d = ∑ i ≤ n d i ,
with the convention that if the set d 1 , … , d n d_{1}, \ldots, d_{n} d 1 , … , d n is empty, then ∑ 1 ≤ i ≤ n d i = 0 \sum_{1 \le i \le n} d_{i} = 0 ∑ 1 ≤ i ≤ n d i = 0 . Following [26 ] , for α 1 , … , α n ∈ L \alpha_{1}, \ldots, \alpha_{n} \in\mathcal{L} α 1 , … , α n ∈ L and p , p ′ ∈ S P p,p' \in S_{P} p , p ′ ∈ S P , we write sequences of transitions p → α 1 … → α n p ′ p \xrightarrow{\alpha_{1}} \ldots\xrightarrow{\alpha_{n}} p' p α 1 … α n p ′ as p → θ p ′ p \xrightarrow{\theta} p' p θ p ′ where θ = α 1 … α n \theta= \alpha_{1} \ldots\alpha_{n} θ = α 1 … α n . Such θ \theta θ is a finite weak run (in L ∗ \mathcal{L}^{*} L ∗ ). We say that a finite weak run θ ′ ∈ L ∗ \theta' \in\mathcal{L}^{*} θ ′ ∈ L ∗ corresponds to a finite run θ ∈ L a b ∗ \theta\in\mathrm{Lab}^{*} θ ∈ Lab ∗ iff removing τ \tau τ transitions then summing consecutive delays in θ \theta θ gives θ ′ \theta' θ ′ . For instance, the finite weak run 5 a 3 b 2 5\,a\,3\,b\,2 5 a 3 b 2 corresponds to e.g., finite runs 2 τ 3 a 3 b τ 2 2\,\tau\,3\,a\,3\,b\,\tau\,2 2 τ 3 a 3 b τ 2 and 5 a 3 b 1 τ 1 5\,a\,3\,b\,1\,\tau\,1 5 a 3 b 1 τ 1 . The empty weak run is ϵ = 0 \epsilon= 0 ϵ = 0 .
Reachability and inevitability.
In TLTS P P P , a state p ′ ∈ S P p' \in S_{P} p ′ ∈ S P is reachable from state p ∈ S P p \in S_{P} p ∈ S P along a finite weak run θ ∈ L ∗ \theta\in\mathcal{L}^{*} θ ∈ L ∗ iff p → θ p ′ p \xrightarrow{\theta} p' p θ p ′ . We say that p ′ p' p ′ is inevitably reachable from p p p along θ \theta θ , denoted p → θ i n e v p ′ p \xrightarrow{\theta}_{\mathrm{inev}} p' p θ inev p ′ , if p ′ p' p ′ is the only reachable state from p p p along θ \theta θ , that is:
p → θ p ′ and ∀ p ′ ′ ∈ S P : p → θ p ′ ′ implies p ′ = p ′ ′ p \xrightarrow{\theta} p' \text{ and } \forall p'' \in S_{P}: p \xrightarrow{\theta} p'' \text{ implies } p' = p'' p θ p ′ and ∀ p ′′ ∈ S P : p θ p ′′ implies p ′ = p ′′
Similarly, we write p → θ p ′ p \xrightarrow{\theta} p' p θ p ′ if p ′ p' p ′ is not reachable from p p p along θ \theta θ , p → θ p \xrightarrow{\theta} p θ if there exists a state p ′ p' p ′ reachable from p p p along θ \theta θ , and p → θ p \xrightarrow{\theta} p θ if there is no reachable state from p p p along θ \theta θ .
Timed Words
As in e.g., [16 , 32 ] , we interpret timed logics over infinite timed words.
Definition 2.2 (Timed words). A timed word π \pi π over A c t \mathrm{Act} Act is a possibly infinite sequence ( a 1 , t 1 ) ( a 2 , t 2 ) … (a_{1},t_{1})(a_{2},t_{2})\ldots ( a 1 , t 1 ) ( a 2 , t 2 ) … of timed events ( a i , t i ) ∈ A c t × R ≥ 0 (a_{i},t_{i}) \in\mathrm{Act} \times\mathbb{R}_{\ge0} ( a i , t i ) ∈ Act × R ≥ 0 , where t i t_{i} t i are monotonically non-decreasing timestamps, i.e., ∀ i ∈ N : t i ≤ t i + 1 \forall i \in\mathbb{N}: t_{i} \le t_{i+1} ∀ i ∈ N : t i ≤ t i + 1 . An empty timed word contains no timed events.
We denote A c t ω \mathrm{Act}^{\omega} Act ω and A c t ∗ \mathrm{Act}^{*} Act ∗ the set of infinite (omega) and finite timed words, respectively, and A c t ∞ \mathrm{Act}^{\infty} Act ∞ the set of all timed words (A c t ∞ = A c t ω ∪ A c t ∗ \mathrm{Act}^{\infty} = \mathrm{Act}^{\omega} \cup\mathrm{Act}^{*} Act ∞ = Act ω ∪ Act ∗ ). We denote by ∣ π ∣ |\pi| ∣ π ∣ the length of a timed word π ∈ A c t ∞ \pi\in\mathrm{Act}^{\infty} π ∈ Act ∞ . The length of a finite timed word π = ( a 1 , t 1 ) … ( a n , t n ) ∈ A c t ∗ \pi= (a_{1},t_{1})\ldots(a_{n},t_{n}) \in\mathrm{Act}^{*} π = ( a 1 , t 1 ) … ( a n , t n ) ∈ Act ∗ equals n n n . The length of an infinite timed word π ∈ A c t ω \pi\in\mathrm{Act}^{\omega} π ∈ Act ω equals ω \omega ω . We use the notation a i ( π ) a_{i}(\pi) a i ( π ) (resp. t i ( π ) t_{i}(\pi) t i ( π ) ) for the action (resp. the timestamp) of the timed event at position i i i of π ∈ A c t ∞ \pi\in\mathrm{Act}^{\infty} π ∈ Act ∞ , with i ∈ N i \in\mathbb{N} i ∈ N and i ≤ ∣ π ∣ i \le|\pi| i ≤ ∣ π ∣ . For a timed event ( a i , t i ) (a_{i},t_{i}) ( a i , t i ) , we say that t i t_i t i is associated with a i a_i a i . The equality between two timed words π , π ′ ∈ T A c t ∞ \pi, \pi' \in\mathrm{TAct}^{\infty} π , π ′ ∈ TAct ∞ is defined in the standard manner:
∣ π ∣ = ∣ π ′ ∣ ∧ ∀ i ∈ N : i ≤ ∣ π ∣ ⟹ ( a i ( π ) = a i ( π ′ ) ∧ t i ( π ) = t i ( π ′ ) ) |\pi| = |\pi'| \land\forall i \in\mathbb{N} : i \leq|\pi| \Longrightarrow\left(a_i(\pi) = a_i(\pi') \land t_i(\pi) = t_i(\pi')\right) ∣ π ∣ = ∣ π ′ ∣ ∧ ∀ i ∈ N : i ≤ ∣ π ∣ ⟹ ( a i ( π ) = a i ( π ′ ) ∧ t i ( π ) = t i ( π ′ ) )
For some π ∈ T A c t ∞ \pi\in\mathrm{TAct}^{\infty} π ∈ TAct ∞ , we write π i \pi^i π i (resp. i π {}^{i}\pi i π ), i ≤ ∣ π ∣ i \leq|\pi| i ≤ ∣ π ∣ , for the suffix of π \pi π starting at position i i i (resp. the prefix of π \pi π ending at i i i ). The partial function C o n c a t : T A c t ∗ × T A c t ∞ ⇀ T A c t ∞ \mathit{Concat} : \mathrm{TAct}^{*} \times\mathrm{TAct}^{\infty} \rightharpoonup\mathrm{TAct}^{\infty} Concat : TAct ∗ × TAct ∞ ⇀ TAct ∞ returns, for a finite timed word π \pi π and a timed word π ′ \pi' π ′ , the timed word corresponding to π \pi π concatenated with π ′ \pi' π ′ (i.e., π ′ \pi' π ′ appended at the tail of π \pi π ). C o n c a t \mathit{Concat} Concat is defined only for couples ( π , π ′ ) ∈ T A c t ∗ × T A c t ∞ (\pi,\pi') \in\mathrm{TAct}^{*} \times\mathrm{TAct}^{\infty} ( π , π ′ ) ∈ TAct ∗ × TAct ∞ where the first timestamp of π ′ \pi' π ′ is larger than the last timestamp of π \pi π (otherwise timestamp monotonicity is violated). Let T A c t π ∞ \mathrm{TAct}_{\pi}^{\infty} TAct π ∞ be the set defined as follows, w.r.t. to some finite timed word π \pi π :
T A c t π ∞ = { π ′ ∈ T A c t ∞ ∣ t 1 ( π ′ ) ≥ t ∣ π ∣ ( π ) } \mathrm{TAct}_{\pi}^{\infty} = \{\pi' \in\mathrm{TAct}^{\infty} \mid t_1(\pi') \geq t_{|\pi|}(\pi)\} TAct π ∞ = { π ′ ∈ TAct ∞ ∣ t 1 ( π ′ ) ≥ t ∣ π ∣ ( π )}
Accordingly, C o n c a t ( π , π ′ ) \mathit{Concat}(\pi,\pi') Concat ( π , π ′ ) is defined iff π ′ ∈ T A c t π ∞ \pi' \in\mathrm{TAct}_{\pi}^{\infty} π ′ ∈ TAct π ∞ . We use the shorthand notation π . π ′ \pi.\pi' π . π ′ instead of C o n c a t ( π , π ′ ) \mathit{Concat}(\pi,\pi') Concat ( π , π ′ ) . For any timed word π ′ ∈ T A c t ∞ \pi' \in\mathrm{TAct}^{\infty} π ′ ∈ TAct ∞ , we define the set of its prefixes:
P f ( π ′ ) = { π ∈ T A c t ∗ ∣ ∃ π ′ ′ ∈ T A c t π ∞ : π . π ′ ′ = π ′ } \mathit{Pf}(\pi') = \{\pi\in\mathrm{TAct}^{*} \mid\exists\pi'' \in\mathrm{TAct}_{\pi}^{\infty} : \pi.\pi'' = \pi'\} Pf ( π ′ ) = { π ∈ TAct ∗ ∣ ∃ π ′′ ∈ TAct π ∞ : π . π ′′ = π ′ }
Dually, we define for any finite timed word π ′ ∈ T A c t ∗ \pi' \in\mathrm{TAct}^{*} π ′ ∈ TAct ∗ its infinite extensions, i.e., the set of all infinite timed words resulting from concatenating π ′ \pi' π ′ with an infinite timed word:
E x t ( π ′ ) = { π ∈ T A c t ω ∣ π ′ ∈ P f ( π ) } \mathit{Ext}(\pi') = \{\pi\in\mathrm{TAct}^{\omega} \mid\pi' \in\mathit{Pf}(\pi)\} Ext ( π ′ ) = { π ∈ TAct ω ∣ π ′ ∈ Pf ( π )}
Note that a timed word corresponds necessarily to a weak run in L ∗ L^{*} L ∗ , with each timestamp recording the absolute time of occurrence of the action associated with it. For example, the finite timed word ( a , 0 ) ( b , 3 ) ( a , 3 ) ( c , 7.2 ) (a,0)(b,3)(a,3)(c,7.2) ( a , 0 ) ( b , 3 ) ( a , 3 ) ( c , 7.2 ) results from the finite weak run a 3 b a 4.2 c a\ 3\ b\ a\ 4.2\ c a 3 b a 4.2 c . We will formalise the function to retrieve a finite weak run from a finite timed word in § 5.1 .
Remark 2.3. Note that, in the timed systems literature, every execution in a TLTS corresponds to an infinite time divergent run/timed word (see e.g., [33, 9]), i.e., all runs/timed words diverge in time in the future. We do not make this assumption here since our results up to and including § 4 do not depend on it. Instead, we formalise, justify and enforce it in § 5.1 for monitorability purposes.
Intervals
We now define I \mathbb{I} I , the set of dense-time intervals with natural left bounds and natural or infinite right bounds. Hereafter, we refer to an element of I \mathbb{I} I simply as “interval”.
Definition 2.4 (Interval syntax). The set I \mathbb{I} I is given by the following grammar:
I ∈ I : : = ⟨ l , u ⟩ I \in\mathbb{I} \mathrel{::=} \langle l,u\rangle I ∈ I ::= ⟨ l , u ⟩ where ⟨ ∈ { [ , ( } \langle\in\{[,(\} ⟨ ∈ {[ , ( } , ⟩ ∈ { ] , ) } \rangle\in\{],)\} ⟩ ∈ { ] , )} , l ∈ N l \in\mathbb{N} l ∈ N and u ∈ N ∪ { ∞ } u \in\mathbb{N} \cup\{\infty\} u ∈ N ∪ { ∞ } . As per standard notation, we require that ⟩ = ) \rangle= ) ⟩ = ) if u = ∞ u = \infty u = ∞ . l l l (resp. u u u ) is called the left (resp. right) bound of I I I , we write accordingly L B ( I ) = l \mathit{LB}(I) = l LB ( I ) = l (resp. R B ( I ) = u \mathit{RB}(I) = u RB ( I ) = u ). I I I is said left closed iff ⟨ = [ \langle= [ ⟨ = [ , right closed iff ⟩ = ] \rangle= ] ⟩ = ] , and bounded iff R B ( I ) ≠ ∞ \mathit{RB}(I) \ne\infty RB ( I ) = ∞ .
Definition 2.5 (Interval Semantics). ⟦ I ⟧ \llbracket I \rrbracket [ [ I ] ] , the meaning of an interval I ∈ I I \in\mathbb{I} I ∈ I , is a convex subset of R ≥ 0 \mathbb{R}_{\geq0} R ≥ 0 :
⟦ I ⟧ = { x ∈ R ≥ 0 ∣ L B ( I ) ≺ 1 x ≺ 2 R B ( I ) } \llbracket I \rrbracket= \{x \in\mathbb{R}_{\geq0} \mid\mathit{LB}(I) \mathrel{\prec_1} x \mathrel{\prec_2} \mathit{RB}(I)\} [ [ I ] ] = { x ∈ R ≥ 0 ∣ LB ( I ) ≺ 1 x ≺ 2 RB ( I )} where
φ , ψ : = ⊤ ∣ ⊥ ∣ a ∣ ¬ φ ∣ φ ∧ ψ ∣ φ U I ψ \varphi,\psi:= \top\mid\bot\mid a \mid\neg\varphi\mid\varphi\land\psi\mid\varphi U_I \psi φ , ψ := ⊤ ∣ ⊥ ∣ a ∣ ¬ φ ∣ φ ∧ ψ ∣ φ U I ψ
≺ I = ≤ \prec_I = \leq ≺ I =≤ if I I I is left closed and ≺ I = < \prec_I = < ≺ I =< otherwise,
⪯ I = ≤ \preceq_I = \leq ⪯ I =≤ if I I I is right closed and ≺ I = < \prec_I = < ≺ I =< otherwise.
Since we are mostly interested in the set of non-empty intervals, we let I = { I ∈ I ∣ ⟦ I ⟧ ≠ ∅ } \mathcal{I} = \{I \in\mathbb{I} \mid\llbracket I \rrbracket\ne\emptyset\} I = { I ∈ I ∣ [ [ I ] ] = ∅ } denote such set (syntactically, I \mathcal{I} I contains all elements of I \mathbb{I} I excluding those of the form ( l , l ) (l,l) ( l , l ) , ( l , l ] (l,l] ( l , l ] and [ l , l ) [l,l) [ l , l ) ). Hereafter, as by standard notation, we use I I I to denote both the syntax and semantics of interval I I I .
For convenience, we define the left complement of an arbitrary non-empty interval. Intuitively, the left complement of some interval I ∈ I I \in\mathcal{I} I ∈ I covers fully and exactly the interval to the left of I I I . For instance, if I = ( 1 , 5 ] I = (1,5] I = ( 1 , 5 ] then its left complement should be [ 0 , 1 ] [0,1] [ 0 , 1 ] .
Definition 2.6 (Left complement of a non-empty interval). Let I ∅ I_{\emptyset} I ∅ denote the empty interval [ 0 , 0 ) [0,0) [ 0 , 0 ) . The left complement of I I I , denoted I ← \overleftarrow{I} I , is defined over I ∪ I ∅ \mathcal{I} \cup I_{\emptyset} I ∪ I ∅ as I ← = [ 0 , LB ( I ) ) \overleftarrow{I} = [0,\operatorname{LB}(I)) I = [ 0 , LB ( I )) if I I I is left closed and I ← = [ 0 , LB ( I ) ] \overleftarrow{I} = [0,\operatorname{LB}(I)] I = [ 0 , LB ( I )] otherwise.
Example 2.7. [ 0 , 2 ) ← = [ 0 , ∞ ) ← = I ∅ \overleftarrow{[0,2)} = \overleftarrow{[0,\infty)} = I_{\emptyset} [ 0 , 2 ) = [ 0 , ∞ ) = I ∅ , ( 6 , 8 ) ← = [ 0 , 6 ] \overleftarrow{(6,8)} = [0,6] ( 6 , 8 ) = [ 0 , 6 ] , [ 3 , ∞ ) ← = [ 0 , 3 ) \overleftarrow{[3,\infty)} = [0,3) [ 3 , ∞ ) = [ 0 , 3 ) .
Remark 2.8. As a consequence of Definition 2.5 and Definition 2.6, we have for any x ∈ R ≥ 0 x \in\mathbb{R}_{\geq0} x ∈ R ≥ 0 and I ∈ I I \in\mathcal{I} I ∈ I , x ∈ I x \in I x ∈ I iff x x x does not satisfy x ≺ I ← RB ( I ← ) x \prec_{\overleftarrow{I}} \operatorname{RB}(\overleftarrow{I}) x ≺ I RB ( I ) and satisfies x ≺ I RB ( I ) x \prec_I \operatorname{RB}(I) x ≺ I RB ( I ) .
Timed Temporal Logics
We now introduce two prominent timed extensions of the well-known Linear-time Temporal Logic (LTL), namely Metric Temporal Logic (MTL) and Timed Propositional Temporal Logic (TPTL).
Metric Temporal Logic (MTL)
MTL [36 ] is a well-known timed logic with linear-time semantics; it is the de facto timed extension of LTL. Note that we consider future MTL (without past operators), which we refer to, following e.g., [17 , 50 ] , simply as MTL.
Syntax and Semantics.
The standard (minimal) syntax of MTL, used classically in the literature, features one timed operator, namely the strict Until [17 , 47 , 45 , 25 ] . In Figure 1 , we provide such syntax extended with ⊤ \top ⊤ and ⊥ \bot ⊥ . The latter are added for convenience, in particular when reasoning about monitorability of MTL (§ 6 ).
Figure 1. MTL syntax.
The point-wise semantics of MTL is given by the truth value of π , i ⊨ φ \pi,i \models\varphi π , i ⊨ φ , denoting “π ∈ T A c t ω \pi\in\mathrm{TAct}^{\omega} π ∈ TAct ω satisfies formula φ \varphi φ at position i i i ”, with the convention that if π , 1 ⊨ φ \pi,1 \models\varphi π , 1 ⊨ φ , then π \pi π is said to satisfy φ \varphi φ . Here, we define the semantics of a formula as the set of all infinite timed words that satisfy it (Figure 2 ), relying on the definitions given in [17 , 47 , 45 , 25 ] . Note that ⊥ \bot ⊥ and ⊤ \top ⊤ are equivalent to, respectively, a ∧ ¬ a a \land\neg a a ∧ ¬ a and ¬ ⊥ \neg\bot ¬⊥ . Syntactic sugar is defined as usual: φ ∨ ψ ≡ ¬ ( ¬ φ ∧ ¬ ψ ) \varphi\lor\psi\equiv\neg(\neg\varphi\land\neg\psi) φ ∨ ψ ≡ ¬ ( ¬ φ ∧ ¬ ψ ) ( φ \varphi φ or ψ \psi ψ ), ◯ I φ ≡ ⊥ U I φ \bigcirc_{I}\varphi\equiv\bot\mathbin{U_{I}}\varphi ◯ I φ ≡ ⊥ U I φ (Next φ \varphi φ ), ◊ I φ ≡ ⊤ U I φ \Diamond_{I}\varphi\equiv\top\mathbin{U_{I}}\varphi ◊ I φ ≡ ⊤ U I φ (Finally φ \varphi φ ) and □ I φ ≡ ¬ ◊ I ¬ φ \Box_{I}\varphi\equiv\neg\Diamond_{I}\neg\varphi □ I φ ≡ ¬ ◊ I ¬ φ (Globally φ \varphi φ ).
Figure 2. MTL semantics.
The non-strict Until operator U I ≤ U^{\leq}_{I} U I ≤ , which has arguably a more “natural” semantics
⟦ φ U I ≤ ψ ⟧ = { π ∣ ∃ i ≥ 1 : t i ( π ) − t 1 ( π ) ∈ I and π i ∈ ⟦ ψ ⟧ and ∀ 1 ≤ j < i : π j ∈ ⟦ φ ⟧ } \llbracket\varphi U^{\leq}_{I}\psi\rrbracket= \{\pi\mid\exists i \geq1 : t_i(\pi)-t_1(\pi) \in I \text{ and } \pi^i \in\llbracket\psi\rrbracket\text{ and } \forall1 \leq j < i : \pi^j \in\llbracket\varphi\rrbracket\} [ [ φ U I ≤ ψ ] ] = { π ∣ ∃ i ≥ 1 : t i ( π ) − t 1 ( π ) ∈ I and π i ∈ [ [ ψ ] ] and ∀1 ≤ j < i : π j ∈ [ [ φ ] ] }
is expressible in terms of the strict Until: φ U I ≤ ψ ≡ ψ ∨ ( φ ∧ ( φ U I ψ ) ) \varphi U^{\leq}_{I}\psi\equiv\psi\lor(\varphi\land(\varphi U_{I}\psi)) φ U I ≤ ψ ≡ ψ ∨ ( φ ∧ ( φ U I ψ )) if I I I is left closed at 0 and φ U I ≤ ψ ≡ φ ∧ ( φ U I ψ ) \varphi U^{\leq}_{I}\psi\equiv\varphi\land(\varphi U_{I}\psi) φ U I ≤ ψ ≡ φ ∧ ( φ U I ψ ) otherwise [30 ] . The non-strict globally and eventually operators are then defined analogously to the strict ones, respectively ◊ I ≤ φ ≡ ⊤ U I ≤ φ \Diamond^{\leq}_{I}\varphi\equiv\top U^{\leq}_{I}\varphi ◊ I ≤ φ ≡ ⊤ U I ≤ φ and □ I ≤ φ ≡ ¬ ◊ I ≤ ¬ φ \Box^{\leq}_{I}\varphi\equiv\neg\Diamond^{\leq}_{I}\neg\varphi □ I ≤ φ ≡ ¬ ◊ I ≤ ¬ φ .
In the remainder of this paper, we omit the subscript I I I of temporal operators if I = [ 0 , ∞ ) I = [0,\infty) I = [ 0 , ∞ ) . Accordingly, if all operators appearing in a formula φ \varphi φ are subscript free, then φ \varphi φ is said to be untimed . Note that untimed non-strict Until formulae correspond to standard Until formulae in LTL.
Example 2.9. Let b , c ∈ A c t b,c \in\mathrm{Act} b , c ∈ Act . ⟦ b U I c ⟧ \llbracket b U_{I}c\rrbracket [ [ b U I c ] ] contains all infinite timed words where b b b is satisfied in every position (excluding the first one), until c c c becomes satisfied within interval I I I (relative to the first timestamp in π \pi π ). For instance, for I = [ 2 , 5 ] I=[2,5] I = [ 2 , 5 ] , any π ∈ T A c t ω \pi\in\mathrm{TAct}^{\omega} π ∈ TAct ω starting with the prefix ( b , 3 ) ( a , 4 ) ( c , 7 ) (b,3)(a,4)(c,7) ( b , 3 ) ( a , 4 ) ( c , 7 ) , π ′ \pi' π ′ ∈ T A c t ω \in\mathrm{TAct}^{\omega} ∈ TAct ω starting with ( a , 3 ) ( b , 4 ) ( c , 7 ) (a,3)(b,4)(c,7) ( a , 3 ) ( b , 4 ) ( c , 7 ) and π ′ ′ ∈ T A c t ω \pi'' \in\mathrm{TAct}^{\omega} π ′′ ∈ TAct ω starting with ( b , 2 ) ( c , 3 ) (b,2)(c,3) ( b , 2 ) ( c , 3 ) , we have:
π ∉ ⟦ b U I c ⟧ \pi\notin\llbracket b U_{I}c\rrbracket π ∈ / [ [ b U I c ] ] because even though c c c is satisfied at position 3, b b b is not satisfied at every position strictly between 1 and 3 (a 2 ( π ) = a ≠ b a_{2}(\pi)=a\ne b a 2 ( π ) = a = b ),
π ′ ∈ ⟦ b U I c ⟧ \pi' \in\llbracket b U_{I}c\rrbracket π ′ ∈ [ [ b U I c ] ] because c c c is satisfied at position 3 within I I I (7 − 3 ∈ [ 2 , 5 ] 7-3\in[2,5] 7 − 3 ∈ [ 2 , 5 ] ) and b b b is satisfied at the only position strictly between 1 and 3 (notice that here, however, π ′ ∉ ⟦ b U I ≤ c ⟧ \pi' \notin\llbracket b U^{\leq}_{I}c\rrbracket π ′ ∈ / [ [ b U I ≤ c ] ] ),
π ′ ′ ∉ ⟦ b U I c ⟧ \pi'' \notin\llbracket b U_{I}c\rrbracket π ′′ ∈ / [ [ b U I c ] ] because the first c c c occurs “too early” with timestamp 3 and 3 − 2 ∉ [ 2 , 5 ] 3-2\notin[2,5] 3 − 2 ∈ / [ 2 , 5 ] .
Theorem 2.10. Satisfiability and validity of MTL are undecidable [46 Theorem 3] .
include both the strict Until and its dual operator [18 ] , which is an unnecessary complication for our translation from MTL to T l i n T^{lin} T l in : we instead provide a syntactic complementation over T l i n T^{lin} T l in to handle the case ¬ ϕ \neg\phi ¬ ϕ (§ 3.4 ) and operate directly on the syntax given in Figure 1 (§ 3.5 ).
Timed Propositional Temporal Logic (TPTL)
TPTL [8 ] is an expressive timed logic that uses clock-like variables. As for MTL, we consider TPTL without past operators, and adapt the original pointwise semantics (see e.g., [17 ] ) to refer to sets of infinite timed words without loss of generality. Such syntax and semantics are given in Figure 3 .
Figure 3. TPTL syntax and semantics
TPTL formulae resemble those of MTL in the use of the strict Until operator, which however does not carry a subscript in TPTL and is therefore untimed by definition. To reason about time, TPTL uses instead clock-like variables (x x x in Figure 3 ). Each such variable can be used with the freeze quantifier (x . ϕ x.\phi x . ϕ ) which allows to record the timestamp of some action. Propositions of the form x ∼ n x \sim n x ∼ n with ∼ ∈ { < , ≤ , > , ≥ } \sim\in\{<, \le, >, \ge\} ∼∈ { < , ≤ , > , ≥ } and n ∈ N n \in\mathbb{N} n ∈ N are then useful to reason on the quantity of time since x x x has been frozen last (example below). For simplicity, we write x ∈ I x \in I x ∈ I and x ∉ I x \notin I x ∈ / I for some interval I ∈ I I \in\mathcal{I} I ∈ I as they can be expressed as conjunctions and disjunctions of x ∼ n x \sim n x ∼ n propositions. Note that the semantics of TPTL is given over terms , i.e., where clock-like variables can appear free. A TPTL formula is however necessarily closed, and therefore we drop the subscript v v v hereafter when referring to the semantics of a formula. ◯ ϕ \bigcirc\phi ◯ ϕ , □ ϕ \Box\phi □ ϕ and ◊ ϕ \Diamond\phi ◊ ϕ are derived using the same classical equivalences as for MTL, and the same notation is used for non-strict operators (U ≤ U^{\leq} U ≤ , □ ≤ \Box^{\leq} □ ≤ and ◊ ≤ \Diamond^{\leq} ◊ ≤ ), with the difference that neither of these operators carry an interval in TPTL.
The decorrelation between temporal operators and clock-like variables gives TPTL a greater expressive power than MTL [17 ] : any MTL formula can be written equivalently in TPTL, for instance b U I c b\ U_I\ c b U I c can be written in TPTL as x . ( b U ( c ∧ x ∈ I ) ) x.(b\ U\ (c \land x \in I)) x . ( b U ( c ∧ x ∈ I )) , whereas not all TPTL formulae are expressible in MTL as shows the following example.
Example 2.12. Consider the following TPTL formula with A c t = { a , b , c } \mathrm{Act} = \{a,b,c\} Act = { a , b , c } :
φ ≤ 1 = x . ◊ ( b ∧ x ≤ 1 ∧ ( □ ( x ≤ 1 ⇒ ¬ b ) ) ) \varphi_{\leq1}=x.\Diamond\left(b\land x\leq1\land\left(\Box\left(x\leq1\Rightarrow\neg b\right)\right)\right) φ ≤ 1 = x . ◊ ( b ∧ x ≤ 1 ∧ ( □ ( x ≤ 1 ⇒ ¬ b ) ) ) The semantics of the above formula equals the set of all infinite timed words satisfying that, within less than 1 time unit w.r.t. the timestamp of the first action, an action b b b occurs
at a position i > 1 i > 1 i > 1 and no other b b b occurs afterwards (we recall that □ \square □ and ◊ \Diamond ◊ are strict). More formally, an infinite timed word π \pi π belongs to the semantics of the above formula iff
∃ i > 1 : t i ( π ) − t 1 ( π ) ≤ 1 ∧ a i ( π ) = b ∧ ∀ j > i : t j ( π ) − t 1 ( π ) ≤ 1 ⇒ ¬ ( a j ( π ) = b ) \exists i > 1 : t_i(\pi) - t_1(\pi) \le1 \wedge a_i(\pi) = b \wedge\forall j > i : t_j(\pi) - t_1(\pi) \le1 \Rightarrow\neg(a_j(\pi) = b) ∃ i > 1 : t i ( π ) − t 1 ( π ) ≤ 1 ∧ a i ( π ) = b ∧ ∀ j > i : t j ( π ) − t 1 ( π ) ≤ 1 ⇒ ¬ ( a j ( π ) = b )
As shown in [17 ] , this formula cannot be expressed in MTL. The closest MTL formula would be ◊ [ 0 , 1 ] ( b ∧ □ [ 0 , 1 ] ¬ b ) \Diamond_{[0,1]}(b \wedge\Box_{[0,1]}\neg b) ◊ [ 0 , 1 ] ( b ∧ □ [ 0 , 1 ] ¬ b ) . Yet, this formula is more restrictive as the [ 0 , 1 ] [0,1] [ 0 , 1 ] subscript of the Globally operator is relative to the occurrence of b b b and not to that of the first action.
Theorem 2.13. Satisfiability and validity of TPTL are undecidable [8 Theorem 7] .
The logic T l i n T^{\mathrm{lin}} T lin
We present the syntax and semantics of T l i n T^{\mathrm{lin}} T lin (Section 3.1), our novel extension of (untimed) modal μ \mu μ -calculus with linear-time semantics, and prove that T l i n T^{\mathrm{lin}} T lin is strictly more expressive than TPTL and MTL (§ 3.5 ). The results stated in Section 3.1 are proven in [10 Appendix B] .
T l i n T^{\mathrm{lin}} T lin Syntax and Semantics
We first introduce a syntactic characterisation of timing constraints which we call guards . In the sequel, let D \mathcal{D} D be an infinite set of variables taking values in R ≥ 0 \mathbb{R}_{\ge0} R ≥ 0 , that we call timestamp variables , and let V \mathcal{V} V be the set of valuation functions v ∈ D → R ≥ 0 v \in\mathcal{D} \to\mathbb{R}_{\ge0} v ∈ D → R ≥ 0 .
Definition 3.1 (Guards). The set B ( D ) \mathcal{B}(\mathcal{D}) B ( D ) of guards over D \mathcal{D} D is given by the syntax
g : : = x ≺ n ∣ ( x − y ) ≺ n ∣ g ∧ g ∣ g ‾ g \mathrel{::=} x \prec n \mid(x-y) \prec n \mid g \wedge g \mid\overline{g} g ::= x ≺ n ∣ ( x − y ) ≺ n ∣ g ∧ g ∣ g where n ∈ N n \in\mathbb{N} n ∈ N , ≺ ∈ { < , ≤ } \prec\in\{<,\le\} ≺∈ { < , ≤ } , x , y ∈ D x,y \in\mathcal{D} x , y ∈ D and g ‾ \overline{g} g is a compact notation for ¬ g \neg g ¬ g .
A valuation v v v satisfies a guard g g g , denoted v ⊨ g v \models g v ⊨ g , iff replacing each variable x x x by v ( x ) v(x) v ( x ) in g g g gives an expression that evaluates to true. For example, v ⊨ ( x − y ) < 2 v \models(x-y) < 2 v ⊨ ( x − y ) < 2 iff v ( x ) − v ( y ) < 2 v(x)-v(y) < 2 v ( x ) − v ( y ) < 2 . We write v ⊭ g v \not\models g v ⊨ g interchangeably with v ⊨ g ‾ v \models\overline{g} v ⊨ g . If I I I is an interval, then we write ( x − y ) ∈ I (x-y) \in I ( x − y ) ∈ I as an abbreviation for the guard ( x − y ) ≺ ℓ R B ( I ‾ ) ∧ ( x − y ) ≺ r R B ( I ) (x-y) \prec_{\ell} \mathsf{RB}(\overline{I}) \wedge(x-y) \prec_{r} \mathsf{RB}(I) ( x − y ) ≺ ℓ RB ( I ) ∧ ( x − y ) ≺ r RB ( I ) (Remark 2.8), and ( x − y ) ∉ I (x-y) \notin I ( x − y ) ∈ / I for ( ( x − y ) ∈ I ) ‾ \overline{((x-y) \in I)} (( x − y ) ∈ I ) . We write v [ x : = m ] v[x := m] v [ x := m ] , x ∈ D x \in\mathcal{D} x ∈ D and m ∈ R ≥ 0 m \in\mathbb{R}_{\ge0} m ∈ R ≥ 0 , to denote the valuation that maps x x x to m m m and every y ∈ D ∖ { x } y \in\mathcal{D} \setminus\{x\} y ∈ D ∖ { x } to v ( y ) v(y) v ( y ) . We denote by [ x 1 = m 1 , … , x n = m n ] [x_1 = m_1,\ldots,x_n = m_n] [ x 1 = m 1 , … , x n = m n ] the current valuations of some variables of interest x 1 , … , x n x_1,\ldots,x_n x 1 , … , x n when valuation v v v is understood from the context.
Our T l i n T^{\mathrm{lin}} T lin consists of a set of formulae with linear-time timed semantics. Thus, before defining T l i n T^{\mathrm{lin}} T lin , we first define T T l i n TT^{\mathrm{lin}} T T lin , the set of terms that can be used to write a formula (T l i n ⊂ T T l i n T^{\mathrm{lin}} \subset TT^{\mathrm{lin}} T lin ⊂ T T lin ). The set T T l i n TT^{\mathrm{lin}} T T lin is generated by the grammar in Figure 4 , with a ∈ A c t a \in\mathrm{Act} a ∈ Act , X X X an element of a countable set of recursion variables V a r \mathrm{Var} Var , x ∈ D x \in\mathcal{D} x ∈ D , and g ∈ B ( D ) g \in\mathcal{B}(\mathcal{D}) g ∈ B ( D ) . Syntactically min ( X , ϕ ) \min(X,\phi) min ( X , ϕ ) and max ( X , ϕ ) \max(X,\phi) max ( X , ϕ ) are binders of X X X in ϕ \phi ϕ . The free recursion variables of a term ϕ \phi ϕ are given by a function f v : T T l i n ⟶ P ( V a r ) fv:TT^{\mathrm{lin}}\longrightarrow\mathcal{P}(\mathrm{Var}) f v : T T lin ⟶ P ( Var ) , defined in the expected way, e.g. f v ( min ( X , X ∧ x ∈ Y ) ) = { Y } fv(\min(X,X\wedge x\in Y))=\{Y\} f v ( min ( X , X ∧ x ∈ Y )) = { Y } . A term may contain timestamp variables in D \mathcal{D} D , for instance [ x − y < 0.7 ] X [x-y<0.7]X [ x − y < 0.7 ] X contains the two timestamp variables x , y ∈ D x,y\in\mathcal{D} x , y ∈ D . In our presentation, x ∈ ϕ x\in\phi x ∈ ϕ binds x ∈ D x\in\mathcal{D} x ∈ D in ϕ \phi ϕ , and we define accordingly the function f v T I M E : T T l i n ⟶ P ( D ) fv_{\mathrm{TIME}}:TT^{\mathrm{lin}}\longrightarrow\mathcal{P}(\mathcal{D}) f v TIME : T T lin ⟶ P ( D ) which gives the free timestamp variables contained in its argument. For instance f v T I M E ( [ x < 1 ] X ) = { x } fv_{\mathrm{TIME}}([x<1]X)=\{x\} f v TIME ([ x < 1 ] X ) = { x } and f v T I M E ( x ∈ Y ∈ ‾ ( x − y ∈ [ 2 , 4 ] / X ) ) = ∅ fv_{\mathrm{TIME}}(x\in Y\mathbin{\underline{\in}}(x-y\in[2,4]/X))=\varnothing f v TIME ( x ∈ Y ∈ ( x − y ∈ [ 2 , 4 ] / X )) = ∅ . A term in which no variable is free is closed.
Figure 4. Syntax of T T l i n TT^{lin} T T l in .
Compared to the untimed version of linear-time μ \mu μ -calculi (in particular linear-time HML in [2 ] ), T T l i n TT^{lin} T T l in provides two new syntactic constructs to handle dense time: x i n ϕ x\mathbin{\mathsf{in}}\phi x in ϕ and ⟨ g ⟩ ϕ \langle g\rangle\phi ⟨ g ⟩ ϕ . These are best discussed when introducing formulae later in this subsection.
The semantics of terms over infinite timed words is given in Figure 5 , where we have used the auxiliary functions
Figure 5. Linear time semantics of T T l i n TT^{lin} T T l in
⟨ ⋅ a ⋅ ⟩ ( − ) , ⟨ ⋅ g ⋅ ⟩ ( v , − ) : P ( T A c t ω ) ⟶ P ( T A c t ω ) \langle\cdot a\cdot\rangle(-),\ \langle\cdot g\cdot\rangle(v,-):\mathcal{P}(\mathrm{TAct}^{\omega})\longrightarrow\mathcal{P}(\mathrm{TAct}^{\omega}) ⟨ ⋅ a ⋅ ⟩ ( − ) , ⟨ ⋅ g ⋅ ⟩ ( v , − ) : P ( TAct ω ) ⟶ P ( TAct ω )
defined by the following equalities:
⟨ ⋅ a ⋅ ⟩ ( Z ) = { π ∣ a 1 ( π ) = a ∧ π 2 ∈ Z } ⟨ ⋅ g ⋅ ⟩ ( v , Z ) = { π ∣ v ⊨ g ∧ π ∈ Z } (1) \langle\cdot a\cdot\rangle(Z)=\{\pi\mid a_{1}(\pi)=a\land\pi^{2}\in Z\}\qquad\langle\cdot g\cdot\rangle(v,Z)=\{\pi\mid v\models g\land\pi\in Z\} \tag*{(1)} ⟨ ⋅ a ⋅ ⟩ ( Z ) = { π ∣ a 1 ( π ) = a ∧ π 2 ∈ Z } ⟨ ⋅ g ⋅ ⟩ ( v , Z ) = { π ∣ v ⊨ g ∧ π ∈ Z } (1)
and where environment ρ \rho ρ is an element of Υ \Upsilon Υ , the set of partial functions V a r ⇀ P ( T A c t ω ) \mathrm{Var}\rightharpoonup\mathcal{P}(\mathrm{TAct}^{\omega}) Var ⇀ P ( TAct ω ) , and v v v a valuation in V \mathcal{V} V .
Let dom ( f ) \operatorname{dom}(f) dom ( f ) denote the domain of definition of a partial function f f f . The notation ⟦ ϕ , ρ ⟧ v \llbracket\phi,\rho\rrbracket_{v} [ [ ϕ , ρ ] ] v , with fv ( ϕ ) ⊆ dom ( ρ ) \operatorname{fv}(\phi)\subseteq\operatorname{dom}(\rho) fv ( ϕ ) ⊆ dom ( ρ ) , denotes the set of timed words that satisfy ϕ \phi ϕ w.r.t. the environment ρ \rho ρ and the valuation v v v .
Properties of the semantics.
For any ϕ ∈ T T l i n \phi\in TT^{lin} ϕ ∈ T T l in , v ∈ V v\in\mathcal{V} v ∈ V , X ∈ V a r X\in\mathrm{Var} X ∈ Var and ρ ∈ Υ \rho\in\Upsilon ρ ∈ Υ such that fv ( ϕ ) ⊆ dom ( ρ ) ∪ { X } \operatorname{fv}(\phi)\subseteq\operatorname{dom}(\rho)\cup\{X\} fv ( ϕ ) ⊆ dom ( ρ ) ∪ { X } we define the semantic function
⟦ ϕ ⟧ v , X , ρ : P ( T A c t ω ) ⟶ P ( T A c t ω ) \llbracket\phi\rrbracket_{v,X,\rho}:\mathcal{P}(\mathrm{TAct}^{\omega})\longrightarrow\mathcal{P}(\mathrm{TAct}^{\omega}) [ [ ϕ ] ] v , X , ρ : P ( TAct ω ) ⟶ P ( TAct ω )
⟦ ϕ ⟧ v , X , ρ ( Z ) = ⟦ ϕ , ρ [ X ↦ Z ] ⟧ v (2) \llbracket\phi\rrbracket_{v,X,\rho}(Z)=\llbracket\phi,\rho[X\mapsto Z]\rrbracket_{v} \tag*{(2)} [ [ ϕ ] ] v , X , ρ ( Z ) = [ [ ϕ , ρ [ X ↦ Z ] ] ] v (2)
In other words ⟦ ϕ ⟧ v , X , ρ = λ y . ⟦ ϕ , ρ [ X ↦ y ] ⟧ v \llbracket\phi\rrbracket_{v,X,\rho}=\lambda y.\llbracket\phi,\rho[X\mapsto y]\rrbracket_{v} [ [ ϕ ] ] v , X , ρ = λ y . [ [ ϕ , ρ [ X ↦ y ] ] ] v .
Since environments are functions from logical variables to complete lattice, we order them in the standard pointwise way to obtain a complete lattice ⟨ V a r → P ( T A c t ω ) , ≤ ⟩ \langle\mathrm{Var}\to\mathcal{P}(\mathrm{TAct}^{\omega}),\leq\rangle ⟨ Var → P ( TAct ω ) , ≤ ⟩ , where infinitary least upper bounds and greatest lower bounds are defined as usual:
( ⋁ { ρ 1 , ρ 2 , … } ) ( X ) = ⋃ { ρ 1 ( X ) , ρ 2 ( X ) , … } \left(\bigvee\{\rho_1,\rho_2,\ldots\}\right)(X)=\bigcup\{\rho_1(X),\rho_2(X),\ldots\} ( ⋁ { ρ 1 , ρ 2 , … } ) ( X ) = ⋃ { ρ 1 ( X ) , ρ 2 ( X ) , … }
( ⋀ { ρ 1 , ρ 2 , … } ) ( X ) = ⋂ { ρ 1 ( X ) , ρ 2 ( X ) , … } \left(\bigwedge\{\rho_1,\rho_2,\ldots\}\right)(X)=\bigcap\{\rho_1(X),\rho_2(X),\ldots\} ( ⋀ { ρ 1 , ρ 2 , … } ) ( X ) = ⋂ { ρ 1 ( X ) , ρ 2 ( X ) , … }
The semantic function (Eq. (2) ) is monotone w.r.t. the pointwise ordering of environments, therefore Knaster-Tarski’s fixpoint theorem ensures that the largest and least fixpoints of every function ⟦ ϕ ⟧ v , X , ρ \llbracket\phi\rrbracket_{v,X,\rho} [ [ ϕ ] ] v , X , ρ exist, and are the semantics of the terms defined via min ( X , − ) \min(X,-) min ( X , − ) and max ( X , − ) \max(X,-) max ( X , − ) :
⟦ max ( X , ϕ ) , ρ ⟧ v = ⋃ { Z ∣ Z ⊆ ⟦ ϕ ⟧ v , X , ρ ( Z ) } = ν y . ⟦ ϕ ⟧ v , X , ρ ( y ) ⟦ min ( X , ϕ ) , ρ ⟧ v = ⋂ { Z ∣ ⟦ ϕ ⟧ v , X , ρ ( Z ) ⊆ Z } = μ y . ⟦ ϕ ⟧ v , X , ρ ( y ) (3) \begin{aligned}
\llbracket\max(X,\phi),\rho\rrbracket_v&=\bigcup\{Z\mid Z\subseteq\llbracket\phi\rrbracket_{v,X,\rho}(Z)\}&&=\nu y.\llbracket\phi\rrbracket_{v,X,\rho}(y)\\
\llbracket\min(X,\phi),\rho\rrbracket_v&=\bigcap\{Z\mid\llbracket\phi\rrbracket_{v,X,\rho}(Z)\subseteq Z\}&&=\mu y.\llbracket\phi\rrbracket_{v,X,\rho}(y) \tag*{(3)}
\end{aligned} [ [ max ( X , ϕ ) , ρ ] ] v [ [ min ( X , ϕ ) , ρ ] ] v = ⋃ { Z ∣ Z ⊆ [ [ ϕ ] ] v , X , ρ ( Z )} = ⋂ { Z ∣ [ [ ϕ ] ] v , X , ρ ( Z ) ⊆ Z } = ν y . [ [ ϕ ] ] v , X , ρ ( y ) = μ y . [ [ ϕ ] ] v , X , ρ ( y ) (3)
The semantic function is continuous w.r.t. directed sets over the CPO ⟨ P ( T A c t ω ) , ⊆ ⟩ \langle\mathcal{P}(\mathrm{TAct}^{\omega}),\subseteq\rangle ⟨ P ( TAct ω ) , ⊆ ⟩ . An immediate consequence of this and of Eq. (3) is that we can reason on terms defined via min ( X , − ) \min(X,-) min ( X , − ) (resp. max ( X , − ) \max(X,-) max ( X , − ) ) using Kleene fixpoint theorem (resp. its formal dual): for every term min ( X , ϕ ) ∈ T T l i n \min(X,\phi)\in TT^{lin} min ( X , ϕ ) ∈ T T l in , v ∈ V v\in\mathcal{V} v ∈ V , and ρ ∈ Υ \rho\in\Upsilon ρ ∈ Υ such that f v ( ϕ ) ⊆ dom ( ρ ) ∪ { X } fv(\phi)\subseteq\operatorname{dom}(\rho)\cup\{X\} f v ( ϕ ) ⊆ dom ( ρ ) ∪ { X } we have
⟦ min ( X , ϕ ) , ρ ⟧ v = ⋃ n ∈ N ( ⟦ ϕ ⟧ v , X , ρ n ( ∅ ) ) ⟦ max ( X , ϕ ) , ρ ⟧ v = ⋂ n ∈ N ( ⟦ ϕ ⟧ v , X , ρ n ( T A c t ω ) ) (4) \begin{aligned}
\llbracket\min(X,\phi),\rho\rrbracket_v&=\bigcup_{n\in\mathbb{N}}\left(\llbracket\phi\rrbracket^{n}_{v,X,\rho}(\emptyset)\right)\\
\llbracket\max(X,\phi),\rho\rrbracket_v&=\bigcap_{n\in\mathbb{N}}\left(\llbracket\phi\rrbracket^{n}_{v,X,\rho}(\mathrm{TAct}^{\omega})\right) \tag*{(4)}
\end{aligned} [ [ min ( X , ϕ ) , ρ ] ] v [ [ max ( X , ϕ ) , ρ ] ] v = n ∈ N ⋃ ( [ [ ϕ ] ] v , X , ρ n ( ∅ ) ) = n ∈ N ⋂ ( [ [ ϕ ] ] v , X , ρ n ( TAct ω ) ) (4)
where ⟦ ϕ ⟧ v , X , ρ n \llbracket\phi\rrbracket^{n}_{v,X,\rho} [ [ ϕ ] ] v , X , ρ n is defined by induction on n n n thus,
⟦ ϕ ⟧ v , X , ρ n = { i d if n = 0 , ⟦ ϕ ⟧ v , X , ρ ∘ ⟦ ϕ ⟧ v , X , ρ n − 1 if n ≥ 1. (5) \llbracket\phi\rrbracket^{n}_{v,X,\rho}=
\begin{cases}
id & \text{if }n=0,\\
\llbracket\phi\rrbracket_{v,X,\rho}\circ\llbracket\phi\rrbracket^{n-1}_{v,X,\rho} & \text{if }n\geq1.
\end{cases} \tag*{(5)} [ [ ϕ ] ] v , X , ρ n = { i d [ [ ϕ ] ] v , X , ρ ∘ [ [ ϕ ] ] v , X , ρ n − 1 if n = 0 , if n ≥ 1. (5)
Formulae.
We say that a variable X ∈ V a r X\in\mathrm{Var} X ∈ Var is guarded in a term ϕ \phi ϕ if all free occurrences of X X X in ϕ \phi ϕ are in the scope of at least one modality (i.e., ⟨ a ⟩ − \langle a\rangle- ⟨ a ⟩ − , a ∈ A c t a\in\mathrm{Act} a ∈ Act ). We say that a term ϕ \phi ϕ is guarded if for all its subterms min ( X , ψ 1 ) \min(X,\psi_1) min ( X , ψ 1 ) and max ( Y , ψ 2 ) \max(Y,\psi_2) max ( Y , ψ 2 ) , X X X is guarded in ψ 1 \psi_1 ψ 1 and Y Y Y is guarded in ψ 2 \psi_2 ψ 2 . For example, the term min ( X , ⟨ a ⟩ x i n [ x ≤ 2 ] X ∨ ⟨ b ⟩ Y ) \min(X,\langle a\rangle x\mathbin{\mathrm{in}}[x\leq2]X\lor\langle b\rangle Y) min ( X , ⟨ a ⟩ x in [ x ≤ 2 ] X ∨ ⟨ b ⟩ Y ) is guarded, and the term min ( X , ⟨ a ⟩ x i n [ x ≤ 2 ] X ∨ X ) \min(X,\langle a\rangle x\mathbin{\mathrm{in}}[x\leq2]X\lor X) min ( X , ⟨ a ⟩ x in [ x ≤ 2 ] X ∨ X ) is not, because the rightmost occurrence of X X X is not in the scope of a modality. The term min ( X , x i n [ x < 3 ] X ) \min(X,x\mathbin{\mathrm{in}}[x<3]X) min ( X , x in [ x < 3 ] X ) is not guarded, because neither x i n x\mathbin{\mathrm{in}} x in nor [ x < 3 ] [x<3] [ x < 3 ] is a modality. We may now define T l i n T^{lin} T l in , the set of formulae in T T l i n TT^{lin} T T l in .
Definition 3.2. The set of formulae T l i n T^{lin} T l in is defined as the set of closed and guarded terms in T T l i n TT^{lin} T T l in : T l i n = { ϕ ∈ T T l i n ∣ ϕ is guarded and f v ( ϕ ) = f v T I M E ( ϕ ) = ∅ } T^{lin}=\{\phi\in TT^{lin}\mid\phi\text{ is guarded and }fv(\phi)=fv_{\mathrm{TIME}}(\phi)=\emptyset\} T l in = { ϕ ∈ T T l in ∣ ϕ is guarded and f v ( ϕ ) = f v TIME ( ϕ ) = ∅ }
Since elements of T l i n T^{lin} T l in are closed, their semantics does not depend on valuations and environments. As a consequence, we simply write ⟦ ϕ ⟧ \llbracket\phi\rrbracket [ [ ϕ ] ] instead of ⟦ ϕ , ρ ⟧ v \llbracket\phi,\rho\rrbracket_v [ [ ϕ , ρ ] ] v to denote the semantics of any ϕ ∈ T l i n \phi\in T^{lin} ϕ ∈ T l in in any environment ρ ∈ Υ \rho\in\Upsilon ρ ∈ Υ and w.r.t. to any v ∈ V v\in\mathcal{V} v ∈ V .
Syntactic sugar
We use the notation a ˉ \bar{a} a ˉ to denote the set A c t ∖ { a } \mathrm{Act}\setminus\{a\} Act ∖ { a } . For S ⊆ A c t S\subseteq\mathrm{Act} S ⊆ Act , we write ⟨ S ⟩ ϕ \langle S\rangle\phi ⟨ S ⟩ ϕ as an abbreviation for ⋁ a ∈ S ⟨ a ⟩ ϕ \bigvee_{a\in S}\langle a\rangle\phi ⋁ a ∈ S ⟨ a ⟩ ϕ (if S S S is empty, then as expected the empty disjunction, and therefore ⟨ S ⟩ ϕ \langle S\rangle\phi ⟨ S ⟩ ϕ , is equivalent to f f \mathrm{ff} ff ). To improve the readability of formulae and of the complementation procedure that we will develop later on, we introduce the box operators [ a ] ϕ [a]\phi [ a ] ϕ and [ g ] ϕ [g]\phi [ g ] ϕ as abbreviations for ⟨ a ⟩ ϕ ∨ ⟨ a ˉ ⟩ t t \langle a\rangle\phi\lor\langle\bar{a}\rangle\mathrm{tt} ⟨ a ⟩ ϕ ∨ ⟨ a ˉ ⟩ tt and ⟨ g ⟩ ϕ ∨ ⟨ g ˉ ⟩ t t \langle g\rangle\phi\lor\langle\bar{g}\rangle\mathrm{tt} ⟨ g ⟩ ϕ ∨ ⟨ g ˉ ⟩ tt , respectively.
Let us now give two examples of the semantics of a formula φ ∈ T l i n \varphi\in T^{\mathrm{lin}} φ ∈ T lin , as to explain concretely the meaning of the new constructs x x x in φ \varphi φ and ⟨ g ⟩ φ \langle g\rangle\varphi ⟨ g ⟩ φ , relying on Figure 5 .
Example 3.4. Let φ ∈ T l i n \varphi\in T^{\mathrm{lin}} φ ∈ T lin be the following formula:
φ = x i n [ x ≤ 5 ] ⟨ b ⟩ t t \varphi= x\ \mathop{\mathrm{in}}[x \le5]\langle b\rangle\mathrm{tt} φ = x in [ x ≤ 5 ] ⟨ b ⟩ tt The semantics of this formula equals the set of all infinite timed words π \pi π that satisfy the following: either t 1 ( π ) > 5 t_1(\pi) > 5 t 1 ( π ) > 5 or t 1 ( π ) ≤ 5 t_1(\pi) \le5 t 1 ( π ) ≤ 5 and a 1 ( π ) = b a_1(\pi) = b a 1 ( π ) = b . That is, φ \varphi φ expresses the property: “if the first timestamp is smaller than 5, then the action associated with it must be a b b b ”.
Example 3.5. Let us discuss a more complex example. The following untimed formula, given in [4 Ex. 4.2] , expresses the property “every other action is a b b b ”:
φ e v e n ( b ) = max ( X , ⟨ A c t ⟩ ⟨ b ⟩ X ) \varphi_{\mathrm{even}(b)} = \max(X,\langle\mathrm{Act}\rangle\langle b\rangle X) φ even ( b ) = max ( X , ⟨ Act ⟩ ⟨ b ⟩ X ) We want a timed version of this formula, i.e., to express φ e v e n ( b ) , I \varphi_{\mathrm{even}(b),I} φ even ( b ) , I , the generalisation of φ e v e n ( b ) \varphi_{\mathrm{even}(b)} φ even ( b ) to any interval I ∈ I I \in\mathcal{I} I ∈ I . More precisely, the semantics of φ e v e n ( b ) , I \varphi_{\mathrm{even}(b),I} φ even ( b ) , I must contain every infinite timed word π \pi π that satisfies the following: for every even position i ∈ N > 1 i \in\mathbb{N}_{>1} i ∈ N > 1 , i.e., i i i mod 2 = 0, if t i ( π ) − t 1 ( π ) t_i(\pi) - t_1(\pi) t i ( π ) − t 1 ( π ) is within interval I I I , then a i ( π ) a_i(\pi) a i ( π ) must be a b b b , and a i ( π ) a_i(\pi) a i ( π ) can be any action otherwise. For this, we use the constructs x x x in − - − and ⟨ g ⟩ − \langle g\rangle- ⟨ g ⟩ − to build up the following formula:
φ e v e n ( b ) , I = x s i n max ( X , ⟨ A c t ⟩ ( x e i n ⟨ x e − x s ∈ I ⟩ ⟨ b ⟩ X ∨ y i n ⟨ y − x s ∉ I ⟩ ⟨ A c t ⟩ X ) ) \varphi_{\mathrm{even}(b),I} = x_s\ \mathop{\mathrm{in}}\max(X,\langle\mathrm{Act}\rangle(x_e\ \mathop{\mathrm{in}}\langle x_e-x_s \in I\rangle\langle b\rangle X \lor y\ \mathop{\mathrm{in}}\langle y-x_s \notin I\rangle\langle\mathrm{Act}\rangle X)) φ even ( b ) , I = x s in max ( X , ⟨ Act ⟩ ( x e in ⟨ x e − x s ∈ I ⟩ ⟨ b ⟩ X ∨ y in ⟨ y − x s ∈ / I ⟩ ⟨ Act ⟩ X )) Let us explain through evaluating whether some infinite timed word π \pi π belongs to the semantics of φ e v e n ( b ) , I \varphi_{\mathrm{even}(b),I} φ even ( b ) , I . The x s x_s x s in − - − is used outside of the maximal-fixpoint operator, allowing timestamp variable x s x_s x s (for x x x “start”) to record the first timestamp in π \pi π . Then, each recursion step contains two consecutive actions (as in φ e v e n ( b ) \varphi_{\mathrm{even}(b)} φ even ( b ) ), but this time with two disjoint recursion “paths” (the terms x e x_e x e in ⟨ x e − x s ∈ I ⟩ ⟨ b ⟩ X \langle x_e-x_s \in I\rangle\langle b\rangle X ⟨ x e − x s ∈ I ⟩ ⟨ b ⟩ X and y y y in ⟨ y − x s ∉ I ⟩ ⟨ A c t ⟩ X \langle y-x_s \notin I\rangle\langle\mathrm{Act}\rangle X ⟨ y − x s ∈ / I ⟩ ⟨ Act ⟩ X ). The first path requires the second action to be a b b b occurring within I I I , and the second allows the second action to be any action in A c t \mathrm{Act} Act occurring outside of I I I . To assess whether an action occurs e.g., in I I I , the first recursion path uses a timestamp variable x e x_e x e (for x x x “end”), updated with the timestamp of every other action in π \pi π , and requires the difference between x e x_e x e and x s x_s x s to belong to I I I (x e x_e x e in ⟨ x e − x s ∈ I ⟩ \langle x_e-x_s \in I\rangle ⟨ x e − x s ∈ I ⟩ ). Therefore, the only condition for π \pi π to be outside of the semantics of φ e v e n ( b ) , I \varphi_{\mathrm{even}(b),I} φ even ( b ) , I is the existence of some even position at which the action is not a b b b and occurs within I I I . For instance, for I = [ 3 , 5 ] I = [3,5] I = [ 3 , 5 ] and any π , π ′ , π ′ ′ ∈ T A c t ω \pi,\pi',\pi'' \in\mathrm{TAct}^{\omega} π , π ′ , π ′′ ∈ TAct ω starting respectively with the prefix ( a , 3 ) ( c , 4 ) ( a , 7 ) ( c , 9 ) (a,3)(c,4)(a,7)(c,9) ( a , 3 ) ( c , 4 ) ( a , 7 ) ( c , 9 ) , ( a , 3 ) ( b , 4 ) ( b , 7 ) ( b , 8 ) ( c , 10 ) (a,3)(b,4)(b,7)(b,8)(c,10) ( a , 3 ) ( b , 4 ) ( b , 7 ) ( b , 8 ) ( c , 10 ) and ( a , 2 ) ( b , 5 ) ( c , 6 ) ( c , 7 ) (a,2)(b,5)(c,6)(c,7) ( a , 2 ) ( b , 5 ) ( c , 6 ) ( c , 7 ) we have:
π ∈ ⟦ φ e v e n ( b ) , [ 3 , 5 ] ⟧ \pi\in\llbracket\varphi_{\mathrm{even}(b),[3,5]}\rrbracket π ∈ [ [ φ even ( b ) , [ 3 , 5 ] ] ] because there is no timed action at an even position that happens within [ 3 , 5 ] [3,5] [ 3 , 5 ] : at even position 2 we have 4 − 3 ∉ [ 3 , 5 ] 4 - 3 \notin[3,5] 4 − 3 ∈ / [ 3 , 5 ] , at the next even position 4 we have 9 − 3 ∉ [ 3 , 5 ] 9 - 3 \notin[3,5] 9 − 3 ∈ / [ 3 , 5 ] , and since at this position the right bound of the interval is already exceeded then actions at subsequent even positions will occur outside of I I I ,
π ′ ∈ ⟦ φ e v e n ( b ) , [ 3 , 5 ] ⟧ \pi' \in\llbracket\varphi_{\mathrm{even}(b),[3,5]}\rrbracket π ′ ∈ [ [ φ even ( b ) , [ 3 , 5 ] ] ] because the only even position with actions occurring within I I I is position 4 and we have a 4 ( π ′ ) = b a_4(\pi') = b a 4 ( π ′ ) = b ,
π ′ ′ ∉ ⟦ ϕ e v e n ( b ) , [ 3 , 5 ] ⟧ \pi'' \notin\llbracket\phi_{\mathrm{even}}(b),[3,5]\rrbracket π ′′ ∈ / [ [ ϕ even ( b ) , [ 3 , 5 ] ] ] because at position 4 an action occurs within I I I (7 − 2 ∈ [ 3 , 5 ] 7-2 \in[3,5] 7 − 2 ∈ [ 3 , 5 ] ) and such action is not a b b b .
In general, we have:
π ∈ ⟦ ϕ e v e n ( b ) , I ⟧ ⟺ ∀ i ∈ N > 1 : i m o d 2 = 0 ∧ t i ( π ) − t 1 ( π ) ∈ I ⟹ a i ( π ) = b \pi\in\llbracket\phi_{\mathrm{even}}(b),I\rrbracket\iff\forall i \in\mathbb{N}_{>1}: i \bmod2 = 0 \land t_i(\pi)-t_1(\pi) \in I \Longrightarrow a_i(\pi)=b π ∈ [ [ ϕ even ( b ) , I ] ] ⟺ ∀ i ∈ N > 1 : i mod 2 = 0 ∧ t i ( π ) − t 1 ( π ) ∈ I ⟹ a i ( π ) = b
which coincides with the generalisation of ϕ e v e n ( b ) \phi_{\mathrm{even}}(b) ϕ even ( b ) to any interval I ∈ I I \in\mathcal{I} I ∈ I . Note that when I = [ 0 , ∞ ) I=[0,\infty) I = [ 0 , ∞ ) , we obtain exactly the untimed version ϕ e v e n ( b ) \phi_{\mathrm{even}}(b) ϕ even ( b ) using the fact that x e − x s ∈ [ 0 , ∞ ) x_e-x_s \in[0,\infty) x e − x s ∈ [ 0 , ∞ ) is always true and y − x s ∉ [ 0 , ∞ ) y-x_s \notin[0,\infty) y − x s ∈ / [ 0 , ∞ ) is always false.
Closure under complement
In order to handle the case ¬ ϕ \neg\phi ¬ ϕ when translating MTL or TPTL formulae into T l i n T^{lin} T l in , we prove the more generic property of closure under complement of T T l i n TT^{lin} T T l in . This is done by the function not : T T l i n → T T l i n \operatorname{not}:TT^{lin}\to TT^{lin} not : T T l in → T T l in which maps any term ϕ \phi ϕ to its dual (i.e., a term whose semantics is T A c t ω ∖ ⟦ ϕ ⟧ T\!Act^\omega\setminus\llbracket\phi\rrbracket T A c t ω ∖ [ [ ϕ ] ] ), defined recursively as follows (note that we make use of the box modalities for readability)
not ( t t ) = f f not ( f f ) = t t not ( X ) = X not ( x i n ϕ ) = x i n not ( ϕ ) not ( ϕ ∧ ψ ) = not ( ϕ ) ∨ not ( ψ ) not ( ϕ ∨ ψ ) = not ( ϕ ) ∧ not ( ψ ) not ( ⟨ a ⟩ ϕ ) = [ a ] not ( ϕ ) not ( ⟨ g ⟩ ϕ ) = [ g ] not ( ϕ ) not ( max ( X , ϕ ) ) = min ( X , not ( ϕ ) ) not ( min ( X , ϕ ) ) = max ( X , not ( ϕ ) ) \begin{aligned}
\operatorname{not}(\mathrm{tt})&=\mathrm{ff} & \operatorname{not}(\mathrm{ff})&=\mathrm{tt}\\
\operatorname{not}(X)&=X & \operatorname{not}(x\mathbin{\mathrm{in}}\phi)&=x\mathbin{\mathrm{in}}\operatorname{not}(\phi)\\
\operatorname{not}(\phi\land\psi)&=\operatorname{not}(\phi)\lor\operatorname{not}(\psi) & \operatorname{not}(\phi\lor\psi)&=\operatorname{not}(\phi)\land\operatorname{not}(\psi)\\
\operatorname{not}(\langle a\rangle\phi)&=[a]\operatorname{not}(\phi) & \operatorname{not}(\langle g\rangle\phi)&=[g]\operatorname{not}(\phi)\\
\operatorname{not}(\max(X,\phi))&=\min(X,\operatorname{not}(\phi)) & \operatorname{not}(\min(X,\phi))&=\max(X,\operatorname{not}(\phi))
\end{aligned} not ( tt ) not ( X ) not ( ϕ ∧ ψ ) not (⟨ a ⟩ ϕ ) not ( max ( X , ϕ )) = ff = X = not ( ϕ ) ∨ not ( ψ ) = [ a ] not ( ϕ ) = min ( X , not ( ϕ )) not ( ff ) not ( x in ϕ ) not ( ϕ ∨ ψ ) not (⟨ g ⟩ ϕ ) not ( min ( X , ϕ )) = tt = x in not ( ϕ ) = not ( ϕ ) ∧ not ( ψ ) = [ g ] not ( ϕ ) = max ( X , not ( ϕ ))
Proposition 3.6. For all ϕ ∈ T l i n \phi\in T^{lin} ϕ ∈ T l in , ⟦ not ( ϕ ) ⟧ = T A c t ω ∖ ⟦ ϕ ⟧ \llbracket\operatorname{not}(\phi)\rrbracket=T\!Act^\omega\setminus\llbracket\phi\rrbracket [ [ not ( ϕ ) ] ] = T A c t ω ∖ [ [ ϕ ] ] .
The proof of Proposition 3.6 follows immediately from the proof of the following more general lemma.
Lemma 3.7. Let ρ ˉ \bar{\rho} ρ ˉ denote the environment that maps any X ∈ dom ( ρ ) X \in\operatorname{dom}(\rho) X ∈ dom ( ρ ) to T A c t ω ∖ ρ ( X ) T\!Act^\omega\setminus\rho(X) T A c t ω ∖ ρ ( X ) . For all ϕ ∈ T T l i n \phi\in TT^{lin} ϕ ∈ T T l in , v ∈ V v \in\mathcal{V} v ∈ V and ρ ∈ Υ \rho\in\Upsilon ρ ∈ Υ with fv ( ϕ ) ⊆ dom ( ρ ) \operatorname{fv}(\phi)\subseteq\operatorname{dom}(\rho) fv ( ϕ ) ⊆ dom ( ρ ) , the following holds:
⟦ not ( ϕ ) , ρ ˉ ⟧ v = T A c t ω ∖ ⟦ ϕ , ρ ⟧ v \llbracket\operatorname{not}(\phi),\bar{\rho}\rrbracket_v=T\!Act^\omega\setminus\llbracket\phi,\rho\rrbracket_v [ [ not ( ϕ ) , ρ ˉ ] ] v = T A c t ω ∖ [ [ ϕ , ρ ] ] v
The proof of Lemma 3.7 is detailed in Appendix A.
Expressiveness
The proofs related to this subsection are detailed in Appendix B.
From MTL to T l i n T^{lin} T l in
We show that every formula in MTL has a counterpart with exactly the same semantics in T l i n T^{lin} T l in . We proceed through proposing the function MtoT l i n : M T L ⟶ T l i n \operatorname{MtoT}^{lin}:MTL\longrightarrow T^{lin} MtoT l in : M T L ⟶ T l in , defined in Figure 6 , that transforms any MTL formula into an equivalent T l i n T^{lin} T l in formula.
Figure 6. From MTL to T l i n T^{lin} T l in .
Proposition 3.8. For every ϕ ∈ M T L \phi\in MTL ϕ ∈ M T L we have ⟦ ϕ ⟧ = ⟦ MtoT l i n ( ϕ ) ⟧ \llbracket\phi\rrbracket=\llbracket\operatorname{MtoT}^{lin}(\phi)\rrbracket [ [ ϕ ] ] = [ [ MtoT l in ( ϕ ) ] ] .
Example 3.9. Let b , c ∈ A c t b,c\in Act b , c ∈ A c t . We explain how MtoT l i n \operatorname{MtoT}^{lin} MtoT l in preserves the semantics of b U I c b\ U_I\ c b U I c (Example 2.9). Using the rules in Figure 6 , we obtain the following T l i n T^{lin} T l in formula:
ϕ = MtoT l i n ( b U I c ) = x s i n ⟨ A c t ⟩ min ( Y , ( ( x e i n ⟨ x e − x s ∈ I ⟩ ⟨ c ⟩ t t ) ∨ ( ⟨ b ⟩ t t ∧ ⟨ A c t ⟩ Y ) ) ) \phi=\operatorname{MtoT}^{lin}(b\ U_I\ c)=x_s\mathbin{\mathrm{in}}\langle Act\rangle\min(Y,((x_e\mathbin{\mathrm{in}}\langle x_e-x_s\in I\rangle\langle c\rangle\mathrm{tt})\lor(\langle b\rangle\mathrm{tt}\land\langle Act\rangle Y))) ϕ = MtoT l in ( b U I c ) = x s in ⟨ A c t ⟩ min ( Y , (( x e in ⟨ x e − x s ∈ I ⟩ ⟨ c ⟩ tt ) ∨ (⟨ b ⟩ tt ∧ ⟨ A c t ⟩ Y )))
MtoT l i n ( ⊤ ) = t t \operatorname{MtoT}^{lin}(\top)=\mathrm{tt} MtoT l in ( ⊤ ) = tt
MtoT l i n ( ⊥ ) = f f \operatorname{MtoT}^{lin}(\bot)=\mathrm{ff} MtoT l in ( ⊥ ) = ff
MtoT l i n ( a ) = ⟨ a ⟩ t t \operatorname{MtoT}^{lin}(a)=\langle a\rangle\mathrm{tt} MtoT l in ( a ) = ⟨ a ⟩ tt
MtoT l i n ( ¬ ϕ ) = not ( MtoT l i n ( ϕ ) ) \operatorname{MtoT}^{lin}(\neg\phi)=\operatorname{not}(\operatorname{MtoT}^{lin}(\phi)) MtoT l in ( ¬ ϕ ) = not ( MtoT l in ( ϕ ))
MtoT l i n ( ϕ ∧ ψ ) = MtoT l i n ( ϕ ) ∧ MtoT l i n ( ψ ) \operatorname{MtoT}^{lin}(\phi\land\psi)=\operatorname{MtoT}^{lin}(\phi)\land\operatorname{MtoT}^{lin}(\psi) MtoT l in ( ϕ ∧ ψ ) = MtoT l in ( ϕ ) ∧ MtoT l in ( ψ )
MtoT l i n ( ϕ U I ψ ) = x s in ⟨ A c t ⟩ min ( Y , x e in ( ⟨ x e − x s ∈ I ⟩ MtoT l i n ( ψ ) ) ∨ ( MtoT l i n ( ϕ ) ∧ ⟨ A c t ⟩ Y ) ) \operatorname{MtoT}^{lin}(\phi\mathbin{\mathsf{U}_{I}}\psi)=x_s\mathbin{\operatorname{in}}\langle\mathrm{Act}\rangle\min\left(Y,x_e\mathbin{\operatorname{in}}\left(\langle x_e-x_s\in I\rangle\operatorname{MtoT}^{lin}(\psi)\right)\mathbin{\lor}\left(\operatorname{MtoT}^{lin}(\phi)\land\langle\mathrm{Act}\rangle Y\right)\right) MtoT l in ( ϕ U I ψ ) = x s in ⟨ Act ⟩ min ( Y , x e in ( ⟨ x e − x s ∈ I ⟩ MtoT l in ( ψ ) ) ∨ ( MtoT l in ( ϕ ) ∧ ⟨ Act ⟩ Y ) )
Let ψ 1 = ( x e in ⟨ x e − x s ∈ I ⟩ ⟨ c ⟩ t t ) \psi_1=(x_e\mathbin{\operatorname{in}}\langle x_e-x_s\in I\rangle\langle c\rangle\mathrm{tt}) ψ 1 = ( x e in ⟨ x e − x s ∈ I ⟩ ⟨ c ⟩ tt ) and ψ 2 = ⟨ b ⟩ t t ∧ ⟨ A c t ⟩ Y \psi_2=\langle b\rangle\mathrm{tt}\land\langle\mathrm{Act}\rangle Y ψ 2 = ⟨ b ⟩ tt ∧ ⟨ Act ⟩ Y . We want to evaluate whether some infinite timed word π \pi π belongs to the semantics of ϕ \phi ϕ . Similarly to Example 3.5, x s x_s x s evaluates constantly to t 1 ( π ) t_1(\pi) t 1 ( π ) , whereas x e x_e x e is updated when progressing through π \pi π , starting from position 2 (the action at position 1 is “skipped” due to the ⟨ A c t ⟩ \langle\mathrm{Act}\rangle ⟨ Act ⟩ preceding the min \min min ). That is, x e x_e x e equals initially t 2 ( π ) t_2(\pi) t 2 ( π ) and, at each recursion step (⟨ A c t ⟩ Y \langle\mathrm{Act}\rangle Y ⟨ Act ⟩ Y ), Y Y Y is replaced by min ( Y , ψ 1 ∨ ψ 2 ) \min(Y,\psi_1\lor\psi_2) min ( Y , ψ 1 ∨ ψ 2 ) and x e x_e x e is updated with the timestamp t i t_i t i of the timed event in π \pi π triggering the recursion. Within ϕ \phi ϕ , the semantics of ψ 1 \psi_1 ψ 1 contains π i \pi^i π i iff the difference between t i t_i t i and t 1 t_1 t 1 is within the interval I I I and a i ( π ) a_i(\pi) a i ( π ) , the action associated with t i t_i t i , is a c c c , whereas π i \pi^i π i belongs to the semantics of ψ 2 \psi_2 ψ 2 iff a i ( π ) a_i(\pi) a i ( π ) is a b b b and the continuation of π i \pi^i π i (i.e., π i + 1 \pi^{i+1} π i + 1 ) is in the semantics of min ( Y , ψ 1 ∨ ψ 2 ) \min(Y,\psi_1\lor\psi_2) min ( Y , ψ 1 ∨ ψ 2 ) . Following the minimal fixpoint semantics, π \pi π is therefore in ⟦ ϕ ⟧ \llbracket\phi\rrbracket [ [ ϕ ] ] iff there exists a finite number of recursions through π 2 \pi^2 π 2 such that ψ 1 \psi_1 ψ 1 or ψ 2 \psi_2 ψ 2 holds, i.e., π ∈ ⟦ ϕ ⟧ \pi\in\llbracket\phi\rrbracket π ∈ [ [ ϕ ] ] iff b b b always holds from position 2 included until c c c holds within I I I . That is, ϕ \phi ϕ expresses the same property as b U I c b\mathbin{\mathsf{U}_{I}}c b U I c (Example 2.9).
From TPTL to T l i n T^{lin} T l in
Similarly to MTL, we provide a semantic-preserving translation PtoT l i n \operatorname{PtoT}^{lin} PtoT l in from TPTL terms to T T l i n TT^{lin} T T l in (see Figure 7 ), and require the input of PtoT l i n \operatorname{PtoT}^{lin} PtoT l in to be a TPTL formula guaranteeing the output to be a formula as well, i.e., in T l i n T^{lin} T l in .
P t o T l i n ( ⊤ ) = t t P t o T l i n ( ⊥ ) = f f P t o T l i n ( a ) = ⟨ a ⟩ t t P t o T l i n ( ϕ ∧ ψ ) = P t o T l i n ( ϕ ) ∧ P t o T l i n ( ψ ) P t o T l i n ( ¬ ϕ ) = n o t ( P t o T l i n ( ϕ ) ) P t o T l i n ( ϕ U ψ ) = ⟨ A c t ⟩ min ( X , P t o T l i n ( ψ ) ∨ ( P t o T l i n ( ϕ ) ∧ ⟨ A c t ⟩ X ) ) P t o T l i n ( x . ϕ ) = x i n P t o T l i n ( ϕ ) P t o T l i n ( x ∼ c ) = y i n ⟨ y − x ∼ c ⟩ t t \begin{aligned}
\mathsf{PtoT}^{lin}(\top)&=\mathsf{tt}\\
\mathsf{PtoT}^{lin}(\bot)&=\mathsf{ff}\\
\mathsf{PtoT}^{lin}(a)&=\langle a\rangle\mathsf{tt}\\
\mathsf{PtoT}^{lin}(\phi\land\psi)&=\mathsf{PtoT}^{lin}(\phi)\land\mathsf{PtoT}^{lin}(\psi)\\
\mathsf{PtoT}^{lin}(\neg\phi)&=\mathsf{not}(\mathsf{PtoT}^{lin}(\phi))\\
\mathsf{PtoT}^{lin}(\phi\mathbin{\mathsf{U}}\psi)&=\langle\mathsf{Act}\rangle\min\left(X,\mathsf{PtoT}^{lin}(\psi)\lor\left(\mathsf{PtoT}^{lin}(\phi)\land\langle\mathsf{Act}\rangle X\right)\right)\\
\mathsf{PtoT}^{lin}(x.\phi)&=x\mathbin{\mathsf{in}}\mathsf{PtoT}^{lin}(\phi)\\
\mathsf{PtoT}^{lin}(x\sim c)&=y\mathbin{\mathsf{in}}\langle y-x\sim c\rangle\mathsf{tt}
\end{aligned} PtoT l in ( ⊤ ) PtoT l in ( ⊥ ) PtoT l in ( a ) PtoT l in ( ϕ ∧ ψ ) PtoT l in ( ¬ ϕ ) PtoT l in ( ϕ U ψ ) PtoT l in ( x . ϕ ) PtoT l in ( x ∼ c ) = tt = ff = ⟨ a ⟩ tt = PtoT l in ( ϕ ) ∧ PtoT l in ( ψ ) = not ( PtoT l in ( ϕ )) = ⟨ Act ⟩ min ( X , PtoT l in ( ψ ) ∨ ( PtoT l in ( ϕ ) ∧ ⟨ Act ⟩ X ) ) = x in PtoT l in ( ϕ ) = y in ⟨ y − x ∼ c ⟩ tt Figure 7. From TPTL terms to T T l i n TT^{lin} T T l in .
Proposition 3.10. For every formula ϕ ∈ T P T L \phi\in TPTL ϕ ∈ T P T L we have ⟦ ϕ ⟧ = ⟦ PtoT l i n ( ϕ ) ⟧ \llbracket\phi\rrbracket=\llbracket\operatorname{PtoT}^{lin}(\phi)\rrbracket [ [ ϕ ] ] = [ [ PtoT l in ( ϕ ) ] ] .
Example 3.11. Let us consider the TPTL formula φ ≤ 1 \varphi_{\leq1} φ ≤ 1 of Example 2.12, not expressible in MTL:
φ ≤ 1 = x . ◊ ( b ∧ x ≤ 1 ∧ ( □ x ≤ 1 ⇒ ¬ b ) ) \varphi_{\leq1}=x.\Diamond\left(b\land x\leq1\land\left(\Box x\leq1\Rightarrow\neg b\right)\right) φ ≤ 1 = x . ◊ ( b ∧ x ≤ 1 ∧ ( □ x ≤ 1 ⇒ ¬ b ) ) Its translation into T l i n T^{lin} T l in gives the following formula (recalling that ◊ ϕ ≡ ⊤ U ϕ \Diamond\phi\equiv\top\mathbin{\mathsf{U}}\phi ◊ ϕ ≡ ⊤ U ϕ and □ ϕ ≡ ¬ ( ⊤ U ¬ ϕ ) \Box\phi\equiv\neg(\top\mathbin{\mathsf{U}}\neg\phi) □ ϕ ≡ ¬ ( ⊤ U ¬ ϕ ) ):
PtoT l i n ( φ ) = x in ⟨ A c t ⟩ min ( X , ( y in ⟨ y − x ≤ 1 ⟩ t t ∧ ⟨ b ⟩ t t ∧ not ( ⟨ A c t ⟩ min ( Y , z in ⟨ z − x ≤ 1 ⟩ t t ∧ ⟨ b ⟩ t t ∨ ( t t ∧ ⟨ A c t ⟩ Y ) ) ) ∨ ( t t ∧ ⟨ A c t ⟩ X ) ) \operatorname{PtoT}^{lin}(\varphi)=x\mathbin{\operatorname{in}}\langle\mathrm{Act}\rangle\min(X,(y\mathbin{\operatorname{in}}\langle y-x\leq1\rangle\mathrm{tt}\land\langle b\rangle\mathrm{tt}\land\operatorname{not}(\langle\mathrm{Act}\rangle\min(Y,z\mathbin{\operatorname{in}}\langle z-x\leq1\rangle\mathrm{tt}\land\langle b\rangle\mathrm{tt}\lor(\mathrm{tt}\land\langle\mathrm{Act}\rangle Y)))\lor(\mathrm{tt}\land\langle\mathrm{Act}\rangle X)) PtoT l in ( φ ) = x in ⟨ Act ⟩ min ( X , ( y in ⟨ y − x ≤ 1 ⟩ tt ∧ ⟨ b ⟩ tt ∧ not (⟨ Act ⟩ min ( Y , z in ⟨ z − x ≤ 1 ⟩ tt ∧ ⟨ b ⟩ tt ∨ ( tt ∧ ⟨ Act ⟩ Y ))) ∨ ( tt ∧ ⟨ Act ⟩ X )) Applying the complementation function and simplifying t t ∧ ψ \mathrm{tt}\land\psi tt ∧ ψ into ψ \psi ψ , ψ ∈ { ⟨ A c t ⟩ Y , ⟨ A c t ⟩ X } \psi\in\{\langle\mathrm{Act}\rangle Y,\langle\mathrm{Act}\rangle X\} ψ ∈ {⟨ Act ⟩ Y , ⟨ Act ⟩ X } we get
= x i n ⟨ A c t ⟩ min ( X , ( y i n ⟨ y − x ≤ 1 ⟩ t t ∧ ⟨ b ⟩ t t ∧ ⋀ a ∈ A c t [ a ] max ( Y , ( z i n [ z − x ≤ 1 ] f f ∨ [ b ] f f ) ∧ ⋀ a ∈ A c t [ a ] Y ) ) ∨ ⟨ A c t ⟩ X ) = x \mathbin{\mathsf{in}}\langle\mathsf{Act}\rangle\min\left(X,\left(y\mathbin{\mathsf{in}}\langle y-x\leq1\rangle\mathsf{tt}\land\langle b\rangle\mathsf{tt}\land\bigwedge_{a\in\mathsf{Act}}[a]\max\left(Y,\left(z\mathbin{\mathsf{in}}[z-x\leq1]\mathsf{ff}\lor[b]\mathsf{ff}\right)\land\bigwedge_{a\in\mathsf{Act}}[a]Y\right)\right)\lor\langle\mathsf{Act}\rangle X\right) = x in ⟨ Act ⟩ min ( X , ( y in ⟨ y − x ≤ 1 ⟩ tt ∧ ⟨ b ⟩ tt ∧ a ∈ Act ⋀ [ a ] max ( Y , ( z in [ z − x ≤ 1 ] ff ∨ [ b ] ff ) ∧ a ∈ Act ⋀ [ a ] Y ) ) ∨ ⟨ Act ⟩ X )
The semantics of ψ \psi ψ coincides with the set of all infinite timed words such that there exists an action b b b at a position strictly greater than 1 (due to the first ⟨ A c t ⟩ \langle\mathsf{Act}\rangle ⟨ Act ⟩ ), necessarily occurring (due to the minimal fixpoint operator) within 1 time unit relative to the first timestamp (recorded in x x x outside of the min). Now, the maximal fixpoint operator ensures that, starting from the action following such b b b , the only way to satisfy the formula as long as the bound 1 relative to the first timestamp is still not exceeded, is to have an action different than b b b , otherwise both [ z − x ≤ 1 ] f f [z-x\leq1]\mathsf{ff} [ z − x ≤ 1 ] ff and [ b ] f f [b]\mathsf{ff} [ b ] ff evaluate to false. When the bound is exceeded, [ z − x ≤ 1 ] f f [z-x\leq1]\mathsf{ff} [ z − x ≤ 1 ] ff evaluates to true and recursion can be carried on infinitely within the max. Therefore, for some π \pi π to satisfy ψ \psi ψ , there must exist a position i > 1 i>1 i > 1 such that t i ( π ) − t 1 ( π ) ≤ 1 t_i(\pi)-t_1(\pi)\leq1 t i ( π ) − t 1 ( π ) ≤ 1 , a i ( π ) = b a_i(\pi)=b a i ( π ) = b , and for every j > i j>i j > i , t i ( π ) − t 1 ( π ) ≤ 1 t_i(\pi)-t_1(\pi)\leq1 t i ( π ) − t 1 ( π ) ≤ 1 implies a i ( π ) ≠ b a_i(\pi)\ne b a i ( π ) = b , which corresponds to the formal definition of ⟦ φ ≤ 1 ⟧ \llbracket\varphi_{\leq1}\rrbracket [ [ φ ≤ 1 ] ] given within Example 2.12.
The following theorem follows directly from Theorem 2.13 and Proposition 3.10.
Theorem 3.12. Satisfiability and validity of T l i n T^{lin} T l in are undecidable.
T l i n T^{lin} T l in is strictly more expressive than TPTL and MTL
We finally prove that T l i n T^{lin} T l in is strictly more expressive than both MTL and TPTL. Since TPTL is already known to be more expressive than MTL [17 ] , it suffices thus to prove that T l i n T^{lin} T l in is more expressive than the former, as states the following theorem.
Theorem 3.13. 1. ∀ ϕ ∈ T P T L ∃ ψ ∈ T l i n : ⟦ ϕ ⟧ = ⟦ ψ ⟧ \forall\phi\in TPTL\ \exists\psi\in T^{lin}: \llbracket\phi\rrbracket=\llbracket\psi\rrbracket ∀ ϕ ∈ T P T L ∃ ψ ∈ T l in : [ [ ϕ ] ] = [ [ ψ ] ] ,
∃ ψ ∈ T l i n ∀ ϕ ∈ T P T L : ⟦ ψ ⟧ ≠ ⟦ ϕ ⟧ \exists\psi\in T^{lin}\ \forall\phi\in TPTL: \llbracket\psi\rrbracket\ne\llbracket\phi\rrbracket ∃ ψ ∈ T l in ∀ ϕ ∈ T P T L : [ [ ψ ] ] = [ [ ϕ ] ] .
The proof of Item 1 is direct from Proposition 3.10. To prove Item 2, it suffices to find a formula ψ ∈ T l i n \psi\in T^{lin} ψ ∈ T l in that is not expressible in TPTL. As a matter of fact, the formula ϕ e v e n ( b ) , I \phi_{\mathrm{even}(b),I} ϕ even ( b ) , I that we used as an example for T l i n T^{lin} T l in (Example 3.5) is not expressible in TPTL, as states the following proposition:
Proposition 3.14. For any I ∈ I I\in\mathcal{I} I ∈ I , the formula
ϕ e v e n ( b ) , I = x s i n max ( X , ⟨ A c t ⟩ ( x e i n ⟨ x e − x s ∈ I ⟩ ⟨ b ⟩ X ∨ y i n ⟨ y − x s ∉ I ⟩ ⟨ A c t ⟩ X ) ) \phi_{\mathrm{even}(b),I}=x_s\mathbin{\mathsf{in}}\max\left(X,\langle\mathsf{Act}\rangle\left(x_e\mathbin{\mathsf{in}}\langle x_e-x_s\in I\rangle\langle b\rangle X\lor y\mathbin{\mathsf{in}}\langle y-x_s\notin I\rangle\langle\mathsf{Act}\rangle X\right)\right) ϕ even ( b ) , I = x s in max ( X , ⟨ Act ⟩ ( x e in ⟨ x e − x s ∈ I ⟩ ⟨ b ⟩ X ∨ y in ⟨ y − x s ∈ / I ⟩ ⟨ Act ⟩ X ) ) is not expressible in TPTL.
The proof of Proposition 3.14 follows directly from [7 Sect. 3.4] . This concludes the proof of Item 2 of Theorem 3.13, and therefore the proof of Theorem 3.13. Accordingly, T l i n T^{lin} T l in is strictly more expressive than TPTL, and by [17 ] , strictly more expressive than MTL as well. We summarise these results in Figure 8 , where ⟦ L ⟧ = { ⟦ ϕ ⟧ ∣ ϕ ∈ L } \llbracket L\rrbracket= \{\llbracket\phi\rrbracket\mid\phi\in L\} [ [ L ] ] = { [ [ ϕ ] ] ∣ ϕ ∈ L } , with L ∈ { M T L , T P T L , T l i n } L \in\{MTL,TPTL,T^{lin}\} L ∈ { M T L , T P T L , T l in } , and the semantics of example formulae is denoted by thick dots for simplicity.
As we will see in Section 5, ϕ e v e n ( b ) , I \phi_{\mathrm{even}(b),I} ϕ even ( b ) , I is monitorable for violations in the general case (and also for satisfactions whenever I I I is bounded), which means that T l i n T^{lin} T l in allows for a larger set of monitorable formulae than TPTL and MTL.
Ease of Expression
We conclude this section with an informal comparison regarding the ease or flexibility in expression between T l i n T^{lin} T l in and TPTL.
Example 3.15. Consider the following T l i n T^{lin} T l in formula:
ϕ a l t , I = max ( X , x b i n ( ⟨ x b ∈ I ⟩ ⟨ b ⟩ x c i n ( ⟨ x c ∈ I ⟩ ⟨ c ⟩ X ∨ ⟨ x c ∉ I ⟩ ⟨ A c t ⟩ X ) ∨ ⟨ x b ∉ I ⟩ ⟨ A c t ⟩ X ) ) \phi_{\mathrm{alt},I} = \max\left(X,x_b\ \mathrm{in}\left(\langle x_b \in I\rangle\langle b\rangle x_c\ \mathrm{in}\left(\langle x_c \in I\rangle\langle c\rangle X \lor\langle x_c \notin I\rangle\langle Act\rangle X\right) \lor\langle x_b \notin I\rangle\langle Act\rangle X\right)\right) ϕ alt , I = max ( X , x b in ( ⟨ x b ∈ I ⟩ ⟨ b ⟩ x c in ( ⟨ x c ∈ I ⟩ ⟨ c ⟩ X ∨ ⟨ x c ∈ / I ⟩ ⟨ A c t ⟩ X ) ∨ ⟨ x b ∈ / I ⟩ ⟨ A c t ⟩ X ) ) The formula ϕ a l t , I \phi_{\mathrm{alt},I} ϕ alt , I , parameterised with non-empty interval I ∈ I I \in\mathcal{I} I ∈ I , expresses the following precise property over infinite timed words:
For all timestamps outside the interval I I I , there is no requirement on the actions,
The smallest timestamp belonging to I I I must be associated with action b b b ,
Actions must alternate between b b b and c c c as long as they occur within I I I .
For example, given I = ( 2 , 7 ] I=(2,7] I = ( 2 , 7 ] and A c t = { a , b , c } \mathrm{Act}=\{a,b,c\} Act = { a , b , c } , any infinite timed word starting with:
( a , 2 ) ( a , 7.2 ) (a,2)(a,7.2) ( a , 2 ) ( a , 7.2 ) is in the semantics of ϕ a l t , I \phi_{\mathrm{alt},I} ϕ alt , I (there are no actions in the absolute interval I = ( 2 , 7 ] I=(2,7] I = ( 2 , 7 ] ),
( c , 2.5 ) ( b , 3.2 ) ( c , 7 ) ( b , 8 ) (c,2.5)(b,3.2)(c,7)(b,8) ( c , 2.5 ) ( b , 3.2 ) ( c , 7 ) ( b , 8 ) is not in the semantics of ϕ a l t , I \phi_{\mathrm{alt},I} ϕ alt , I since the first action occurring within ( 2 , 7 ] (2,7] ( 2 , 7 ] is not a b b b (even though the alternation between b b b and c c c is respected within ( 2 , 7 ] (2,7] ( 2 , 7 ] ),
( b , 6 ) ( a , 7.3 ) (b,6)(a,7.3) ( b , 6 ) ( a , 7.3 ) is in the semantics of φ a l t , I \varphi_{alt,I} φ a l t , I .
The formula φ a l t , I \varphi_{alt,I} φ a l t , I in Example 3.15 is not expressible in MTL for any I ∈ I I \in\mathcal{I} I ∈ I different that [ 0 , ∞ ) [0,\infty) [ 0 , ∞ ) , following the same arguments used in [17 ] regarding the formula of Example 2.12. In TPTL, however, its expressibility depends on the model of timed words. In brief, this formula cannot be expressed in TPTL unless we force all timed words to start with timestamp 0. This is because the interval I I I is used in its absolute sense in φ a l t , I \varphi_{alt,I} φ a l t , I , i.e., there is no reference to a particular timestamp to “subtract” within guards. In contrast, a guard in TPTL x ∈ I x \in I x ∈ I forces an implicit subtraction of the value of x x x when it was last frozen from its current value (§ 2.4.2 ), making it necessary to have a particular timestamp as a reference (a simpler example is provided below).
Now, this is not an expressiveness result per se , as extending actions with a “special” symbole in order to have all timed words start with timestamp 0 is a common and even necessary practice to delineate factual from artificial expressiveness results (see e.g., [17 , 25 ] ). Under such assumption, φ a l t , I \varphi_{alt,I} φ a l t , I can be expressed in TPTL as shows the following example.
Example 3.16. Over the set of infinite timed words starting with timestamp 0, i.e., over { π ∈ T A c t ω ∣ t 1 ( π ) = 0 } \{\pi\in\mathrm{TAct}^{\omega} \mid t_1(\pi)=0\} { π ∈ TAct ω ∣ t 1 ( π ) = 0 } , the following TPTL formula is equivalent to φ a l t , I \varphi_{alt,I} φ a l t , I from Example 3.15:
ψ a l t , I = x . ( ψ 1 ∧ ψ 2 ∧ ψ 3 ∧ ψ 4 ) \psi_{alt,I}=x.(\psi_1 \land\psi_2 \land\psi_3 \land\psi_4) ψ a l t , I = x . ( ψ 1 ∧ ψ 2 ∧ ψ 3 ∧ ψ 4 ) Where ψ 1 \psi_1 ψ 1 (resp. ψ 2 \psi_2 ψ 2 ) ensures the first action to be a b b b if I I I is left-closed at 0 (resp. otherwise):
ψ 1 = x ∈ I ⇒ b \psi_1=x \in I \Rightarrow b ψ 1 = x ∈ I ⇒ b ψ 2 = □ ≤ ( ( x ≺ ← R B ( I ‾ ) ∧ ◯ x ∈ I ) ⇒ ◯ b ) \psi_2=\Box^{\leq}\bigl((x \mathrel{\prec_{\leftarrow}} \mathcal{RB}(\overline{I}) \land\bigcirc x \in I)\Rightarrow\bigcirc b\bigr) ψ 2 = □ ≤ ( ( x ≺ ← R B ( I ) ∧ ◯ x ∈ I ) ⇒ ◯ b ) And ψ 3 \psi_3 ψ 3 and ψ 4 \psi_4 ψ 4 guarantee alternation between b b b and c c c inside I I I :
ψ 3 = □ ≤ ( ( x ∈ I ∧ b ∧ ◯ x ∈ I ) ⇒ ◯ c ) \psi_3=\Box^{\leq}\bigl((x \in I \land b \land\bigcirc x \in I)\Rightarrow\bigcirc c\bigr) ψ 3 = □ ≤ ( ( x ∈ I ∧ b ∧ ◯ x ∈ I ) ⇒ ◯ c ) ψ 4 = □ ≤ ( ( x ∈ I ∧ c ∧ ◯ x ∈ I ) ⇒ ◯ b ) \psi_4=\Box^{\leq}\bigl((x \in I \land c \land\bigcirc x \in I)\Rightarrow\bigcirc b\bigr) ψ 4 = □ ≤ ( ( x ∈ I ∧ c ∧ ◯ x ∈ I ) ⇒ ◯ b )
The above examples show however that, in contrast to its lengthy formulae, T l i n T^{lin} T l in comes with a noticeable flexibility thanks to the mechanism of its timestamp variables, decoupling recording a timestamp from subtracting two values, as opposed to TPTL’s clock-like variables with implicit, hardcoded subtraction. Actually, very simple formulae such as x i n ⟨ x ≤ 3 ⟩ t t x\mathrel{\mathrm{in}}\langle x \leq3\rangle\mathrm{tt} x in ⟨ x ≤ 3 ⟩ tt turn out to be inexpressible in TPTL unless forcing all timed words to start with timestamp 0. Indeed, the above formula requires that the first timestamp is less than 3, yet in TPTL one needs first to freeze a reference time at some position. The formula x . x ≤ 3 x.x \leq3 x . x ≤ 3 , the closest to x i n ⟨ x ≤ 3 ⟩ t t x\mathrel{\mathrm{in}}\langle x \leq3\rangle\mathrm{tt} x in ⟨ x ≤ 3 ⟩ tt , will then freeze x x x at the first timestamp and compare instead the difference between such timestamp and x x x , therefore giving always 0. If all timed words are forced to start with timestamp 0, x i n ⟨ x ≤ 3 ⟩ t t x\mathrel{\mathrm{in}}\langle x \leq3\rangle\mathrm{tt} x in ⟨ x ≤ 3 ⟩ tt becomes equivalent to t t \mathrm{tt} tt and therefore trivially expressible in TPTL.
Monitoring a System
In this section, we formally define timed monitors (§ 4.1 ), hereafter referred to simply as monitors, and the special instrumentation operator allowing to compose an arbitrary timed system of interest, hereafter denoted a system under monitoring (SUM), with a monitor (Section 4.2). The proofs related to Section 4.1 and Section 4.2 can be found in [10 Appendix D] .
Moreover, we define a new reactive semantics for monitors allowing to abstract away the instrumentation operator without loss of generality, and to generalise accordingly the maximality results of [10 ] , requiring monitors to be reactive by design, to all monitors.
Monitors Syntax and Semantics
We first define TMon, the set of monitor terms, hereafter abbreviated m-terms. TMon is given by the grammar in Figure 9 where x ∈ D x \in\mathcal{D} x ∈ D , a ∈ A c t a \in\mathit{Act} a ∈ Act , g ∈ B ( D ) g \in\mathcal{B}(\mathcal{D}) g ∈ B ( D ) and X ∈ V a r X \in\mathit{Var} X ∈ Var . YES, NO, END are special m-terms called verdicts , corresponding respectively to acceptance, rejection and termination (i.e., an inconclusive outcome). By abuse of notation, we write E E E to denote L ( E ) L(E) L ( E ) , the set of m-terms generated by the grammar of Figure 9 starting from the nonterminal symbol E E E [35 ] .
Figure 9. Syntax of m-terms in TMon.
Notions of guardedness and free variables are defined similarly as for T T l i n TT^{lin} T T l in (Section 3.1). In an m-term, rec X . M X.M X . M (resp. let x x x in M M M ) is a binder of the recursion variable X X X (resp. timestamp variable x x x ). The free recursion (resp. timestamp) variables of an m-term M M M are given by the function m f v : T M o n ⟶ P ( V a r ) mfv : \mathrm{TMon} \longrightarrow\mathcal{P}(\mathrm{Var}) m f v : TMon ⟶ P ( Var ) (resp. m f v t i m e : T M o n ⟶ P ( D ) mfv_{time} : \mathrm{TMon} \longrightarrow\mathcal{P}(\mathcal{D}) m f v t im e : TMon ⟶ P ( D ) ), defined in the expected way. For example, m f v ( a . rec X . ( b . Y + ( x ≤ 2 ) . X ) ) = { Y } mfv(a.\operatorname{rec} X.(b.Y + (x \le2).X)) = \{Y\} m f v ( a . rec X . ( b . Y + ( x ≤ 2 ) . X )) = { Y } , m f v t i m e ( ( x − y ≤ 2 ) . X ) = { x , y } mfv_{time}((x-y \le2).X) = \{x,y\} m f v t im e (( x − y ≤ 2 ) . X ) = { x , y } and m f v t i m e ( let x in let y in ( x − y ≤ 2 ) . X ) = ∅ mfv_{time}(\operatorname{let} x \operatorname{in} \operatorname{let} y \operatorname{in} (x-y \le2).X) = \varnothing m f v t im e ( let x in let y in ( x − y ≤ 2 ) . X ) = ∅ . A recursion variable X X X is guarded in an m-term M ∈ T M o n M \in\mathrm{TMon} M ∈ TMon if every occurrence of X X X in M M M is in the scope of at least one modality ( a . ) (a.) ( a . ) , and M ∈ T M o n M \in\mathrm{TMon} M ∈ TMon is guarded if for all its subterms rec X . N \operatorname{rec} X.N rec X . N , X X X is guarded in N N N . For example the m-term rec X . ( a . ( let x in g . X + Y ) ) \operatorname{rec} X.(a.(\operatorname{let} x \operatorname{in} g.X + Y)) rec X . ( a . ( let x in g . X + Y )) is guarded, and the m-terms rec X . ( a . X + X ) \operatorname{rec} X.(a.X + X) rec X . ( a . X + X ) , rec X . let x in X \operatorname{rec} X.\operatorname{let} x \operatorname{in} X rec X . let x in X and rec X . g . X \operatorname{rec} X.g.X rec X . g . X are not guarded. We may now define the set of monitors Mon.
Definition 4.1. The set of monitors Mon is defined as the guarded m-terms in TMon closed vis-à-vis recursion variables:
M o n = { M ∈ T M o n ∣ M is guarded and m f v ( M ) = ∅ } \mathrm{Mon} = \{M \in\mathrm{TMon} \mid M\text{ is guarded and }mfv(M) = \varnothing\} Mon = { M ∈ TMon ∣ M is guarded and m f v ( M ) = ∅ } For example, rec X . ( a . let x in g . X + Y ) ∉ M o n \operatorname{rec} X.(a.\operatorname{let} x \operatorname{in} g.X + Y) \notin\mathrm{Mon} rec X . ( a . let x in g . X + Y ) ∈ / Mon because it is not closed w.r.t. recursion variable Y Y Y , whereas rec X . let y in ( x − y ≤ 2 ) . a . X ∈ M o n \operatorname{rec} X.\operatorname{let} y \operatorname{in} (x-y \le2).a.X \in\mathrm{Mon} rec X . let y in ( x − y ≤ 2 ) . a . X ∈ Mon .
Remark 4.2. Note that, compared to that of formulae (Definition 3.2), Definition 4.1 is more relaxed as monitors are allowed to have free timestamp variables. The practical reason behind this is illustrated later in this subsection (Example 4.6).
Remark 4.3. When manipulating monitors, we assume the same conventions as in Remark 3.3; in particular that fresh variables are picked at each recursion step.
The semantics of all monitors in Mon is given by the TLTS M = ⟨ S M , L , → M ⟩ \mathcal{M} = \langle S_{\mathrm{M}}, \mathcal{L}, \xrightarrow{\mathrm{M}} \rangle M = ⟨ S M , L , M ⟩ . A state m ∈ S M m \in S_{\mathrm{M}} m ∈ S M is of the form ( M , v c , v t ) (M,v_c,v_t) ( M , v c , v t ) where M M M is a monitor (in Mon), v c ∈ R ≥ 0 v_c \in\mathbb{R}_{\ge0} v c ∈ R ≥ 0 the value of
monitor time (to record the “global” time) and v t ∈ V v_t \in\mathcal{V} v t ∈ V a valuation (to update timestamp variables and evaluate guards). The rules of the transition relation ⟶ M \mathrel{\longrightarrow}_{\mathrm{M}} ⟶ M are given by Figure 10 , where a ∈ A c t a \in\mathrm{Act} a ∈ Act and d ∈ R ≥ 0 d \in\mathbb{R}_{\ge0} d ∈ R ≥ 0 . In Figure 10 and hereafter, we drop the subscript M from (weak or strong) transition symbols whenever clear from the context. The rule mVer states that a verdict state, i.e., a state of the form ( M , − , − ) (M,-,-) ( M , − , − ) , with M ∈ E M \in E M ∈ E can perform a transition with any visible action and reach a state preserving its first component, i.e., verdicts are persistent . Rule mTime corresponds to a delay transition. The remaining rules determine when a state with a (non-verdict) first component can perform an action a a a depending on its syntax. These are better explained through examples. Hereafter, we let 0 \mathbf{0} 0 denote the valuation that assigns 0 0 0 to every x ∈ D x \in D x ∈ D .
Figure 10. SOS rules for monitors.
Example 4.5. Let A c t = { b , c } \mathrm{Act} = \{b,c\} Act = { b , c } , M = l e t x i n ( ( x > 5 ) . Y E S + ( x ≤ 5 ) . ( b . Y E S + c . N O ) ) M = \mathrm{let}\ x\ \mathrm{in}\ ((x > 5).\mathrm{YES} + (x \le5).(b.\mathrm{YES} + c.\mathrm{NO})) M = let x in (( x > 5 ) . YES + ( x ≤ 5 ) . ( b . YES + c . NO )) , and let m 0 = ( M , 0 , 0 ) m_0 = (M,0,0) m 0 = ( M , 0 , 0 ) be a state of M M M (the TLTS of all monitors, see above). Say M M M performs, from m 0 m_0 m 0 , the finite run θ = 6 c \theta= 6\ c θ = 6 c . This will give the following (unique) trace: ( M , 0 , 0 ) → 6 ( M , 6 , 0 ) → c ( Y E S , 6 , [ x = 6 ] ) (M,0,0) \xrightarrow{6} (M,6,0) \xrightarrow{c} (\mathrm{YES},6,[x=6]) ( M , 0 , 0 ) 6 ( M , 6 , 0 ) c ( YES , 6 , [ x = 6 ]) , where, from left to right:
the delay transition d = 6 d = 6 d = 6 is allowed by rule mTime,
the action transition c c c is allowed by rule mLet. This is because the state ( ( x > 5 ) . Y E S + ( x ≤ 5 ) . ( a . Y E S + b . N O ) , 6 , [ x = 6 ] ) ((x > 5).\mathrm{YES} + (x \le5).(a.\mathrm{YES} + b.\mathrm{NO}),6,[x=6]) (( x > 5 ) . YES + ( x ≤ 5 ) . ( a . YES + b . NO ) , 6 , [ x = 6 ]) can perform any action in A c t \mathrm{Act} Act and reach ( Y E S , 6 , [ x = 6 ] ) (\mathrm{YES},6,[x=6]) ( YES , 6 , [ x = 6 ]) following, respectively, rules mSelL, mGuard and mVer (Figure 10 ).
Example 4.6. This example illustrates further the evolution of a monitor according to the rules of ⟶ M \longrightarrow_{\mathrm{M}} ⟶ M , but also explains why monitors are allowed to have free timestamp variables, following Definition 4.1. Let A c t = { b , c } \mathrm{Act} = \{b,c\} Act = { b , c } and the monitor
M = l e t x i n ( r e c X . ( l e t y i n ( ( y − x ≤ 5 ) . ( b . X + c . N O ) + ( y − x > 5 ) . Y E S ) ) ) M = \mathrm{let}\ x\ \mathrm{in}\ (\mathrm{rec}\ X.(\mathrm{let}\ y\ \mathrm{in}\ ((y-x \le5).(b.X + c.\mathrm{NO}) + (y-x > 5).\mathrm{YES}))) M = let x in ( rec X . ( let y in (( y − x ≤ 5 ) . ( b . X + c . NO ) + ( y − x > 5 ) . YES )))
and let
N = rec X . ( let y in ( ( y − x ≤ 5 ) . ( b . X + c . N O ) + ( y − x > 5 ) . Y E S ) ) N = \operatorname{rec} X.(\operatorname{let} y \operatorname{in} ((y-x \le5).(b.X+c.\mathrm{NO})+(y-x>5).\mathrm{YES})) N = rec X . ( let y in (( y − x ≤ 5 ) . ( b . X + c . NO ) + ( y − x > 5 ) . YES ))
i.e., N N N is the subterm of M M M without the binder of timestamp variable x x x . Intuitively, the syntax of M M M indicates that it accepts a run (becomes Y E S \mathrm{YES} YES ) iff every action seen within 5 time units, relative to the global time at which the first action occurs, is a b b b (otherwise it rejects). Let us apply the rules of ⟶ M \longrightarrow_M ⟶ M , starting at ( M , 0 , 0 ) (M,0,0) ( M , 0 , 0 ) , to see whether M M M accepts any run θ \theta θ starting with 2 b 6 c 2\,b\,6\,c 2 b 6 c as it should: ( M , 0 , 0 ) → 2 ( M , 2 , 0 ) → b ( M ′ , 2 , [ x = 2 , y = 2 ] ) → 6 ( M ′ , 8 , [ x = 2 , y = 2 ] ) → c ( Y E S , 8 , [ x = 2 , y = 8 ] ) (M,0,0) \xrightarrow{2} (M,2,0) \xrightarrow{b} (M',2,[x=2,y=2]) \xrightarrow{6} (M',8,[x=2,y=2]) \xrightarrow{c} (\mathrm{YES},8,[x=2,y=8]) ( M , 0 , 0 ) 2 ( M , 2 , 0 ) b ( M ′ , 2 , [ x = 2 , y = 2 ]) 6 ( M ′ , 8 , [ x = 2 , y = 2 ]) c ( YES , 8 , [ x = 2 , y = 8 ]) where
M ′ = let y in ( ( y − x ≤ 5 ) . ( b . N + c . N O ) + ( y − x > 5 ) . Y E S ) M'=\operatorname{let} y \operatorname{in} ((y-x \le5).(b.N+c.\mathrm{NO})+(y-x>5).\mathrm{YES}) M ′ = let y in (( y − x ≤ 5 ) . ( b . N + c . NO ) + ( y − x > 5 ) . YES )
applying, respectively (from left to right) rule mTime, mLet, mTime and mLet. Notice now that, in M ′ M' M ′ , there is no longer the binder of timestamp variable x x x , and therefore x x x is free in M ′ M' M ′ . This is because let x in \operatorname{let} x \operatorname{in} let x in in M M M , outside of the recursion, is intended to evaluate constantly to the value of global time corresponding to the first action. This simplification is handy to deal with monitors with both recursion and guards, and justifies the relaxed nature of Definition 4.1, allowing monitors to have free timestamp variables.
Parallel monitors.
Table 11. Syntax of TMon (extended with parallel composition).
In practice, a formula is often monitored through composing monitors in parallel [2 ] . We first define the syntax of parallel composition over m-terms. The syntax of TMon is extended accordingly with two parallel composition operators: ⊗ \otimes ⊗ for parallel conjunction and ⊕ \oplus ⊕ for parallel disjunction , adapted from [2 ] to the (linear-time) timed setting. The extended syntax thereof is given in Fig. 11, with ⊙ ∈ { ⊗ , ⊕ } \odot\in\{\otimes,\oplus\} ⊙ ∈ { ⊗ , ⊕ } . Accordingly, we extend the set of verdicts by grouping acceptance, rejection and termination verdicts in the set VYES, VNO and VEND respectively. By abuse of notation, we write E ∈ { V Y E S , V N O , V E N D } E \in\{\mathrm{VYES},\mathrm{VNO},\mathrm{VEND}\} E ∈ { VYES , VNO , VEND } to denote L ( E ) L(E) L ( E ) , the set of m-terms generated by the grammar of Fig. 11 starting from the nonterminal symbol E E E . Each of the latter is defined recursively using the corresponding verdict from a regular (i.e., non-parallel) m-term. For example, a verdict VYES (an acceptance verdict) is reached in a parallel disjunction (resp. conjunction) of two regular m-terms whenever a YES verdict is reached by one … simple; we only need one additional rule, stating that monitors in a composition perform actions together:
M ⊙ N ∉ E ( M , v c , v t ) → a ( M ′ , v c , v t ′ ) ( N , v c , v t ) → a ( N ′ , v c , v t ′ ′ ) ( M ⊙ N , v c , v t ) → a ( M ′ ⊙ N ′ , v c , v t ′ ⊔ v t v t ′ ′ ) \frac{M \mathbin{\odot} N \notin E \quad(M,v_c,v_t) \xrightarrow{a} (M',v_c,v_t') \quad(N,v_c,v_t) \xrightarrow{a} (N',v_c,v_t'')}{(M \mathbin{\odot} N,v_c,v_t) \xrightarrow{a} (M' \mathbin{\odot} N',v_c,v_t' \mathbin{\sqcup}_{v_t} v_t'')} ( M ⊙ N , v c , v t ) a ( M ′ ⊙ N ′ , v c , v t ′ ⊔ v t v t ′′ ) M ⊙ N ∈ / E ( M , v c , v t ) a ( M ′ , v c , v t ′ ) ( N , v c , v t ) a ( N ′ , v c , v t ′′ )
where
v t ′ ⊔ v t v t ′ ′ ( x ) = { v t ′ ( x ) if v t ′ ( x ) ≠ v t ( x ) v t ′ ′ ( x ) if v t ′ ′ ( x ) ≠ v t ( x ) v t ( x ) otherwise v_t' \mathbin{\sqcup}_{v_t} v_t''(x)=
\begin{cases}
v_t'(x) & \text{if }v_t'(x)\ne v_t(x)\\
v_t''(x) & \text{if }v_t''(x)\ne v_t(x)\\
v_t(x) & \text{otherwise}
\end{cases} v t ′ ⊔ v t v t ′′ ( x ) = ⎩ ⎨ ⎧ v t ′ ( x ) v t ′′ ( x ) v t ( x ) if v t ′ ( x ) = v t ( x ) if v t ′′ ( x ) = v t ( x ) otherwise
Recall that bound timestamp variables in M M M and N N N are disjoint, and therefore the first two cases are disjoint. M = ⟨ S M , L , ⟶ M ⟩ \mathsf{M}=\langle S_{\mathsf{M}},\mathcal{L},\longrightarrow_{\mathsf{M}}\rangle M = ⟨ S M , L , ⟶ M ⟩ , the TLTS describing the semantics of all monitors in M o n \mathsf{Mon} Mon is therefore extended to parallel monitors, with the transition relation ⟶ M \longrightarrow_{\mathsf{M}} ⟶ M defined using the rules in Figure 10 and the rule mPar above{sup}2`.
▶ Example 4.7. Let A c t = { b , c , c ′ } \mathsf{Act}=\{b,c,c'\} Act = { b , c , c ′ } and recall the monitor from Example 4.5,
M = l e t x i n ( x > 5 ) . Y E S + ( x ≤ 5 ) . ( b . Y E S + c . N O ) M=\mathsf{let}\ x\ \mathsf{in}\ (x>5).\mathsf{YES}+(x\leq5).(b.\mathsf{YES}+c.\mathsf{NO}) M = let x in ( x > 5 ) . YES + ( x ≤ 5 ) . ( b . YES + c . NO )
Consider the monitor N = M ⊗ c ′ . Y E S N=M\mathbin{\otimes}c'.\mathsf{YES} N = M ⊗ c ′ . YES and let n 0 = ( N , 0 , 0 ) n_0=(N,0,0) n 0 = ( N , 0 , 0 ) . We show how, from n 0 n_0 n 0 , an acceptance verdict is reached after performing any run that starts with 6 c ′ 6c' 6 c ′ . First, using rule mTime to derive ( M ⊗ a . Y E S , 0 , 0 ) → 6 ( M ⊗ a . Y E S , 6 , 0 ) (M\mathbin{\otimes}a.\mathsf{YES},0,0)\xrightarrow{6}(M\mathbin{\otimes}a.\mathsf{YES},6,0) ( M ⊗ a . YES , 0 , 0 ) 6 ( M ⊗ a . YES , 6 , 0 ) , then ( M ⊗ c ′ . Y E S , 6 , 0 ) → c ′ ( Y E S ⊗ Y E S , 6 , [ x = 6 ] ) (M\mathbin{\otimes}c'.\mathsf{YES},6,0)\xrightarrow{c'}(\mathsf{YES}\mathbin{\otimes}\mathsf{YES},6,[x=6]) ( M ⊗ c ′ . YES , 6 , 0 ) c ′ ( YES ⊗ YES , 6 , [ x = 6 ]) is given by the following derivation.
N ∉ E ( M , 6 , 0 ) → c ′ ( Y E S , 6 , [ x = 6 ] ) ( M , 6 , 0 ) → c ′ ( Y E S , 6 , [ x = 6 ] ) m A c t ( c ′ . Y E S , 6 , 0 ) → c ′ ( Y E S , 6 , 0 ) ( M ⊗ c ′ . Y E S , 6 , 0 ) → c ′ ( Y E S ⊗ Y E S , 6 , [ x = 6 ] ) m P a r \frac{N\notin E \qquad\frac{(M,6,0)\xrightarrow{c'}(\mathsf{YES},6,[x=6])}{\phantom{(M,6,0)\xrightarrow{c'}(\mathsf{YES},6,[x=6])}}\ \mathrm{mAct}\qquad(c'.\mathsf{YES},6,0)\xrightarrow{c'}(\mathsf{YES},6,0)}{(M\mathbin{\otimes}c'.\mathsf{YES},6,0)\xrightarrow{c'}(\mathsf{YES}\mathbin{\otimes}\mathsf{YES},6,[x=6])}\ \mathrm{mPar} ( M ⊗ c ′ . YES , 6 , 0 ) c ′ ( YES ⊗ YES , 6 , [ x = 6 ]) N ∈ / E ( M , 6 , 0 ) c ′ ( YES , 6 , [ x = 6 ]) ( M , 6 , 0 ) c ′ ( YES , 6 , [ x = 6 ]) mAct ( c ′ . YES , 6 , 0 ) c ′ ( YES , 6 , 0 ) mPar
However, this monitor cannot perform any run of the form d b db d b or d c dc d c with d ≤ 5 d\leq5 d ≤ 5 , because the righthand side of the parallel disjunction, i.e., c ′ . Y E S c'.\mathsf{YES} c ′ . YES can perform neither a b b b nor a c c c , the only possible actions by M M M when x ≤ 5 x\leq5 x ≤ 5 . This partly motivates the notion of reactivity , discussed in § 4.6 .
In the sequel, we use the shorthand notation N + A ‾ . M N+\overline{A}.M N + A . M to denote the selection between monitor N N N and a . M a.M a . M for all actions in A ⊆ A c t A\subseteq\mathsf{Act} A ⊆ Act , with the convention N + A ‾ . M = N N+\overline{A}.M=N N + A . M = N if A A A is empty. Moreover, we write A ‾ \overline{A} A , A ⊆ A c t A\subseteq\mathsf{Act} A ⊆ Act , to denote the set A c t ∖ A \mathsf{Act}\setminus A Act ∖ A and similarly a ‾ \overline{a} a , a ∈ A c t a\in\mathsf{Act} a ∈ Act to denote A c t ∖ { a } \mathsf{Act}\setminus\{a\} Act ∖ { a } . Using these compact notations, we can write e.g., for A c t = { a 1 , a 2 , a 3 , a 4 } \mathsf{Act}=\{a_1,a_2,a_3,a_4\} Act = { a 1 , a 2 , a 3 , a 4 } , a 2 ‾ . M + a 2 ‾ . N O \overline{a_2}.M+\overline{a_2}.\mathsf{NO} a 2 . M + a 2 . NO instead of a 2 . M + a 1 . N O + a 3 . N O + a 4 . N O a_2.M+a_1.\mathsf{NO}+a_3.\mathsf{NO}+a_4.\mathsf{NO} a 2 . M + a 1 . NO + a 3 . NO + a 4 . NO .
Verdict persistence.
As mentioned earlier, all monitors in M o n \mathsf{Mon} Mon are verdict-persistent.
▶ Lemma 4.8 (Verdict persistence). For all ( M , v c , v t ) , ( N , v c ′ , v t ′ ) ∈ S M (M,v_c,v_t),(N,v_c',v_t')\in S_{\mathsf{M}} ( M , v c , v t ) , ( N , v c ′ , v t ′ ) ∈ S M and finite weak run θ ∈ L ∗ \theta\in\mathcal{L}^{*} θ ∈ L ∗ , if M ∈ E M\in E M ∈ E then:
( M , v c , v t ) ⇒ θ ( N , v c ′ , v t ′ ) implies N = M (M,v_c,v_t)\xRightarrow{\theta}(N,v_c',v_t')\ \text{implies}\ N=M ( M , v c , v t ) θ ( N , v c ′ , v t ′ ) implies N = M
Proof. By induction on the length n n n of θ \theta θ . In the case n = 0 n = 0 n = 0 , the result is obtained by reflexivity of ⟶ \longrightarrow ⟶ . In the inductive case, we have ( M , v c , v t ) → α ( N ′ , v c ′ ′ , v t ′ ′ ) → θ ′ ( N , v c ′ , v t ′ ) (M, v_c, v_t) \xrightarrow{\alpha} (N', v_c'', v_t'') \xrightarrow{\theta'} (N, v_c', v_t') ( M , v c , v t ) α ( N ′ , v c ′′ , v t ′′ ) θ ′ ( N , v c ′ , v t ′ ) for some α ∈ L \alpha\in\mathcal{L} α ∈ L , N ′ ∈ M o n N' \in\mathrm{Mon} N ′ ∈ Mon , v c ′ ∈ R ≥ 0 v_c' \in\mathbb{R}_{\ge0} v c ′ ∈ R ≥ 0 , v t ′ ∈ V v_t' \in\mathcal{V} v t ′ ∈ V . We proceed by case analysis on the rule used to derive ( M , v c , v t , r ) → α ( N ′ , v c ′ ′ , v t ′ ′ ) (M, v_c, v_t, r) \xrightarrow{\alpha} (N', v_c'', v_t'') ( M , v c , v t , r ) α ( N ′ , v c ′′ , v t ′′ ) . The only possible two cases are:
mVer: Then we have ( M , v c , v t ) → a ( M , v c , v t ) → θ ′ ( N , v c ′ , v t ′ ) (M, v_c, v_t) \xrightarrow{a} (M, v_c, v_t) \xrightarrow{\theta'} (N, v_c', v_t') ( M , v c , v t ) a ( M , v c , v t ) θ ′ ( N , v c ′ , v t ′ ) . Since θ ′ \theta' θ ′ is smaller than θ \theta θ , we apply the induction hypothesis to conclude N = M N = M N = M .
mTime: Then we have ( M , v c , v t ) → d ( M , v c + d , v t ) → θ ′ ( N , v c ′ , v t ′ ) (M, v_c, v_t) \xrightarrow{d} (M, v_c + d, v_t) \xrightarrow{\theta'} (N, v_c', v_t') ( M , v c , v t ) d ( M , v c + d , v t ) θ ′ ( N , v c ′ , v t ′ ) . Since θ ′ \theta' θ ′ is smaller than θ \theta θ , we apply the induction hypothesis to conclude N = M N = M N = M .
Verdict states.
Thanks to verdict persistence, we know that once a monitor reaches a verdict state , i.e., a state whose first component is a verdict, the information within such state are irrelevant at the exception of the verdict itself (i.e., acceptance, rejection or termination). That is, e.g., for a verdict state ( M ∈ V Y E S , v c , v t ) (M \in\mathsf{VYES}, v_c, v_t) ( M ∈ VYES , v c , v t ) , we know that regardless of what M M M performs in the future, it will remain unchanged. Therefore, we may denote by yes, no, end any verdict state in ( M , v c , v t ) ∈ S M (M, v_c, v_t) \in S_{\mathsf{M}} ( M , v c , v t ) ∈ S M such that M ∈ V Y E S M \in\mathsf{VYES} M ∈ VYES , M ∈ V N O M \in\mathsf{VNO} M ∈ VNO , M ∈ V E N D M \in\mathsf{VEND} M ∈ VEND , respectively. Strictly speaking, yes, no, end may be viewed as equivalence classes grouping states with acceptance, rejection and termination verdicts, respectively. In order to simplify the writing, we abuse notation by defining an equality instead. For all ( M , v c , v t ) , ( N , v c ′ , v t ′ ) ∈ S M (M, v_c, v_t), (N, v_c', v_t') \in S_{\mathsf{M}} ( M , v c , v t ) , ( N , v c ′ , v t ′ ) ∈ S M :
( M , v c , v t ) = ( N , v c ′ , v t ′ ) = y e s iff M ∈ V Y E S and N ∈ V Y E S (M, v_c, v_t) = (N, v_c', v_t') = \mathrm{yes} \text{ iff } M \in\mathsf{VYES} \text{ and } N \in\mathsf{VYES} ( M , v c , v t ) = ( N , v c ′ , v t ′ ) = yes iff M ∈ VYES and N ∈ VYES
( M , v c , v t ) = ( N , v c ′ , v t ′ ) = n o iff M ∈ V N O and N ∈ V N O (M, v_c, v_t) = (N, v_c', v_t') = \mathrm{no} \text{ iff } M \in\mathsf{VNO} \text{ and } N \in\mathsf{VNO} ( M , v c , v t ) = ( N , v c ′ , v t ′ ) = no iff M ∈ VNO and N ∈ VNO
( M , v c , v t ) = ( N , v c ′ , v t ′ ) = e n d iff M ∈ V E N D and N ∈ V E N D (M, v_c, v_t) = (N, v_c', v_t') = \mathrm{end} \text{ iff } M \in\mathsf{VEND} \text{ and } N \in\mathsf{VEND} ( M , v c , v t ) = ( N , v c ′ , v t ′ ) = end iff M ∈ VEND and N ∈ VEND
For example, we write m → θ y e s m \xrightarrow{\theta} \mathrm{yes} m θ yes if there exists a state ( N , v c , v t ) (N, v_c, v_t) ( N , v c , v t ) with N ∈ V Y E S N \in\mathsf{VYES} N ∈ VYES reachable from m m m along θ \theta θ , and similarly m → θ i n e v y e s m \xrightarrow{\theta}_{\mathrm{inev}} \mathrm{yes} m θ inev yes if all states ( N , v c , v t ) (N, v_c, v_t) ( N , v c , v t ) reachable along θ \theta θ from m m m satisfy N ∈ V Y E S N \in\mathsf{VYES} N ∈ VYES .
Instrumentation
The notion of a monitor “performing an action” is in fact misleading, since a monitor is supposed to be a passive entity that follows an SUM. We need an operator to compose a monitor with an SUM accordingly; this is known as instrumentation . In the following, we define the rules of the instrumentation operator ◃ \triangleleft ◃ , adapted to the timed settings from [2 ] . Hereafter, recall M = ⟨ S M , L , ⟶ M ⟩ \mathcal{M} = \langle S_{\mathcal{M}}, \mathcal{L}, \longrightarrow_{\mathcal{M}} \rangle M = ⟨ S M , L , ⟶ M ⟩ the TLTS describing the behaviour of all monitors, and let P = ⟨ S P , L a b , ⟶ P ⟩ \mathcal{P} = \langle S_{\mathcal{P}}, \mathit{Lab}, \longrightarrow_{\mathcal{P}} \rangle P = ⟨ S P , Lab , ⟶ P ⟩ be an arbitrary TLTS describing the behaviour of an SUM. That is, we do not assume any particular form of states in S P S_{\mathcal{P}} S P or rules in ⟶ P \longrightarrow_{\mathcal{P}} ⟶ P , since the SUM can be e.g., a blackbox system.
Definition 4.9 (Instrumentation). We define the monitored system using the instrumentation operator ◃ \triangleleft ◃ as follows:
M ◃ P = ⟨ S M × S P , L a b , ⟶ ◃ ⟩ \mathcal{M} \triangleleft\mathcal{P} = \langle S_{\mathcal{M}} \times S_{\mathcal{P}}, \mathit{Lab}, \longrightarrow_{\triangleleft} \rangle M ◃ P = ⟨ S M × S P , Lab , ⟶ ◃ ⟩ The transition relation ⟶ ◃ \longrightarrow_{\triangleleft} ⟶ ◃ is defined in Figure 12 , where m , m ′ ∈ S M m, m' \in S_{\mathcal{M}} m , m ′ ∈ S M , p , p ′ ∈ S P p, p' \in S_{\mathcal{P}} p , p ′ ∈ S P , α ∈ L \alpha\in\mathcal{L} α ∈ L and a ∈ A c t a \in\mathit{Act} a ∈ Act . To save notations, we use m ◃ p m \triangleleft p m ◃ p for ( m , p ) ∈ S M × S P (m,p) \in S_{\mathcal{M}} \times S_{\mathcal{P}} ( m , p ) ∈ S M × S P .
Figure 12. SOS rules for Instrumentation.
Rule iMon states that the monitor must follow any action or delay transition performed by the SUM. That is, if the SUM performs a delay d ∈ R ≥ 0 d \in\mathbb{R}_{\ge0} d ∈ R ≥ 0 or an action a ∈ A c t a \in\mathrm{Act} a ∈ Act transition, the monitor takes the same transition with the SUM provided it is able to. The rule iAsy corresponds to the SUM performing a τ \tau τ transition. Finally, if the SUM may perform an action a a a and the monitor may not, rule iTer allows the SUM to perform a a a while forcing the monitor to reach a verdict state e n d \mathit{end} end .
Remark 4.10. Note that iTer is defined only for actions and not for time delays. This is because a monitor can always perform time delays (rule mTime, Figure 10 ) and therefore it can always follow the SUM if it performs a delay.
In summary, the rules iMon and iAsy in Figure 12 correspond to classical parallel composition with strong synchronisation over actions (and delays), and standard interleaving semantics for τ \tau τ transitions. The only difference resides within the rule iTer that forces the monitor to reach a verdict state e n d \mathit{end} end whenever it cannot follow the SUM.
Preserving the SUM behaviours
We prove that the instrumentation operator preserves the behaviours of the SUM, i.e., a monitor instrumented with the SUM follows the SUM when possible and never alters its behaviour. This is done through a proof of strong timed bisimulation . Hereafter, let T \mathcal{T} T the set of all TLTSs over L a b \mathsf{Lab} Lab .
Definition 4.11 (Timed bisimulation [1 ] ). A binary relation R \mathcal{R} R over the set of states of a TLTS is a strong timed bisimulation iff whenever s 1 R s 2 s_1\mathcal{R}s_2 s 1 R s 2 , for every α ∈ L a b \alpha\in\mathsf{Lab} α ∈ Lab :
if s 1 → α s 1 ′ s_1 \xrightarrow{\alpha} s_1' s 1 α s 1 ′ then there is a transition s 2 → α s 2 ′ s_2 \xrightarrow{\alpha} s_2' s 2 α s 2 ′ and s 1 ′ R s 2 ′ s_1'\mathcal{R}s_2' s 1 ′ R s 2 ′
if s 2 → α s 2 ′ s_2 \xrightarrow{\alpha} s_2' s 2 α s 2 ′ then there is a transition s 1 → α s 1 ′ s_1 \xrightarrow{\alpha} s_1' s 1 α s 1 ′ and s 1 ′ R s 2 ′ s_1'\mathcal{R}s_2' s 1 ′ R s 2 ′
Two states s s s and s ′ s' s ′ are strongly timed bisimilar, written s ≈ s s ′ s \approx_s s' s ≈ s s ′ , iff there is a strong timed bisimulation that relates them.
Using Definition 4.11, in order to prove that instrumenting any SUM P P P with any monitor M M M preserves exactly all the behaviours of P P P , if suffices to prove the following lemma.
Lemma 4.12. ∀ P ∈ T , p ∈ S P , m ∈ S M : m ⊲ p ≈ s p \forall P \in\mathcal{T}, p \in S_P, m \in S_M : m \lhd p \approx_s p ∀ P ∈ T , p ∈ S P , m ∈ S M : m ⊲ p ≈ s p .
Accordingly, given a finite run θ ∈ L a b ∗ \theta\in\mathsf{Lab}^{*} θ ∈ Lab ∗ , performed by the SUM, we say that a monitor consumes the weak run θ ′ ∈ L ∗ \theta' \in\mathcal{L}^{*} θ ′ ∈ L ∗ corresponding to θ \theta θ (§ 2.1 ).
Example 4.13. Let us consider the monitor M M M , starting at state m 0 = ( M , 0 , 0 ) m_0 = (M, 0, 0) m 0 = ( M , 0 , 0 ) (Example 4.5 ), and an SUM performing a finite run θ = 2 τ 4 τ c \theta= 2\tau4\tau c θ = 2 τ 4 τ c from state p p p to state p ′ p' p ′ . We have then m 0 ⊲ p → θ y e s ⊲ p ′ m_0 \lhd p \xrightarrow{\theta} \mathit{yes} \lhd p' m 0 ⊲ p θ yes ⊲ p ′ , which corresponds to M M M consuming θ ′ = 6 c \theta' = 6c θ ′ = 6 c , the weak finite run
corresponding to θ \theta θ . Informally, the monitor M M M checks the following property at runtime: “if the first consumed action occurs within 5 time units, then such action must be a b b b ”.
Abstracting Away the Instrumentation Operator
In [10 Sect. 5.1.1] , we abstracted away the instrumentation operator through considering only reactive monitors, i.e., monitors that can follow any run from any state of any SUM (that is, consume any run in L ∗ L^* L ∗ ) as states the following definition.
Definition 4.14 (Monitor Reactivity). A monitor M ∈ M o n M \in\mathrm{Mon} M ∈ Mon is reactive iff ∀ θ ∈ L ∗ , v c ∈ R ≥ 0 , v t ∈ V : ( M , v c , v t ) → θ \forall\theta\in L^*, v_c \in\mathbb{R}_{\ge0}, v_t \in\mathcal{V} : (M, v_c, v_t) \xrightarrow{\theta} ∀ θ ∈ L ∗ , v c ∈ R ≥ 0 , v t ∈ V : ( M , v c , v t ) θ
In a linear-time setting, the set of behaviours of an SUM equals the set of its infinite runs, thus all behaviours of all SUMs simply collapse into all infinite runs in L a b ω \mathrm{Lab}^{\omega} Lab ω . We could write accordingly m → θ m ′ m \xrightarrow{\theta} m' m θ m ′ to denote a monitor consuming weak run θ \theta θ , abstracting away SUMs and the instrumentation operator: the former replaced with the sum of all infinite runs in L a b ω \mathrm{Lab}^{\omega} Lab ω and the latter collapsing into simple consumption of weak runs that is always possible thanks to the reactivity assumption. The downside of adopting this choice is the fact that our maximality results in [10 ] were proven w.r.t. reactive monitors only, a subset of the set of all monitors M o n \mathrm{Mon} Mon .
In this extension, we get rid of the reactivity assumption while preserving all monitorability results, including the ones on maximality. The standard technique to do so is to translate each monitor into a reactive one that is verdict-equivalent as in [2 ] . However, the adoption of such technique in our timed setting would give an extremely complex procedure, if such exists, due to the high expressive power of M o n \mathrm{Mon} Mon . Our approach is to avoid this translation altogether: we allow monitors to be “syntactically” non-reactive, and instead enforce reactivity at the semantics level. That is, we introduce new, more flexible semantics for monitors that we refer to as reactive semantics .
Definition 4.15 (Reactive semantics). The reactive semantics of monitors is given by the TLTS M r = ⟨ S M , L , ⟶ M r ⟩ \mathcal{M}_{r} = \langle S_{\mathrm{M}}, \mathcal{L}, \longrightarrow_{\mathrm{M}_{r}} \rangle M r = ⟨ S M , L , ⟶ M r ⟩ where:
⟶ M r = ⟶ M ∪ ⟶ e \longrightarrow_{\mathrm{M}_{r}} = \longrightarrow_{\mathrm{M}} \cup\longrightarrow_{e} ⟶ M r = ⟶ M ∪ ⟶ e with
⟶ e = { ( ( M , v c , v t ) , a , ( E N D , v c , v t ) ) ∣ ( M , v c , v t ) → a M } \longrightarrow_{e} = \{((M, v_c, v_t), a, (\mathrm{END}, v_c, v_t)) \mid(M, v_c, v_t) \xrightarrow{a}_{\mathrm{M}} \} ⟶ e = {(( M , v c , v t ) , a , ( END , v c , v t )) ∣ ( M , v c , v t ) a M }
In a nutshell, the above definition extends the original semantics with a new set of transitions that allows a monitor to reach an end state on actions it cannot perform at a given time. Now, the new, light instrumentation rules (Figure 13 ) will guide the monitor through the possible transitions, therefore forcing it to follow the SUM, and reach an end state if and only if and exactly when it cannot do so.
Figure 13. SOS rules for (light) Instrumentation.
In other words, the rules of the new set of transitions
→ e = { ( ( M , v c , v t ) , a , ( E N D , v c , v t ) ) ∣ ( M , v c , v t ) → a M m } \mathrel{\xrightarrow{\ }}_{\mathrm{e}} = \{((M,v_c,v_t),a,(\mathrm{END},v_c,v_t)) \mid(M,v_c,v_t) \mathrel{\xrightarrow{a}}_{\mathrm{M}} m\} e = {(( M , v c , v t ) , a , ( END , v c , v t )) ∣ ( M , v c , v t ) a M m }
replace the iTER rule in the original version of the instrumentation (Figure 12 ), giving thereby exactly the same outcome when monitoring an SUM, as states the following lemma.
Lemma 4.16. ∀ P ∈ T , p , p ′ ∈ S P , m , m ′ ∈ S M , θ ∈ L ∗ \forall P \in\mathcal{T},p,p' \in S_P,m,m' \in S_M,\theta\in L^* ∀ P ∈ T , p , p ′ ∈ S P , m , m ′ ∈ S M , θ ∈ L ∗ :
m ◃ r p ⇒ θ ◃ r m ′ ◃ r p ′ ⇔ m ◃ p ⇒ θ ◃ m ′ ◃ p ′ m \mathrel{\triangleleft_r} p \mathrel{\xRightarrow{\theta}}_{\triangleleft_r} m' \mathrel{\triangleleft_r} p' \Leftrightarrow m \mathrel{\triangleleft} p \mathrel{\xRightarrow{\theta}}_{\triangleleft} m' \mathrel{\triangleleft} p' m ◃ r p θ ◃ r m ′ ◃ r p ′ ⇔ m ◃ p θ ◃ m ′ ◃ p ′
Example 4.17. Let A c t = { b , c } \mathrm{Act} = \{b,c\} Act = { b , c } , M = l e t x i n ( ( x > 5 ) . Y E S + ( x ≤ 4 ) . ( b . Y E S + c . N O ) ) M = \mathrm{let}\ x\ \mathrm{in}\ ((x > 5).\mathrm{YES} + (x \le4).(b.\mathrm{YES} + c.\mathrm{NO})) M = let x in (( x > 5 ) . YES + ( x ≤ 4 ) . ( b . YES + c . NO )) , and let m 0 = ( M , 0 , 0 ) m_0 = (M,0,0) m 0 = ( M , 0 , 0 ) . The monitor M M M is clearly not reactive: it does not know what to do for any 4 < x ≤ 5 4 < x \le5 4 < x ≤ 5 . Let us analyse the behaviour of M M M (starting at m 0 m_0 m 0 ) instrumented with P P P , an SUM that produces an infinite run starting at state p 1 p_1 p 1 with 5 b 5\,b 5 b , and with P ′ P' P ′ , another SUM performing an infinite run starting at state p 1 ′ p'_1 p 1 ′ with 2 τ c 2\,\tau\,c 2 τ c . We denote by p 2 , p 3 , … p_2,p_3,\ldots p 2 , p 3 , … the successors of p 1 p_1 p 1 and p 2 ′ , p 3 ′ , … p'_2,p'_3,\ldots p 2 ′ , p 3 ′ , … those of p 1 ′ p'_1 p 1 ′ . In each case, we show that the outcome using the original monitors TLTS M M M with the original instrumentation relation ◃ \triangleleft ◃ coincides with that using the new monitors TLTS M r M_r M r with the new instrumentation relation ◃ r \triangleleft_r ◃ r .
Now, abstracting the new instrumentation operator and SUMs follows the same reasoning of [10 ] (explained above), but requires no more the monitors to be reactive. We obtain the same results on monitorability as in [10 ] , yet without any loss of generality w.r.t. all monitors in MON. The only statement that was dependent on the reactivity assumption was [10 Lemma D.2.] . It suffices therefore to prove here that the same lemma (Lemma 4.18 below) holds now for all monitors under the new reactive semantics. Hereafter, we drop the subscript M r M_r M r from (weak or strong) transition symbols whenever clear from the context.
Lemma 4.18. For every M , N ∈ M O N M,N \in\mathrm{MON} M , N ∈ MON , every v c , v t v_c,v_t v c , v t , and θ \theta θ :
( M 1 ⊗ M 2 , v c , v t ) → θ n o (M_1 \otimes M_2,v_c,v_t) \xrightarrow{\theta} \mathrm{no} ( M 1 ⊗ M 2 , v c , v t ) θ no iff ( M 1 , v c , v t ) → θ n o (M_1,v_c,v_t) \xrightarrow{\theta} \mathrm{no} ( M 1 , v c , v t ) θ no or ( M 2 , v c , v t ) → θ n o (M_2,v_c,v_t) \xrightarrow{\theta} \mathrm{no} ( M 2 , v c , v t ) θ no .
( M 1 ⊗ M 2 , v c , v t ) → θ y e s (M_1 \otimes M_2,v_c,v_t) \xrightarrow{\theta} \mathrm{yes} ( M 1 ⊗ M 2 , v c , v t ) θ yes iff ( M 1 , v c , v t ) → θ y e s (M_1,v_c,v_t) \xrightarrow{\theta} \mathrm{yes} ( M 1 , v c , v t ) θ yes and ( M 2 , v c , v t ) → θ y e s (M_2,v_c,v_t) \xrightarrow{\theta} \mathrm{yes} ( M 2 , v c , v t ) θ yes .
( M 1 ⊕ M 2 , v c , v t ) → θ y e s (M_1 \oplus M_2,v_c,v_t) \xrightarrow{\theta} \mathrm{yes} ( M 1 ⊕ M 2 , v c , v t ) θ yes iff ( M 1 , v c , v t ) → θ y e s (M_1,v_c,v_t) \xrightarrow{\theta} \mathrm{yes} ( M 1 , v c , v t ) θ yes or ( M 2 , v c , v t ) → θ y e s (M_2,v_c,v_t) \xrightarrow{\theta} \mathrm{yes} ( M 2 , v c , v t ) θ yes .
( M 1 ⊕ M 2 , v c , v t ) → θ n o (M_1 \oplus M_2,v_c,v_t) \xrightarrow{\theta} \mathrm{no} ( M 1 ⊕ M 2 , v c , v t ) θ no iff ( M 1 , v c , v t ) → θ n o (M_1,v_c,v_t) \xrightarrow{\theta} \mathrm{no} ( M 1 , v c , v t ) θ no and ( M 2 , v c , v t ) → θ n o (M_2,v_c,v_t) \xrightarrow{\theta} \mathrm{no} ( M 2 , v c , v t ) θ no .
Proof. We present only the proof of Item 1, as the proofs of the other cases are similar. We proceed by induction on ∣ θ ∣ |\theta| ∣ θ ∣ . When ∣ θ ∣ = 0 |\theta| = 0 ∣ θ ∣ = 0 , we have M ⊗ N ∈ V N O M \otimes N \in\mathrm{VNO} M ⊗ N ∈ VNO iff M ∈ V N O M \in\mathrm{VNO} M ∈ VNO or N ∈ V N O N \in\mathrm{VNO} N ∈ VNO by Fig. 11. When ∣ θ ∣ = k + 1 |\theta| = k + 1 ∣ θ ∣ = k + 1 ,
⟹ \Longrightarrow ⟹ ) We have ( M 1 ⊗ M 2 , v c , v t ) → α m ⇒ θ ′ n o (M_1 \otimes M_2, v_c, v_t) \xrightarrow{\alpha} m \xRightarrow{\theta'} \mathrm{no} ( M 1 ⊗ M 2 , v c , v t ) α m θ ′ no . If M 1 ⊗ M 2 ∈ E M_1 \otimes M_2 \in E M 1 ⊗ M 2 ∈ E , then by Lemma 4.8 we have M 1 ⊗ M 2 ∈ V N O M_1 \otimes M_2 \in\mathrm{VNO} M 1 ⊗ M 2 ∈ VNO , hence M 1 ∈ V N O M_1 \in\mathrm{VNO} M 1 ∈ VNO or M 2 ∈ V N O M_2 \in\mathrm{VNO} M 2 ∈ VNO . We then conclude by successive applications of rules mTIME and mACT. Otherwise, either α ∈ R ≥ 0 \alpha\in\mathbb{R}_{\geq0} α ∈ R ≥ 0 , in which case the first transition is obtained by rule mTIME, yielding m = ( M 1 ⊗ M 2 , v c + α , v t ) m = (M_1 \otimes M_2, v_c + \alpha, v_t) m = ( M 1 ⊗ M 2 , v c + α , v t ) , and we conclude by the inductive hypothesis together with rule mTIME; or α ∈ A C T \alpha\in\mathrm{ACT} α ∈ ACT , in which case rule mPAR applies, producing m = ( M 1 ′ ⊗ M 2 ′ , v c , v t 1 ⊔ v t 2 ) m = (M'_1 \otimes M'_2, v_c, v_{t_1} \sqcup v_{t_2}) m = ( M 1 ′ ⊗ M 2 ′ , v c , v t 1 ⊔ v t 2 ) such that ( M i , v c , v t ) → α ( M i ′ , v c , v t i ) (M_i, v_c, v_t) \xrightarrow{\alpha} (M'_i, v_c, v_{t_i}) ( M i , v c , v t ) α ( M i ′ , v c , v t i ) . By the inductive hypothesis, for some i ∈ { 1 , 2 } i \in\{1,2\} i ∈ { 1 , 2 } we have ( M i ′ , v c , v t 1 ⊔ v t 2 ) ⇒ θ ′ n o (M'_i, v_c, v_{t_1} \sqcup v_{t_2}) \xRightarrow{\theta'} \mathrm{no} ( M i ′ , v c , v t 1 ⊔ v t 2 ) θ ′ no . Since the variables bound in M 1 M_1 M 1 and M 2 M_2 M 2 are distinct, it follows that ( M i ′ , v c , v t i ) ⇒ θ ′ n o (M'_i, v_c, v_{t_i}) \xRightarrow{\theta'} \mathrm{no} ( M i ′ , v c , v t i ) θ ′ no for the same i i i . Thus, we conclude that ( M i , v c , v t ) → α ( M i ′ , v c , v t i ) ⇒ θ ′ n o (M_i, v_c, v_t) \xrightarrow{\alpha} (M'_i, v_c, v_{t_i}) \xRightarrow{\theta'} \mathrm{no} ( M i , v c , v t ) α ( M i ′ , v c , v t i ) θ ′ no for some i ∈ { 1 , 2 } i \in\{1,2\} i ∈ { 1 , 2 } , as required.
⟸ \Longleftarrow ⟸ ) Suppose ( M 1 , v c , v t ) ⇒ θ n o (M_1, v_c, v_t) \xRightarrow{\theta} \mathrm{no} ( M 1 , v c , v t ) θ no . If α ∈ R ≥ 0 \alpha\in\mathbb{R}_{\geq0} α ∈ R ≥ 0 , rule mTIME gives ( M 1 , v c , v t ) → α ( M 1 , v c + α , v t ) ⇒ θ ′ n o (M_1, v_c, v_t) \xrightarrow{\alpha} (M_1, v_c + \alpha, v_t) \xRightarrow{\theta'} \mathrm{no} ( M 1 , v c , v t ) α ( M 1 , v c + α , v t ) θ ′ no ; by the inductive hypothesis ( M 1 ⊗ M 2 , v c + α , v t ) ⇒ θ ′ n o (M_1 \otimes M_2, v_c + \alpha, v_t) \xRightarrow{\theta'} \mathrm{no} ( M 1 ⊗ M 2 , v c + α , v t ) θ ′ no , and we conclude again by mTIME. If α ∈ A C T \alpha\in\mathrm{ACT} α ∈ ACT , then ( M 1 , v c , v t ) → α ( M 1 ′ , v c , v t ′ ) ⇒ θ ′ n o (M_1, v_c, v_t) \xrightarrow{\alpha} (M'_1, v_c, v'_{t}) \xRightarrow{\theta'} \mathrm{no} ( M 1 , v c , v t ) α ( M 1 ′ , v c , v t ′ ) θ ′ no for some M 1 ′ , v t ′ M'_1, v'_t M 1 ′ , v t ′ , and by Definition 4.15 there exist M 2 ′ , v t ′ ′ M'_2, v''_t M 2 ′ , v t ′′ with ( M 2 , v c , v t ) → α ( M 2 ′ , v c , v t ′ ′ ) (M_2, v_c, v_t) \xrightarrow{\alpha} (M'_2, v_c, v''_t) ( M 2 , v c , v t ) α ( M 2 ′ , v c , v t ′′ ) . Since M 1 ′ M'_1 M 1 ′ and M 2 ′ M'_2 M 2 ′ have distinct timestamp variables, ( M 1 ′ , v c , v t ′ ⊔ v t ′ ′ ) ⇒ θ ′ n o (M'_1, v_c, v'_t \sqcup v''_t) \xRightarrow{\theta'} \mathrm{no} ( M 1 ′ , v c , v t ′ ⊔ v t ′′ ) θ ′ no , and by the inductive hypothesis ( M 1 ′ ⊗ M 2 ′ , v c , v t ′ ⊔ v t ′ ′ ) ⇒ θ ′ n o (M'_1 \otimes M'_2, v_c, v'_t \sqcup v''_t) \xRightarrow{\theta'} \mathrm{no} ( M 1 ′ ⊗ M 2 ′ , v c , v t ′ ⊔ v t ′′ ) θ ′ no . Finally, rule mPAR yields ( M 1 ⊗ M 2 , v c , v t ) → α ( M 1 ′ ⊗ M 2 ′ , v c , v t ′ ⊔ v t ′ ′ ) ⇒ θ ′ n o (M_1 \otimes M_2, v_c, v_t) \xrightarrow{\alpha} (M'_1 \otimes M'_2, v_c, v'_t \sqcup v''_t) \xRightarrow{\theta'} \mathrm{no} ( M 1 ⊗ M 2 , v c , v t ) α ( M 1 ′ ⊗ M 2 ′ , v c , v t ′ ⊔ v t ′′ ) θ ′ no , as required.
Monitorability of T l i n T^{\mathrm{lin}} T lin
In this section, we present the monitorability results on T l i n T^{\mathrm{lin}} T lin . First, in line with existing literature, we set the framework within which we establish such results (§ 5.1 ). Afterwards, in § 5.3 , we develop a compiler from T l i n T^{\mathrm{lin}} T lin to sound monitors. We identify subsequently C T l i n CT^{\mathrm{lin}} C T lin , a complete-monitorable fragment of T l i n T^{\mathrm{lin}} T lin , i.e., containing formulae that are monitorable for both satisfactions and violations (§ 5.4 ). Then, in § 5.6 , we identify S T l i n ST^{\mathrm{lin}} S T lin (resp. V T l i n VT^{\mathrm{lin}} V T lin ), a fragment of T l i n T^{\mathrm{lin}} T lin formulae that are satisfaction monitorable (resp. violation monitorable), and accordingly define M T l i n = S T l i n ∪ V T l i n MT^{\mathrm{lin}} = ST^{\mathrm{lin}} \cup VT^{\mathrm{lin}} M T lin = S T lin ∪ V T lin as a fragment of monitorable formulae in T l i n T^{\mathrm{lin}} T lin . Finally, we prove that V T l i n VT^{\mathrm{lin}} V T lin , S T l i n ST^{\mathrm{lin}} S T lin , M T l i n MT^{\mathrm{lin}} M T lin and C T l i n CT^{\mathrm{lin}} C T lin are, respectively, the largest violation-monitorable, satisfaction-monitorable, monitorable and complete-monitorable fragments of T l i n T^{\mathrm{lin}} T lin w.r.t. to the monitoring language M o n \mathrm{Mon} Mon (§ 5.8 ). The proofs not included in the body of this section may be found in [10 Appendix F] .
Setting the framework
Monitor Initial State
Intuitively, in order to assess whether M M M can monitor ϕ \phi ϕ , monitoring should start at state m 0 = ( M , 0 , 0 ) m_0 = (M, 0, 0) m 0 = ( M , 0 , 0 ) . That is, monitor M M M is initialised at state m 0 m_0 m 0 , at which its time (monitor time) starts. Since monitor time may only increase (through consuming delays), it refers to the relative time since the monitoring of ϕ \phi ϕ started. Examples of a monitor M M M starting at state m 0 m_0 m 0 have been already discussed within the previous section, e.g., in Example 4.5.
Timed Words, Weak Runs and Time Divergence
First, we make an important, yet natural assumption on infinite timed words, namely time divergence . To explain this, let us consider the following infinite timed word: π = ( a 1 , 1 2 ) , ( a 2 , 3 4 ) , ( a 3 , 7 8 ) , ( a 4 , 15 16 ) , … \pi= (a_1,\frac{1}{2}),(a_2,\frac{3}{4}),(a_3,\frac{7}{8}),(a_4,\frac{15}{16}),\ldots π = ( a 1 , 2 1 ) , ( a 2 , 4 3 ) , ( a 3 , 8 7 ) , ( a 4 , 16 15 ) , … , i.e., where the delay between two consecutive actions is halved each time a new action occurs. This results in the timestamps of π \pi π increasing but never beyond absolute time 1 (since ∑ k = 1 ∞ ( 1 2 k ) = 1 \sum_{k=1}^{\infty}(\frac{1}{2^k})=1 ∑ k = 1 ∞ ( 2 k 1 ) = 1 ). The infinite timed word π \pi π is time convergent , and it is clear to see that there is no real system that can produce such timed word; for the simple reason that time always diverges in reality (see e.g., [33 , 9 ] [24 Sect.2] ). Therefore, when reasoning about whether an infinite timed word is or is not in the semantics of some formula, for monitorability purposes, we restrict ourselves to the set of time-divergent infinite timed words. Time divergence can be expressed in the standard manner as follows. An infinite timed word π \pi π is time divergent iff its timestamps are unbounded, formally [33 Sect. 4] , [8 Def. 1] , [25 Def. 2.4] :
∀ x ∈ R , ∃ i ∈ N : t i ( π ) > x (6) \forall x \in\mathbb{R},\ \exists i \in\mathbb{N}: t_i(\pi) > x \tag*{(6)} ∀ x ∈ R , ∃ i ∈ N : t i ( π ) > x (6)
We define accordingly the set T A c t d i v ω ⊂ T A c t ω \mathrm{TAct}^{\omega}_{\mathrm{div}} \subset\mathrm{TAct}^{\omega} TAct div ω ⊂ TAct ω as all infinite timed words that satisfy (6).
Second, as we will see later on, central notions on monitorability, such as monitor soundness and completeness, gravitate around the ability to reach a verdict, w.r.t. whether an infinite timed word π ∈ T A c t d i v ω \pi\in\mathrm{TAct}^{\omega}_{\mathrm{div}} π ∈ TAct div ω is in the semantics of the monitored formula, based on consuming a finite prefix of π \pi π . We need therefore to define the notion of consuming a finite timed word. Since (i) we already defined the notion of consuming a weak run (§ 4 ), and (ii) a finite timed word necessarily corresponds to a finite weak run in L ∗ \mathcal{L}^{*} L ∗ (§ 2.2 ), we simply need to define a function to retrieve the latter from the former.
Definition 5.1 (From finite timed words to finite weak runs).
T r n : T A c t ∗ ⟶ L ∗ \mathrm{Trn} : \mathrm{TAct}^{*} \longrightarrow\mathcal{L}^{*} Trn : TAct ∗ ⟶ L ∗ where T r n ( π ) = d 1 a 1 d 2 a 2 … \mathrm{Trn}(\pi)=d_1a_1d_2a_2\ldots Trn ( π ) = d 1 a 1 d 2 a 2 … with d i = t i − t i − 1 d_i=t_i-t_{i-1} d i = t i − t i − 1 and t 0 = 0 t_0=0 t 0 = 0 , and the convention that T r n ( π ) \mathrm{Trn}(\pi) Trn ( π ) gives the empty weak run ϵ \epsilon ϵ if π \pi π is an empty timed word.
In the remainder of this paper, by abuse of terminology, we often say a monitor “consumes (the finite timed word) π \pi π ” instead of “consumes (the finite weak run) T r n ( π ) \mathrm{Trn}(\pi) Trn ( π ) ”
Example 5.2. Consider the finite timed word π = ( a , 1.7 ) ( b , 1.7 ) ( b , 5.7 ) \pi=(a,1.7)(b,1.7)(b,5.7) π = ( a , 1.7 ) ( b , 1.7 ) ( b , 5.7 ) . The corresponding weak run is obtained using Definition 5.1: T r n ( π ) = 1.7 a 0 b 4 b \mathrm{Trn}(\pi)=1.7\,a\,0\,b\,4\,b Trn ( π ) = 1.7 a 0 b 4 b .
Monitor Soundness and Completeness
We now define the central monitor properties of soundness and completeness extended from [2 Definition 4.1] to our timed setting.
Monitor soundness.
Intuitively, a monitor M M M is sound for a formula ϕ \phi ϕ iff, for a given finite timed word π \pi π , if the monitor consumes π \pi π and reaches a verdict state yes (resp. no), then any infinite extension of π \pi π (§ 2.2 ) is in the semantics of ϕ \phi ϕ (resp. not in the semantics of ϕ \phi ϕ ).
Definition 5.4 (Monitor Soundness). A monitor M M M is sound for a formula ϕ ∈ T l i n \phi\in T^{\mathrm{lin}} ϕ ∈ T lin if, for every finite timed word π ∈ T A c t ∗ \pi\in TAct^{*} π ∈ T A c t ∗ :
m 0 → Trn ( π ) y e s m_0 \xrightarrow{\operatorname{Trn}(\pi)} \mathrm{yes} m 0 Trn ( π ) yes implies ( ∀ π ′ ∈ E x t ( π ) : π ′ ∈ ⟦ ϕ ⟧ ) (\forall\pi' \in Ext(\pi): \pi' \in\llbracket\phi\rrbracket) ( ∀ π ′ ∈ E x t ( π ) : π ′ ∈ [ [ ϕ ] ] )
m 0 → Trn ( π ) n o m_0 \xrightarrow{\operatorname{Trn}(\pi)} \mathrm{no} m 0 Trn ( π ) no implies ( ∀ π ′ ∈ E x t ( π ) : π ′ ∉ ⟦ ϕ ⟧ ) (\forall\pi' \in Ext(\pi): \pi' \notin\llbracket\phi\rrbracket) ( ∀ π ′ ∈ E x t ( π ) : π ′ ∈ / [ [ ϕ ] ] )
Sound monitors have the important property of consistency . Intuitively, a monitor M M M is consistent if for any finite timed word π \pi π , there exists no two ways for M M M , starting from m 0 m_0 m 0 , to consume π \pi π and reach yes following one and no following the other.
Definition 5.5 (Consistent monitors). A monitor M M M is consistent iff ∀ π ∈ T A c t ∗ \forall\pi\in TAct^{*} ∀ π ∈ T A c t ∗ :
m 0 → Trn ( π ) y e s m_0 \xrightarrow{\operatorname{Trn}(\pi)} \mathrm{yes} m 0 Trn ( π ) yes implies m 0 → Trn ( π ) n o m_0 \xrightarrow{\operatorname{Trn}(\pi)} \mathrm{no} m 0 Trn ( π ) no and m 0 → Trn ( π ) n o m_0 \xrightarrow{\operatorname{Trn}(\pi)} \mathrm{no} m 0 Trn ( π ) no implies m 0 → Trn ( π ) y e s m_0 \xrightarrow{\operatorname{Trn}(\pi)} \mathrm{yes} m 0 Trn ( π ) yes
Lemma 5.6. If M M M is sound for some ϕ ∈ T l i n \phi\in T^{\mathrm{lin}} ϕ ∈ T lin then M M M is consistent.
Proof. Let π \pi π be a finite timed word. Assume M M M is sound for ϕ \phi ϕ and m 0 → Trn ( π ) y e s m_0 \xrightarrow{\operatorname{Trn}(\pi)} \mathrm{yes} m 0 Trn ( π ) yes . Then for all π ′ ∈ E x t ( π ) \pi' \in Ext(\pi) π ′ ∈ E x t ( π ) we have π ′ ∈ ⟦ ϕ ⟧ \pi' \in\llbracket\phi\rrbracket π ′ ∈ [ [ ϕ ] ] . Now assume that there is a way to consume π \pi π and reach no, that is m 0 → Trn ( π ) n o m_0 \xrightarrow{\operatorname{Trn}(\pi)} \mathrm{no} m 0 Trn ( π ) no . Then for all π ′ ∈ E x t ( π ) \pi' \in Ext(\pi) π ′ ∈ E x t ( π ) we have π ′ ∉ ⟦ ϕ ⟧ \pi' \notin\llbracket\phi\rrbracket π ′ ∈ / [ [ ϕ ] ] . Contradiction. The proof for the second clause, assuming M M M is sound for ϕ \phi ϕ and m 0 → Trn ( π ) n o m_0 \xrightarrow{\operatorname{Trn}(\pi)} \mathrm{no} m 0 Trn ( π ) no is analogous.
Monitor completeness.
A monitor M M M is complete for a formula ϕ \phi ϕ if it is both violation and satisfaction complete for ϕ \phi ϕ . Intuitively, a monitor M M M is violation (resp. satisfaction) complete for ϕ \phi ϕ iff, for any time-divergent timed word π \pi π , if π \pi π is in (resp. is not in) the semantics of ϕ \phi ϕ , then there exists π ′ \pi' π ′ , a finite prefix of π \pi π , such that the monitor inevitably reaches a verdict state yes (resp. no) after consuming π ′ \pi' π ′ .
Definition 5.7 (Monitor Completeness). Let M ∈ M o n M \in Mon M ∈ M o n be a monitor and ϕ ∈ T l i n \phi\in T^{\mathrm{lin}} ϕ ∈ T lin a formula.
M M M is violation complete for ϕ \phi ϕ if, for all π ∈ T A c t d i v ω \pi\in TAct^{\omega}_{\mathrm{div}} π ∈ T A c t div ω :
π ∉ ⟦ ϕ ⟧ \pi\notin\llbracket\phi\rrbracket π ∈ / [ [ ϕ ] ] implies ∃ π ′ ∈ P f ( π ) : m 0 → Trn ( π ′ ) i n e v n o \exists\pi' \in Pf(\pi): m_0 \xrightarrow{\operatorname{Trn}(\pi')}_{\mathrm{inev}} \mathrm{no} ∃ π ′ ∈ P f ( π ) : m 0 Trn ( π ′ ) inev no
M M M is satisfaction complete for ϕ \phi ϕ if, for all π ∈ T A c t d i v ω \pi\in TAct^{\omega}_{\mathrm{div}} π ∈ T A c t div ω :
π ∈ ⟦ ϕ ⟧ \pi\in\llbracket\phi\rrbracket π ∈ [ [ ϕ ] ] implies ∃ π ′ ∈ P f ( π ) : m 0 → Trn ( π ′ ) i n e v y e s \exists\pi' \in Pf(\pi): m_0 \xrightarrow{\operatorname{Trn}(\pi')}_{\mathrm{inev}} \mathrm{yes} ∃ π ′ ∈ P f ( π ) : m 0 Trn ( π ′ ) inev yes
M M M is complete for ϕ \phi ϕ if it is both violation and satisfaction complete for ϕ \phi ϕ .
Sound monitor synthesis
As stated in Theorem 3.12, there exists no algorithm to decide whether a T l i n T^{lin} T l in formula ϕ \phi ϕ is valid or satisfiable, which is already the case for the less expressive TPTL and MTL (Theorem 2.10, Theorem 2.13). Therefore, our approach to isolate monitorable fragments of T l i n T^{lin} T l in relies on a fully syntactic sound monitor synthesis using an intuitive correspondence between formulae in T l i n T^{lin} T l in and monitors in Mon. We then reduce the monitorability of a formula to the (violation or satisfaction) completeness of its (synthesised) monitor. Of course, this syntax-driven approach does not guarantee that if the synthesised monitor is not violation or satisfaction complete, then the underlying formula is not monitorable, which is expected given the undecidability of T l i n T^{lin} T l in satisfiability/validity. However, this drawback is attenuated by our maximality results (more in § 5.8 ).
The synthesis procedure relies on an intuitive compiler from T l i n T^{lin} T l in to Mon having the following important property: for every formula ϕ ∈ T l i n \phi\in T^{lin} ϕ ∈ T l in , the compiler outputs a monitor that is sound for ϕ \phi ϕ (Proposition 5.10).
The compiler ⟦ − ⟧ : T l i n ⟶ M o n \llbracket-\rrbracket:T^{lin}\longrightarrow\mathrm{Mon} [ [ − ] ] : T l in ⟶ Mon is defined in Figure 14 , where we include box modalities for convenience (note that monitors generated by ⟦ − ⟧ \llbracket-\rrbracket [ [ − ] ] are necessarily closed since ⟦ − ⟧ \llbracket-\rrbracket [ [ − ] ] is applied only to formulae, i.e., elements of T l i n T^{lin} T l in ). The rules of ⟦ − ⟧ \llbracket-\rrbracket [ [ − ] ] are rather simple and straightforward, operating on the syntax of the formula provided as an input. For example, if the formula is [ a ] ⟨ b ⟩ t t [a]\langle b\rangle\mathrm{tt} [ a ] ⟨ b ⟩ tt , whose semantics is “if the first action is a a a , then the second must be a b b b ” (Section 3.1), then we want a monitor that consumes the first action, and becomes verdict YES if such action is not a a a , and monitors that the second action is a b b b otherwise. We obtain thus the monitor ⟦ [ a ] ⟨ b ⟩ t t ⟧ = a . ( b . Y E S + b ˉ . n o ) + a ˉ . Y E S \llbracket[a]\langle b\rangle\mathrm{tt}\rrbracket=a.(b.\mathrm{YES}+\bar{b}.\mathrm{no})+\bar{a}.\mathrm{YES} [ [ [ a ] ⟨ b ⟩ tt ] ] = a . ( b . YES + b ˉ . no ) + a ˉ . YES , which corresponds to the description above (under the rules defined in § 4.1 ).
!Rules ( ⟦ − ⟧ ) (\llbracket-\rrbracket) ( [ [ − ] ] ) from T l i n T^{lin} T l in to monitors: ⟦ t t ⟧ = Y E S \llbracket\mathrm{tt}\rrbracket=\mathrm{YES} [ [ tt ] ] = YES , ⟦ f f ⟧ = N O \llbracket\mathrm{ff}\rrbracket=\mathrm{NO} [ [ ff ] ] = NO ; ⟦ x i n ϕ ⟧ = L E T x i n ⟦ ϕ ⟧ \llbracket x\ \mathrm{in}\ \phi\rrbracket=\mathrm{LET}\ x\ \mathrm{in}\ \llbracket\phi\rrbracket [ [ x in ϕ ] ] = LET x in [ [ ϕ ] ] , ⟦ X ⟧ = X \llbracket X\rrbracket=X [ [ X ] ] = X ; ⟦ [ a ] ϕ ⟧ = a . ⟦ ϕ ⟧ + a ˉ . Y E S \llbracket[a]\phi\rrbracket=a.\llbracket\phi\rrbracket+\bar{a}.\mathrm{YES} [ [ [ a ] ϕ ] ] = a . [ [ ϕ ] ] + a ˉ . YES , ⟦ ⟨ a ⟩ ϕ ⟧ = a . ⟦ ϕ ⟧ + a ˉ . N O \llbracket\langle a\rangle\phi\rrbracket=a.\llbracket\phi\rrbracket+\bar{a}.\mathrm{NO} [ [ ⟨ a ⟩ ϕ ] ] = a . [ [ ϕ ] ] + a ˉ . NO ; ⟦ [ g ] ϕ ⟧ = g . ⟦ ϕ ⟧ + g ˉ . Y E S \llbracket[g]\phi\rrbracket=g.\llbracket\phi\rrbracket+\bar{g}.\mathrm{YES} [ [ [ g ] ϕ ] ] = g . [ [ ϕ ] ] + g ˉ . YES , ⟦ ⟨ g ⟩ ϕ ⟧ = g . ⟦ ϕ ⟧ + g ˉ . N O \llbracket\langle g\rangle\phi\rrbracket=g.\llbracket\phi\rrbracket+\bar{g}.\mathrm{NO} [ [ ⟨ g ⟩ ϕ ] ] = g . [ [ ϕ ] ] + g ˉ . NO ; ⟦ ϕ ∧ ψ ⟧ = ⟦ ϕ ⟧ ⊗ ⟦ ψ ⟧ \llbracket\phi\land\psi\rrbracket=\llbracket\phi\rrbracket\otimes\llbracket\psi\rrbracket [ [ ϕ ∧ ψ ] ] = [ [ ϕ ] ] ⊗ [ [ ψ ] ] , ⟦ ϕ ∨ ψ ⟧ = ⟦ ϕ ⟧ ⊕ ⟦ ψ ⟧ \llbracket\phi\lor\psi\rrbracket=\llbracket\phi\rrbracket\oplus\llbracket\psi\rrbracket [ [ ϕ ∨ ψ ] ] = [ [ ϕ ] ] ⊕ [ [ ψ ] ] ; ⟦ max ( X , ϕ ) ⟧ = rec X . ⟦ ϕ ⟧ \llbracket\max(X,\phi)\rrbracket=\operatorname{rec} X.\llbracket\phi\rrbracket [ [ max ( X , ϕ ) ] ] = rec X . [ [ ϕ ] ] , ⟦ min ( X , ϕ ) ⟧ = rec X . ⟦ ϕ ⟧ \llbracket\min(X,\phi)\rrbracket=\operatorname{rec} X.\llbracket\phi\rrbracket [ [ min ( X , ϕ ) ] ] = rec X . [ [ ϕ ] ] bbox=0.19,0.10,0.84,0.31
Figure 14. ⟦ − ⟧ \llbracket-\rrbracket [ [ − ] ] rules from T l i n T^{lin} T l in to monitors, defined recursively on subterms of formulae.
Example 5.9. The monitor M M M in Example 4.5 is compiled from the formula x i n [ x ≤ 5 ] ⟨ b ⟩ t t x\ \mathrm{in}\ [x\leq5]\langle b\rangle\mathrm{tt} x in [ x ≤ 5 ] ⟨ b ⟩ tt (Example 3.4 ) over A c t = { b , c } \mathrm{Act}=\{b,c\} Act = { b , c } . More complex examples will follow.
Proposition 5.10. For all ϕ ∈ T l i n \phi\in T^{lin} ϕ ∈ T l in , ⟦ ϕ ⟧ \llbracket\phi\rrbracket [ [ ϕ ] ] is sound for $\phi.
The other important property of our compiler is determinism , i.e., for any formula ϕ \phi ϕ and any finite timed word π \pi π , there is only one way to consume T r n ( π ) \mathrm{Trn}(\pi) Trn ( π ) from ( ⟦ ϕ ⟧ , 0 , 0 ) (\llbracket\phi\rrbracket,0,0) ( [ [ ϕ ] ] , 0 , 0 ) , as states the following proposition.
Proposition 5.11. For all ϕ ∈ T l i n \phi\in T^{lin} ϕ ∈ T l in and π ∈ T A c t ∗ \pi\in TAct^{*} π ∈ T A c t ∗ , there exists m ∈ S M m \in S_{\mathrm{M}} m ∈ S M such that ( ⟦ ϕ ⟧ , 0 , 0 ) → T r n ( π ) i n e v m (\llbracket\phi\rrbracket,0,0) \xrightarrow[\mathrm{Trn}(\pi)]{\mathrm{inev}} m ( [ [ ϕ ] ] , 0 , 0 ) inev Trn ( π ) m .
The above proposition ensured a deterministic implementation of our compiler and the monitoring procedure thereof [11 ] .
Complete Monitorable Fragment
In this subsection, we identify C T l i n CT^{lin} C T l in , a subset of T l i n T^{lin} T l in , and prove its complete monitorability (Theorem 5.22 ).
Definition 5.12 (Complete-monitorable formulae). A formula ϕ ∈ T l i n \phi\in T^{lin} ϕ ∈ T l in is complete monitorable iff there exists a monitor M M M that is sound and complete for it. A fragment Γ ⊆ T l i n \Gamma\subseteq T^{lin} Γ ⊆ T l in is complete monitorable iff each ϕ ∈ Γ \phi\in\Gamma ϕ ∈ Γ is complete monitorable.
It has been shown in [2 ] that the recursion-free fragment of the untimed linear-time μ \mu μ -calculus (μ \mu μ -HML) is its largest complete-monitorable fragment. We show that this result does not hold in the timed setting, i.e., the maximal set of complete-monitorable formulae in T l i n T^{lin} T l in is strictly larger than that of μ \mu μ -HML. To explain this, let us first prove a handy lemma. Recall that D \mathcal{D} D is the set of timestamp variables and V \mathcal{V} V all valuation functions over D \mathcal{D} D (Section 3.1).
Lemma 5.13. Let y ∈ D y \in\mathcal{D} y ∈ D and n ∈ N n \in\mathbb{N} n ∈ N . For all π ∈ T A c t d i v ω \pi\in TAct^{\omega}_{div} π ∈ T A c t d i v ω , x ∈ D ∖ { y } x \in\mathcal{D} \setminus\{y\} x ∈ D ∖ { y } , v ∈ V v \in\mathcal{V} v ∈ V , g ∈ B ( D ) g \in\mathcal{B}(\mathcal{D}) g ∈ B ( D ) :
∃ i ∈ N > 0 \exists i \in\mathbb{N}_{>0} ∃ i ∈ N > 0 such that v [ x : = t i ( π ) ] ⊭ ( x − y ≺ n ) ∧ g v[x := t_i(\pi)] \not\models(x-y \prec n) \land g v [ x := t i ( π )] ⊨ ( x − y ≺ n ) ∧ g ,
∀ i ∈ N > 0 \forall i \in\mathbb{N}_{>0} ∀ i ∈ N > 0 : v [ x : = t i ( π ) ] ⊭ ( x − y ≺ n ) v[x := t_i(\pi)] \not\models(x-y \prec n) v [ x := t i ( π )] ⊨ ( x − y ≺ n ) implies ∀ j ≥ i \forall j \ge i ∀ j ≥ i : v [ x : = t j ( π ) ] ⊭ ( x − y ≺ n ) ∧ g v[x := t_j(\pi)] \not\models(x-y \prec n) \land g v [ x := t j ( π )] ⊨ ( x − y ≺ n ) ∧ g .
Proof. Item 1 is a direct consequence of time divergence (§ 5.1 ). Suppose for a contradiction, for all i > 0 i > 0 i > 0 , v [ x : = t i ( π ) ] ⊨ ( x − y ≺ n ) ∧ g v[x := t_i(\pi)] \models(x-y \prec n) \land g v [ x := t i ( π )] ⊨ ( x − y ≺ n ) ∧ g . This implies that for all i > 0 i > 0 i > 0 , t i ( π ) ≺ n + v ( y ) t_i(\pi) \prec n + v(y) t i ( π ) ≺ n + v ( y ) , which contradicts condition (6).
Item 2 is a direct consequence of monotonicity of timestamps (§ 2 ). Assume v [ x : = t i ( π ) ] ⊭ ( x − y ≺ n ) v[x := t_i(\pi)] \not\models(x-y \prec n) v [ x := t i ( π )] ⊨ ( x − y ≺ n ) . This implies that t i ( π ) ⊀ n + v ( y ) t_i(\pi) \not\prec n + v(y) t i ( π ) ≺ n + v ( y ) . Since the timestamps of π \pi π are monotonically increasing, we have for all j ≥ i j \ge i j ≥ i , t j ( π ) ⊀ n + v ( y ) t_j(\pi) \not\prec n + v(y) t j ( π ) ≺ n + v ( y ) wich implies v [ x : = t j ( π ) ] ⊭ ( x − y ≺ n ) ∧ g v[x := t_j(\pi)] \not\models(x-y \prec n) \land g v [ x := t j ( π )] ⊨ ( x − y ≺ n ) ∧ g .
Let us depict the consequences of the above lemma through a few examples.
Example 5.14. Consider the formula ϕ = min ( Y , ⟨ b ⟩ t t ∨ ⟨ A c t ⟩ Y ) \phi= \min(Y,\langle b\rangle\mathit{tt} \lor\langle Act\rangle Y) ϕ = min ( Y , ⟨ b ⟩ tt ∨ ⟨ A c t ⟩ Y ) , meaning “action b b b will be seen now or in the future” (which is equivalent to the MTL formula ◊ b \Diamond_{\!b} ◊ b ). Clearly, there is no violation-complete monitor for ϕ \phi ϕ , because there is no way for a monitor to say no based on a finite timed word not containing b b b (since a b b b can occur later on). In contrast, ϕ \phi ϕ is monitorable for satisfactions: it suffices for the monitor to see a b b b to say yes. Now, in a (time) constrained setting, i.e., whenever we use a bounded interval I I I (with R B ( I ) ∈ N RB(I) \in\mathbb{N} R B ( I ) ∈ N , Definition 2.4), ϕ \phi ϕ becomes both satisfaction and violation monitorable, and therefore complete monitorable. Consider the following formula:
ϕ c = x s i n min ( Y , ( x e i n [ x e − x s ∈ [ 5 , 8 ] ] ⟨ b ⟩ t t ) ∨ ⟨ A c t ⟩ Y ) \phi_c = x_s \mathbin{\mathsf{in}} \min(Y,(x_e \mathbin{\mathsf{in}} [x_e-x_s \in[5,8]]\langle b\rangle\mathit{tt}) \lor\langle Act\rangle Y) ϕ c = x s in min ( Y , ( x e in [ x e − x s ∈ [ 5 , 8 ]] ⟨ b ⟩ tt ) ∨ ⟨ A c t ⟩ Y ) which means "eventually b b b will occur within [ 5 , 8 ] [5,8] [ 5 , 8 ] ". The guard x e − x s ∈ [ 5 , 8 ] x_e-x_s \in[5,8] x e − x s ∈ [ 5 , 8 ] is of the form x − y ≺ n ∧ g x-y \prec n \land g x − y ≺ n ∧ g where y = x s y=x_s y = x s (constant), n = 8 n=8 n = 8 (constant), x = x e x=x_e x = x e , ≺ = ≤ \prec=\le ≺=≤ , g = x e − x s < 5 g=x_e-x_s<5 g = x e − x s < 5 , and x e x_e x e diverges after a finite number of recursions (because time diverges and Y Y Y is guarded by ⟨ A c t ⟩ \langle Act\rangle ⟨ A c t ⟩ ). Therefore, by Lemma 5.13, x e − x s ∈ [ 5 , 8 ] x_e-x_s \in[5,8] x e − x s ∈ [ 5 , 8 ] will become false after a finite number
of recursions, and will remain false indefinitely afterwards. It follows that the monitor can safely say no when the guard becomes false (which means that the consumed prefix until then did not contain any action b b b between 5 and 8).
Example 5.15. Let us now consider the more complex leads to formula
ψ = max ( X , [ b ] f f ∨ min ( Y , ⟨ c ⟩ t t ∨ ⟨ A c t ⟩ Y ) ∧ ⟨ A c t ⟩ X ) \psi= \max(X,[b]\mathrm{ff} \lor\min(Y,\langle c\rangle\mathrm{tt} \lor\langle\mathrm{Act}\rangle Y) \land\langle\mathrm{Act}\rangle X) ψ = max ( X , [ b ] ff ∨ min ( Y , ⟨ c ⟩ tt ∨ ⟨ Act ⟩ Y ) ∧ ⟨ Act ⟩ X ) stipulating that “whenever an action b b b occurs, an action c c c follows in the future” (which is equivalent to the MTL formula □ ≤ ( b → ◊ ≤ c ) \Box^{\leq}(b \rightarrow\Diamond^{\leq} c) □ ≤ ( b → ◊ ≤ c ) ). As explained in § 1 , this property is not monitorable in any sense (neither for satisfactions nor for violations). Now consider the following formula, a constrained version of ψ \psi ψ :
ψ c = x s i n max ( Y , ( x e i n [ x e − x s ∈ [ 1 , 3 ] ] ( [ b ] f f ∨ ζ ) ) ∧ ( ⟨ A c t ⟩ Y ) ) \psi_c = x_s\ \mathop{\mathrm{in}}\ \max(Y,(x_e\ \mathop{\mathrm{in}}[x_e-x_s \in[1,3]]([b]\mathrm{ff} \lor\zeta)) \land(\langle\mathrm{Act}\rangle Y)) ψ c = x s in max ( Y , ( x e in [ x e − x s ∈ [ 1 , 3 ]] ([ b ] ff ∨ ζ )) ∧ (⟨ Act ⟩ Y )) with:
ζ = x s ′ i n min ( X , ( x e ′ i n ⟨ x e ′ − x s ′ ∈ [ 2 , 5 ] ⟩ ⟨ c ⟩ t t ) ∨ ( ⟨ A c t ⟩ X ) ) \zeta= x'_s\ \mathop{\mathrm{in}}\ \min(X,(x'_e\ \mathop{\mathrm{in}}\langle x'_e-x'_s \in[2,5]\rangle\langle c\rangle\mathrm{tt}) \lor(\langle\mathrm{Act}\rangle X)) ζ = x s ′ in min ( X , ( x e ′ in ⟨ x e ′ − x s ′ ∈ [ 2 , 5 ]⟩ ⟨ c ⟩ tt ) ∨ (⟨ Act ⟩ X )) That is, the constrained bounded response formula ψ c ′ \psi'_c ψ c ′ requires only b b b actions within the bounded interval [ 1 , 3 ] [1,3] [ 1 , 3 ] to be followed by a c c c . Besides, any such b b b must have within the bounded interval [ 2 , 5 ] [2,5] [ 2 , 5 ] , relative to its occurrence, its c c c “response”. Notice how ψ c ′ \psi'_c ψ c ′ is also complete monitorable. If no b b b occurs between 1 and 3, the monitor can safely say yes (when the right bound of [ 1 , 3 ] [1,3] [ 1 , 3 ] is exceeded). Otherwise, for every b b b occurring between 1 and 3, a (sub)monitor checks whether a c c c occurs between 2 and 5 (relative to the occurrence of such b b b ), and says no if it is not the case. Since [ 2 , 5 ] [2,5] [ 2 , 5 ] is bounded, the monitor can decide the latest after 5 time units since the last occurrence of b b b between 1 and 3.
Example 5.16. Let us now consider the formulae given in Example 3.5 , not expressible in TPTL/MTL. The formula
φ e v e n ( b ) = max ( X , ⟨ A c t ⟩ ⟨ b ⟩ X ) \varphi_{\mathrm{even}(b)} = \max(X,\langle\mathrm{Act}\rangle\langle b\rangle X) φ even ( b ) = max ( X , ⟨ Act ⟩ ⟨ b ⟩ X ) is violation monitorable (a monitor can say no as soon as it sees an action at an even position different than b b b ), but is not satisfaction monitorable. Now, following the same reasoning as in the previous examples (applying Lemma 5.13 ), the formula
φ e v e n ( b ) , [ 3 , 5 ] = x s i n max ( X , ⟨ a c t ⟩ ( x e i n ⟨ x e − x s ∈ [ 3 , 5 ] ⟩ ⟨ b ⟩ X ∨ y i n ⟨ y − x s ∉ [ 3 , 5 ] ⟩ ⟨ A c t ⟩ X ) ) \varphi_{\mathrm{even}(b),[3,5]} = x_s\ \mathop{\mathrm{in}}\ \max(X,\langle\mathrm{act}\rangle(x_e\ \mathop{\mathrm{in}}\langle x_e-x_s \in[3,5]\rangle\langle b\rangle X \lor y\ \mathop{\mathrm{in}}\langle y-x_s \notin[3,5]\rangle\langle\mathrm{Act}\rangle X)) φ even ( b ) , [ 3 , 5 ] = x s in max ( X , ⟨ act ⟩ ( x e in ⟨ x e − x s ∈ [ 3 , 5 ]⟩ ⟨ b ⟩ X ∨ y in ⟨ y − x s ∈ / [ 3 , 5 ]⟩ ⟨ Act ⟩ X )) is complete monitorable.
Syntactic characterisation.
In order to characterise a sufficiently expressive syntax for complete-monitorable formulae, we remark the following. Formulae φ c \varphi_c φ c (Example 5.14 ) is equivalent to the following formulae:
φ c ′ = x s i n min ( Y , ( x e i n ⟨ x e − x s ∈ [ 5 , 8 ] ⟩ ⟨ b ⟩ t t ) ∨ y i n ⟨ y − x s ≤ 8 ⟩ ⟨ A c t ⟩ Y ) \varphi'_c = x_s\ \mathop{\mathrm{in}}\ \min(Y,(x_e\ \mathop{\mathrm{in}}\langle x_e-x_s \in[5,8]\rangle\langle b\rangle\mathrm{tt}) \lor y\ \mathop{\mathrm{in}}\langle y-x_s \leq8\rangle\langle\mathrm{Act}\rangle Y) φ c ′ = x s in min ( Y , ( x e in ⟨ x e − x s ∈ [ 5 , 8 ]⟩ ⟨ b ⟩ tt ) ∨ y in ⟨ y − x s ≤ 8 ⟩ ⟨ Act ⟩ Y )
because when the monitor time exceeds the right bound of [ 5 , 8 ] [5,8] [ 5 , 8 ] , then there is no need to check if ⟨ b ⟩ t t \langle b\rangle\mathrm{tt} ⟨ b ⟩ tt is satisfied, and therefore recursion can be prevented (and the monitor can say no at this stage).
Formula ψ c \psi_c ψ c in Example 5.15 can be transformed similarly to the following equivalent formula:
x s i n max ( Y , ( x e i n [ x e − x s ∈ [ 1 , 3 ] ] ( [ b ] f f ∨ ζ ′ ) ) ∧ ( y i n ⟨ y − x s ≤ 3 ⟩ ⟨ A c t ⟩ Y ) ) x_s\ \mathop{\mathrm{in}}\ \max(Y,(x_e\ \mathop{\mathrm{in}}[x_e-x_s \in[1,3]]([b]\mathrm{ff} \lor\zeta')) \land(y\ \mathop{\mathrm{in}}\langle y-x_s \leq3\rangle\langle\mathrm{Act}\rangle Y)) x s in max ( Y , ( x e in [ x e − x s ∈ [ 1 , 3 ]] ([ b ] ff ∨ ζ ′ )) ∧ ( y in ⟨ y − x s ≤ 3 ⟩ ⟨ Act ⟩ Y ))
where:
ϕ , ψ : : = t t ∣ f f ∣ ϕ ∨ ψ ∣ ϕ ∧ ψ ∣ x i n ϕ ∣ ⟨ a ⟩ ϕ ∣ [ a ] ϕ ∣ ⟨ g ⟩ ϕ ∣ [ g ] ϕ ∣ max ( X , ϕ ) ∣ min ( X , ϕ ) ∣ x i n [ g x ] X ∣ x i n ⟨ g x ⟩ X g x : : = x < n ∣ x − y < n ∣ g x ∧ g \begin{aligned}
\phi,\psi&::= \mathsf{tt}\mid\mathsf{ff}\mid\phi\lor\psi\mid\phi\land\psi\mid x\mathbin{\mathrm{in}}\phi\\
&\mid\langle a\rangle\phi\mid[a]\phi\mid\langle g\rangle\phi\mid[g]\phi\\
&\mid\max(X,\phi)\mid\min(X,\phi)\mid x\mathbin{\mathrm{in}}[g_x]X\mid x\mathbin{\mathrm{in}}\langle g_x\rangle X\\
g_x&::=x<n\mid x-y<n\mid g_x\land g
\end{aligned} ϕ , ψ g x ::= tt ∣ ff ∣ ϕ ∨ ψ ∣ ϕ ∧ ψ ∣ x in ϕ ∣ ⟨ a ⟩ ϕ ∣ [ a ] ϕ ∣ ⟨ g ⟩ ϕ ∣ [ g ] ϕ ∣ max ( X , ϕ ) ∣ min ( X , ϕ ) ∣ x in [ g x ] X ∣ x in ⟨ g x ⟩ X ::= x < n ∣ x − y < n ∣ g x ∧ g
ζ ′ = x s ′ i n min ( X , ( x e ′ i n ⟨ x e ′ − x s ′ ∈ [ 2 , 5 ] ⟩ ⟨ c ⟩ t t ) ∨ ( z i n ⟨ z − x s ′ ≤ 5 ⟩ ⟨ A c t ⟩ X ) ) \zeta'=x'_s\mathbin{\mathrm{in}}\min(X,(x'_e\mathbin{\mathrm{in}}\langle x'_e-x'_s\in[2,5]\rangle\langle c\rangle\mathsf{tt})\lor(z\mathbin{\mathrm{in}}\langle z-x'_s\leq5\rangle\langle\mathsf{Act}\rangle X)) ζ ′ = x s ′ in min ( X , ( x e ′ in ⟨ x e ′ − x s ′ ∈ [ 2 , 5 ]⟩ ⟨ c ⟩ tt ) ∨ ( z in ⟨ z − x s ′ ≤ 5 ⟩ ⟨ Act ⟩ X ))
As for formula ϕ e v e n ( b ) , [ 3 , 5 ] \phi_{\mathrm{even}(b),[3,5]} ϕ even ( b ) , [ 3 , 5 ] in Example 5.16 , that can be rewritten similarly as follows:
x s i n max ( X , ⟨ a c t ⟩ ( x e i n ⟨ x e − x s ∈ [ 3 , 5 ] ⟩ ⟨ b ⟩ X ∨ y i n ( ⟨ y − x s < 3 ⟩ ⟨ A c t ⟩ X ∨ ⟨ y − x s > 5 ⟩ ⟨ A c t ⟩ t t ) ) ) x_s\mathbin{\mathrm{in}}\max(X,\langle act\rangle(x_e\mathbin{\mathrm{in}}\langle x_e-x_s\in[3,5]\rangle\langle b\rangle X\lor y\mathbin{\mathrm{in}}(\langle y-x_s<3\rangle\langle\mathsf{Act}\rangle X\lor\langle y-x_s>5\rangle\langle\mathsf{Act}\rangle\mathsf{tt}))) x s in max ( X , ⟨ a c t ⟩ ( x e in ⟨ x e − x s ∈ [ 3 , 5 ]⟩ ⟨ b ⟩ X ∨ y in (⟨ y − x s < 3 ⟩ ⟨ Act ⟩ X ∨ ⟨ y − x s > 5 ⟩ ⟨ Act ⟩ tt )))
since there is no need to recurse after the right bound of [ 3 , 5 ] [3,5] [ 3 , 5 ] is exceeded (in such case, the timed word is in the semantics of the formula).
More generally, in a complete-monitorable formula ϕ \phi ϕ , every subterm min ( X , ϕ ) \min(X,\phi) min ( X , ϕ ) or max ( X , ψ ) \max(X,\psi) max ( X , ψ ) is constrained. That is, in every subterm of ϕ \phi ϕ , every occurrence of recursion variable X X X is preceded by x i n ⟨ g ⟩ x\mathbin{\mathrm{in}}\langle g\rangle x in ⟨ g ⟩ or x i n [ g ] x\mathbin{\mathrm{in}}[g] x in [ g ] such that g g g becomes eventually false. To simplify the proofs, we use a straightforward syntactic manipulation in order to require recursion variables to be immediately preceded by x i n ⟨ g ⟩ x\mathbin{\mathrm{in}}\langle g\rangle x in ⟨ g ⟩ or x i n [ g ] x\mathbin{\mathrm{in}}[g] x in [ g ] through duplicating such terms modulo timestamp-variable renaming. For example, the formula
ζ ′ = x s ′ i n min ( X , ( x e ′ i n ⟨ x e ′ − x s ′ ∈ [ 2 , 5 ] ⟩ ⟨ c ⟩ t t ) ∨ ( z i n ⟨ z − x s ′ ≤ 5 ⟩ ⟨ A c t ⟩ X ) ) \zeta'=x'_s\mathbin{\mathrm{in}}\min(X,(x'_e\mathbin{\mathrm{in}}\langle x'_e-x'_s\in[2,5]\rangle\langle c\rangle\mathsf{tt})\lor(z\mathbin{\mathrm{in}}\langle z-x'_s\leq5\rangle\langle\mathsf{Act}\rangle X)) ζ ′ = x s ′ in min ( X , ( x e ′ in ⟨ x e ′ − x s ′ ∈ [ 2 , 5 ]⟩ ⟨ c ⟩ tt ) ∨ ( z in ⟨ z − x s ′ ≤ 5 ⟩ ⟨ Act ⟩ X ))
above is semantically equivalent to
ζ ′ ′ = x s ′ i n min ( X , ( x e ′ i n ⟨ x e ′ − x s ′ ∈ [ 2 , 5 ] ⟩ ⟨ c ⟩ t t ) ∨ ( z i n ⟨ z − x s ′ ≤ 5 ⟩ ⟨ A c t ⟩ y i n ⟨ y − x s ′ ≤ 5 ⟩ X ) ) \zeta''=x'_s\mathbin{\mathrm{in}}\min(X,(x'_e\mathbin{\mathrm{in}}\langle x'_e-x'_s\in[2,5]\rangle\langle c\rangle\mathsf{tt})\lor(z\mathbin{\mathrm{in}}\langle z-x'_s\leq5\rangle\langle\mathsf{Act}\rangle y\mathbin{\mathrm{in}}\langle y-x'_s\leq5\rangle X)) ζ ′′ = x s ′ in min ( X , ( x e ′ in ⟨ x e ′ − x s ′ ∈ [ 2 , 5 ]⟩ ⟨ c ⟩ tt ) ∨ ( z in ⟨ z − x s ′ ≤ 5 ⟩ ⟨ Act ⟩ y in ⟨ y − x s ′ ≤ 5 ⟩ X ))
In order to syntactically specify that some guard becomes unsatisfied after a finite number of recursions, we introduce cLVar, an infinite subset of logical variables Var, such that a variable that belongs to cLVar must appear in a particular form within the scope of a fixpoint operator.
Definition 5.17 (Complete-monitorable fragment). A formula ϕ ∈ T l i n \phi\in T^{lin} ϕ ∈ T l in is in the set C T l i n ⊂ T l i n CT^{lin}\subset T^{lin} C T l in ⊂ T l in of complete-monitorable formulae iff ϕ \phi ϕ is generated by the grammar in Figure 15 (with n ∈ N n\in\mathbb{N} n ∈ N , g ∈ B ( D ) g\in\mathcal{B}(\mathcal{D}) g ∈ B ( D ) , x , y ∈ D x,y\in\mathcal{D} x , y ∈ D and $X\in cLVar) and for all min ( X , ψ ) \min(X,\psi) min ( X , ψ ) , max ( X , ψ ) \max(X,\psi) max ( X , ψ ) subterms of ϕ \phi ϕ , y y y is free3 ^{3} 3 in ψ \psi ψ . A subterm max ( X , ϕ ) \max(X,\phi) max ( X , ϕ ) (resp. min ( X , ϕ ) \min(X,\phi) min ( X , ϕ ) ) of a formula in C T l i n CT^{lin} C T l in is called a constrained max (resp. constrained min).
Figure 15. Grammar to generate formulae (closed and guarded terms) of C T l i n CT^{lin} C T l in .
To prove that C T l i n CT^{lin} C T l in is complete monitorable, we show that ⟦ ϕ ⟧ \llbracket\phi\rrbracket [ [ ϕ ] ] is sound and complete for every ϕ ∈ C T l i n \phi\in CT^{lin} ϕ ∈ C T l in .
Proposition 5.18. For all ϕ ∈ C T l i n \phi\in CT^{lin} ϕ ∈ C T l in , ⟦ ϕ ⟧ \llbracket\phi\rrbracket [ [ ϕ ] ] is sound for ϕ \phi ϕ .
Proof. Since C T l i n ⊂ T l i n CT^{lin}\subset T^{lin} C T l in ⊂ T l in , we conclude by Proposition 5.10 . ◀
Proposition 5.19. For all ϕ ∈ C T l i n \phi\in CT^{lin} ϕ ∈ C T l in , ⟦ ϕ ⟧ \llbracket\phi\rrbracket [ [ ϕ ] ] is satisfaction complete for ϕ \phi ϕ .
Proposition 5.20. For all ϕ ∈ C T l i n \phi\in CT^{lin} ϕ ∈ C T l in , ⟦ ϕ ⟧ \llbracket\phi\rrbracket [ [ ϕ ] ] is violation complete for ϕ \phi ϕ .
Example 5.21. Consider the following formula:
ϕ = min ( X , ( x i n ‾ ⟨ x ∈ ( 3 , 7 ] ⟩ ⟨ b ⟩ y i n ‾ ⟨ y − x ∈ [ 0 , 2 ) ⟩ ⟨ c ⟩ t t ) ∨ z i n ‾ ⟨ z ≤ 7 ⟩ ⟨ A c t ⟩ X ) \phi= \min(X,(x\ \underline{\mathsf{in}}\langle x \in(3,7]\rangle\langle b\rangle y\ \underline{\mathsf{in}}\langle y-x \in[0,2)\rangle\langle c\rangle\mathsf{tt}) \vee z\ \underline{\mathsf{in}}\langle z \le7\rangle\langle\mathsf{Act}\rangle X) ϕ = min ( X , ( x in ⟨ x ∈ ( 3 , 7 ]⟩ ⟨ b ⟩ y in ⟨ y − x ∈ [ 0 , 2 )⟩ ⟨ c ⟩ tt ) ∨ z in ⟨ z ≤ 7 ⟩ ⟨ Act ⟩ X ) easily expressible in C T l i n CT^{lin} C T l in (see above), which expresses the following property “there exists an occurrence of b b b within the absolute interval ( 3 , 7 ] (3,7] ( 3 , 7 ] that is immediately followed by a c c c within the interval [ 0 , 2 ) [0,2) [ 0 , 2 ) ”; where “immediately followed by” means that there are no other actions occurring in between. In other words, the semantics of ϕ \phi ϕ contains all infinite timed words π \pi π such that there exists a position i i i with a i ( π ) = b a_i(\pi)=b a i ( π ) = b and t i ( π ) − t 1 ( π ) ∈ ( 3 , 7 ] t_i(\pi)-t_1(\pi)\in(3,7] t i ( π ) − t 1 ( π ) ∈ ( 3 , 7 ] and a i + 1 ( π ) = c a_{i+1}(\pi)=c a i + 1 ( π ) = c and t i + 1 ( π ) − t i ( π ) ∈ [ 0 , 2 ) t_{i+1}(\pi)-t_i(\pi)\in[0,2) t i + 1 ( π ) − t i ( π ) ∈ [ 0 , 2 ) . To compile ϕ \phi ϕ into a monitor, we first distribute over the disjunction ⟨ A c t ⟩ \langle\mathsf{Act}\rangle ⟨ Act ⟩ using a distinct timestamp variable z a z^a z a for each clause:
ϕ = min ( X , ( x i n ‾ ⟨ x ∈ ( 3 , 7 ] ⟩ ⟨ b ⟩ y i n ‾ ⟨ y − x ∈ [ 0 , 2 ) ⟩ ⟨ c ⟩ t t ) ∨ ⋁ a ∈ A c t z a i n ‾ ⟨ z a ≤ 7 ⟩ ⟨ a ⟩ X ) \phi= \min(X,(x\ \underline{\mathsf{in}}\langle x \in(3,7]\rangle\langle b\rangle y\ \underline{\mathsf{in}}\langle y-x \in[0,2)\rangle\langle c\rangle\mathsf{tt}) \vee\bigvee_{a\in\mathsf{Act}} z^a\ \underline{\mathsf{in}}\langle z^a \le7\rangle\langle a\rangle X) ϕ = min ( X , ( x in ⟨ x ∈ ( 3 , 7 ]⟩ ⟨ b ⟩ y in ⟨ y − x ∈ [ 0 , 2 )⟩ ⟨ c ⟩ tt ) ∨ a ∈ Act ⋁ z a in ⟨ z a ≤ 7 ⟩ ⟨ a ⟩ X ) Then apply the rules of our compiler to obtain:
M = ⟦ ϕ ⟧ = r e c X . ( ( L E T x I N ( ( ( x ∈ ( 3 , 7 ] ) . ( b . N + b ‾ . N O ) ) + ( x ∉ ( 3 , 7 ] ) . N O ) ) ⊕ ( ⨁ a ∈ A c t L E T z a I N ( ( ( z a ≤ 7 ) . ( a . X + a ‾ . N O ) ) + ( z a > 7 ) . N O ) ) ) w h e r e M=\llbracket\phi\rrbracket=\mathsf{rec}\ X.((\mathsf{LET}\ x\ \mathsf{IN}\ (((x\in(3,7]).(b.N+\overline{b}.\mathsf{NO}))+(x\notin(3,7]).\mathsf{NO}))\oplus(\bigoplus_{a\in\mathsf{Act}}\mathsf{LET}\ z^a\ \mathsf{IN}\ (((z^a\le7).(a.X+\overline{a}.\mathsf{NO}))+(z^a>7).\mathsf{NO})))\ \mathsf{where} M = [ [ ϕ ] ] = rec X . (( LET x IN ((( x ∈ ( 3 , 7 ]) . ( b . N + b . NO )) + ( x ∈ / ( 3 , 7 ]) . NO )) ⊕ ( a ∈ Act ⨁ LET z a IN ((( z a ≤ 7 ) . ( a . X + a . NO )) + ( z a > 7 ) . NO ))) where N = L E T y I N ( ( ( y − x ∈ [ 0 , 2 ) ) . ( c . Y E S + c ‾ . N O ) ) + ( y − x ∉ [ 0 , 2 ) ) . N O ) N=\mathsf{LET}\ y\ \mathsf{IN}\ (((y-x\in[0,2)).(c.\mathsf{YES}+\overline{c}.\mathsf{NO}))+(y-x\notin[0,2)).\mathsf{NO}) N = LET y IN ((( y − x ∈ [ 0 , 2 )) . ( c . YES + c . NO )) + ( y − x ∈ / [ 0 , 2 )) . NO ) Monitor M M M is sound and complete for ϕ \phi ϕ . From m 0 m_0 m 0 , if a verdict state yes is reached, then the monitor necessarily consumed a prefix π ∈ T A c t ∗ \pi\in\mathsf{TAct}^{*} π ∈ TAct ∗ such that a b b b occurred within ( 3 , 7 ) (3,7) ( 3 , 7 ) followed immediately by a c c c within ( 0 , 2 ] (0,2] ( 0 , 2 ] (L E T x I N ( x ∈ ( 3 , 7 ] ) . b . L E T y I N ( y − x ∈ [ 0 , 2 ] . c . Y E S ) \mathsf{LET}\ x\ \mathsf{IN}\ (x\in(3,7]).b.\mathsf{LET}\ y\ \mathsf{IN}\ (y-x\in[0,2].c.\mathsf{YES}) LET x IN ( x ∈ ( 3 , 7 ]) . b . LET y IN ( y − x ∈ [ 0 , 2 ] . c . YES ) ) and therefore any extension of π \pi π is in the semantics of ϕ \phi ϕ (the reasoning is dual for the cases where a verdict state no is reached). Similarly, for any π ∈ T A c t d i v ω \pi\in\mathsf{TAct}^{\omega}_{div} π ∈ TAct d i v ω in the semantics of ϕ \phi ϕ (resp. not in the semantics of ϕ \phi ϕ ), the monitor will inevitably reach a verdict state yes (resp. no) after consuming a finite prefix of π \pi π . For example, for any infinite timed word π \pi π with π 1 = ( a , 1 ) ( b , 7 ) ( c , 8.2 ) ∈ P f ( π ) \pi_1=(a,1)(b,7)(c,8.2)\in Pf(\pi) π 1 = ( a , 1 ) ( b , 7 ) ( c , 8.2 ) ∈ P f ( π ) (resp. π ′ \pi' π ′ with π 2 = ( a , 2 ) ( b , 3 ) ( c , 7.6 ) ∈ P f ( π ′ ) \pi_2=(a,2)(b,3)(c,7.6)\in Pf(\pi') π 2 = ( a , 2 ) ( b , 3 ) ( c , 7.6 ) ∈ P f ( π ′ ) ) we have m 0 → T r n ( π 1 ) i n e v y e s m_0 \xrightarrow{\mathsf{Trn}(\pi_1)}_{\mathsf{inev}\ \mathsf{yes}} m 0 Trn ( π 1 ) inev yes (resp. m 0 → T r n ( π 2 ) i n e v n o m_0 \xrightarrow{\mathsf{Trn}(\pi_2)}_{\mathsf{inev}\ \mathsf{no}} m 0 Trn ( π 2 ) inev no ).
Theorem 5.22. C T l i n CT^{lin} C T l in is complete monitorable.
Proof. For every ϕ ∈ C T l i n \phi\in CT^{lin} ϕ ∈ C T l in , ⟦ ϕ ⟧ \llbracket\phi\rrbracket [ [ ϕ ] ] is sound (Proposition 5.18), satisfaction complete (Proposition 5.19) and violation complete (Proposition 5.20) for ϕ \phi ϕ . It follows that C T l i n CT^{lin} C T l in is complete monitorable (Definition 5.12). ◀
Monitorable Fragment
In this subsection, we identify M T l i n MT^{lin} M T l in , a fragment of T l i n T^{lin} T l in , and prove its monitorability (Theorem 5.35).
Definition 5.23 (Monitorable formulae). ▪ A formula ϕ ∈ T l i n \phi\in T^{lin} ϕ ∈ T l in is violation (resp. satisfaction) monitorable iff there exists a monitor M M M that is sound and violation (resp. satisfaction) complete for ϕ \phi ϕ . A fragment Γ ⊆ T l i n \Gamma\subseteq T^{lin} Γ ⊆ T l in is violation (resp. satisfaction) monitorable iff each ϕ ∈ Γ \phi\in\Gamma ϕ ∈ Γ is violation (resp. satisfaction) monitorable.
▪ A formula ϕ ∈ T l i n \phi\in T^{lin} ϕ ∈ T l in is monitorable iff it is violation or satisfaction monitorable. A fragment Γ ⊆ T l i n \Gamma\subseteq T^{lin} Γ ⊆ T l in is monitorable iff each ϕ ∈ Γ \phi\in\Gamma ϕ ∈ Γ is monitorable.
In order to identify a monitorable fragment, let us first proceed with examples.
Example 5.24. Consider the following T l i n T^{lin} T l in formula:
ϕ = max ( Y , ( [ b ] f f ∨ ψ ) ∧ ( ⟨ A c t ⟩ Y ) ) \phi= \max(Y,([b]\mathrm{ff} \lor\psi) \land(\langle\mathrm{Act}\rangle Y)) ϕ = max ( Y , ([ b ] ff ∨ ψ ) ∧ (⟨ Act ⟩ Y )) with:
ψ = x s min ( X , ( x e min [ x e − x s ∈ I ] ⟨ c ⟩ t t ) ∨ ( ⟨ A c t ⟩ X ) ) \psi= x_s\ \min(X,(x_e\ \min[x_e-x_s \in I]\langle c\rangle\mathrm{tt}) \lor(\langle\mathrm{Act}\rangle X)) ψ = x s min ( X , ( x e min [ x e − x s ∈ I ] ⟨ c ⟩ tt ) ∨ (⟨ Act ⟩ X )) with I ∈ I I \in\mathcal{I} I ∈ I bounded (R B ( I ) ∈ N RB(I) \in\mathbb{N} R B ( I ) ∈ N ). Formula ϕ \phi ϕ expresses the important bounded response property exemplified in § 1 (equivalent to the MTL formula □ ( b ⇒ ◊ ≤ I c ) \Box(b \Rightarrow\Diamond_{\leq I} c) □ ( b ⇒ ◊ ≤ I c ) ). Notice how every min \min min subformula of ϕ \phi ϕ can be rewritten as a constrained min \min min (§ 5.4 ), whereas the max \max max subformulae are clearly unconstrained. Formula ϕ \phi ϕ is violation monitorable: after every occurrence of b b b , a (sub)monitor can check whether a c c c will follow within I I I (relative to such occurrence). Since I I I is bounded, such check always terminates (by Lemma 5.13 ), and a rejection verdict can be issued if no c c c occurred. However, this formula is not satisfaction monitorable.
Remark 5.25. Bounded response is not bounded-memory monitorable in the general case [44 ] (it is when I I I is left-closed at 0, see e.g., [6 ] ). While bounded-memory monitorability is out of this paper’s scope, realistic assumptions such as bounded variability can be adopted to enforce it [44 ] .
Example 5.26. Consider now the following T l i n T^{lin} T l in formula:
η = min ( Y , ( ( ⟨ b ⟩ t t ∧ ζ ) ∨ ⟨ A c t ⟩ Y ) ) \eta= \min(Y,((\langle b\rangle\mathrm{tt} \land\zeta) \lor\langle\mathrm{Act}\rangle Y)) η = min ( Y , ((⟨ b ⟩ tt ∧ ζ ) ∨ ⟨ Act ⟩ Y )) with:
ζ = x s min max ( X , ( x e min [ x e − x s ∈ I ] ⟨ c ⟩ t t ) ∧ ( ⟨ A c t ⟩ X ) ) \zeta= x_s\ \min\max(X,(x_e\ \min[x_e-x_s \in I]\langle c\rangle\mathrm{tt}) \land(\langle\mathrm{Act}\rangle X)) ζ = x s min max ( X , ( x e min [ x e − x s ∈ I ] ⟨ c ⟩ tt ) ∧ (⟨ Act ⟩ X )) with I ∈ I I \in\mathcal{I} I ∈ I bounded. Notice how every max \max max subformula of η \eta η can be rewritten as a constrained max \max max (§ 5.4 ), whereas the min \min min subformulae are clearly not constrained. Formula η \eta η is satisfaction monitorable: if a b b b occurs, a monitor can safely say yes if every action seen within I I I after such occurrence is a c c c (this process terminates, again thanks to Lemma 5.13 ). This formula is however not violation monitorable: any no verdict may be falsified by a future b b b after which every action within I I I is a c c c .
Syntactic characterisation.
The intuition is that both violation- and satisfaction-monitorable formulae will share the syntax of C T l i n CT^{lin} C T l in and differ for (unconstrained) minimal and maximal fixpoint operators. To simplify the syntax, we rely on the following proposition, proven in [10 Appendix E] , stating that the semantics of constrained min \min min and constrained max \max max coincide over time-divergent timed words. We let ⟦ ϕ ⟧ d i v = T A c t d i v ω ∩ ⟦ ϕ ⟧ \llbracket\phi\rrbracket^{div} = TAct^{\omega}_{div} \cap\llbracket\phi\rrbracket [ [ ϕ ] ] d i v = T A c t d i v ω ∩ [ [ ϕ ] ] .
Proposition 5.27. (a) For all max ( X , ϕ ) ∈ C T l i n \max(X,\phi) \in CT^{lin} max ( X , ϕ ) ∈ C T l in , ⟦ max ( X , ϕ ) ⟧ d i v = ⟦ min ( X , ϕ ) ⟧ d i v \llbracket\max(X,\phi)\rrbracket^{div} = \llbracket\min(X,\phi)\rrbracket^{div} [ [ max ( X , ϕ ) ] ] d i v = [ [ min ( X , ϕ ) ] ] d i v
(b) For all min ( X , ϕ ) ∈ C T l i n \min(X,\phi) \in CT^{lin} min ( X , ϕ ) ∈ C T l in , ⟦ min ( X , ϕ ) ⟧ d i v = ⟦ max ( X , ϕ ) ⟧ d i v \llbracket\min(X,\phi)\rrbracket^{div} = \llbracket\max(X,\phi)\rrbracket^{div} [ [ min ( X , ϕ ) ] ] d i v = [ [ max ( X , ϕ ) ] ] d i v
Accordingly, for violation-monitorable formulae, we do not need constrained min \min min in their syntax (Fig. 17). This is because constrained min \min min formulae can be rewritten as constrained max \max max formulae, and a constrained max \max max is a special case of max \max max . For example, in the bounded response property (Example 5.24), and after transforming ψ \psi ψ into a constrained min \min min (§ 5.4 ), the minimal fixpoint operator can be replaced with the maximal one without changing the semantics. Dually, we do not need constrained max \max max in the syntax of satisfaction-monitorable formulae (Fig. 16).
φ , ψ : : = t t ∣ f f ∣ φ ∨ ψ ∣ φ ∧ ψ ∣ x i n φ ∣ ⟨ a ⟩ φ ∣ [ a ] φ ∣ ⟨ g ⟩ φ ∣ [ g ] φ ∣ min ( X , φ ) ∣ X \begin{aligned}
\varphi,\psi&::= \mathrm{tt} \mid\mathrm{ff} \mid\varphi\lor\psi\mid\varphi\land\psi\mid x\ \mathrm{in}\ \varphi\\
&\mid\langle a\rangle\varphi\mid[a]\varphi\mid\langle g\rangle\varphi\mid[g]\varphi\\
&\mid\min(X,\varphi) \mid X
\end{aligned} φ , ψ ::= tt ∣ ff ∣ φ ∨ ψ ∣ φ ∧ ψ ∣ x in φ ∣ ⟨ a ⟩ φ ∣ [ a ] φ ∣ ⟨ g ⟩ φ ∣ [ g ] φ ∣ min ( X , φ ) ∣ X
Fig. 16. Grammar to generate formulae (closed and guarded terms) of S T l i n ST^{lin} S T l in .
φ , ψ : : = t t ∣ f f ∣ φ ∨ ψ ∣ φ ∧ ψ ∣ x i n φ ∣ ⟨ a ⟩ φ ∣ [ a ] φ ∣ ⟨ g ⟩ φ ∣ [ g ] φ ∣ max ( Y , φ ) ∣ Y \begin{aligned}
\varphi,\psi&::= \mathrm{tt} \mid\mathrm{ff} \mid\varphi\lor\psi\mid\varphi\land\psi\mid x\ \mathrm{in}\ \varphi\\
&\mid\langle a\rangle\varphi\mid[a]\varphi\mid\langle g\rangle\varphi\mid[g]\varphi\\
&\mid\max(Y,\varphi) \mid Y
\end{aligned} φ , ψ ::= tt ∣ ff ∣ φ ∨ ψ ∣ φ ∧ ψ ∣ x in φ ∣ ⟨ a ⟩ φ ∣ [ a ] φ ∣ ⟨ g ⟩ φ ∣ [ g ] φ ∣ max ( Y , φ ) ∣ Y
Fig. 17. Grammar to generate formulae (closed and guarded terms) of V T l i n VT^{lin} V T l in .
Definition 5.28 (Monitorable fragment). The set of monitorable formulae M T l i n ⊂ T l i n MT^{lin} \subset T^{lin} M T l in ⊂ T l in is the union of the set of violation-monitorable formulae (Fig. 17) and satisfaction-monitorable formulae (Fig. 16), i.e., M T l i n = V T l i n ∪ S T l i n MT^{lin} = VT^{lin} \cup ST^{lin} M T l in = V T l in ∪ S T l in .
To prove M T l i n MT^{lin} M T l in is monitorable, we rely on our compiler ⟦ − ⟧ \llbracket-\rrbracket [ [ − ] ] in a similar fashion to the proof of complete monitorability of C T l i n CT^{lin} C T l in (§ 5.4 ).
Proposition 5.29. For all φ ∈ M T l i n \varphi\in MT^{lin} φ ∈ M T l in , ⟦ φ ⟧ \llbracket\varphi\rrbracket [ [ φ ] ] is sound for φ \varphi φ .
Proof. Since M T l i n ⊂ T l i n MT^{lin} \subset T^{lin} M T l in ⊂ T l in , we conclude by Proposition 5.10.
Proposition 5.30. For all φ ∈ S T l i n \varphi\in ST^{lin} φ ∈ S T l in , ⟦ φ ⟧ \llbracket\varphi\rrbracket [ [ φ ] ] is satisfaction complete for φ \varphi φ .
Theorem 5.31. S T l i n ST^{lin} S T l in is satisfaction monitorable.
Proof. Direct from Proposition 5.29, Proposition 5.30 and Definition 5.23.
Proposition 5.32. For all φ ∈ V T l i n \varphi\in VT^{lin} φ ∈ V T l in , ⟦ φ ⟧ \llbracket\varphi\rrbracket [ [ φ ] ] is violation complete for φ \varphi φ .
Example 5.33. The formula φ e v e n ( b ) = max ( X , ⟨ A c t ⟩ ⟨ b ⟩ X ) \varphi_{\mathrm{even}(b)} = \max(X,\langle\mathrm{Act}\rangle\langle b\rangle X) φ even ( b ) = max ( X , ⟨ Act ⟩ ⟨ b ⟩ X ) (Example 3.5) is violation monitorable. Its compilation by ⟦ − ⟧ \llbracket-\rrbracket [ [ − ] ] gives the monitor
M = ⟦ φ e v e n ( b ) ⟧ = rec X . ( ⨁ a ∈ A c t a . ( b . X + b ˉ . N O ) + a ˉ . N O ) M = \llbracket\varphi_{\mathrm{even}(b)}\rrbracket= \operatorname{rec} X.(\bigoplus_{a\in\mathrm{Act}} a.(b.X + \bar{b}.\mathrm{NO}) + \bar{a}.\mathrm{NO}) M = [ [ φ even ( b ) ] ] = rec X . ( a ∈ Act ⨁ a . ( b . X + b ˉ . NO ) + a ˉ . NO ) and it is rather straightforward to see that M M M is sound and inevitably reaches verdict no (from m 0 m_0 m 0 ) when given any infinite timed word outside of the semantics of φ e v e n ( b ) \varphi_{\mathrm{even}(b)} φ even ( b ) . Indeed, for any infinite timed word π \pi π , we have π ∉ ⟦ φ e v e n ( b ) ⟧ \pi\notin\llbracket\varphi_{\mathrm{even}(b)}\rrbracket π ∈ / [ [ φ even ( b ) ] ] iff there exists a position i ∈ N > 1 i \in\mathbb{N}_{>1} i ∈ N > 1 , i m o d 2 = 0 i \bmod2 = 0 i mod 2 = 0 such that a i ( π ) ≠ b a_i(\pi) \ne b a i ( π ) = b . For any such π \pi π and the smallest such i i i , we have m 0 → Trn ( π ) i n e v n o m_0 \xrightarrow{\operatorname{Trn}(\pi)}_{\mathrm{inev}} \mathrm{no} m 0 Trn ( π ) inev no .
Theorem 5.34. V T l i n VT^{lin} V T l in is violation monitorable.
Proof. Direct from Proposition 5.29, Proposition 5.32 and Definition 5.23.
Theorem 5.35. M T l i n MT^{lin} M T l in is monitorable.
Proof. Direct from Theorem 5.31, Theorem 5.34, Definition 5.28 and Definition 5.23.
∥ M ∈ V Y E S ∥ = t t ∥ M ∈ V N O ∥ = ∥ M ∈ V E N D ∥ = f f ∥ l e t x i n M ∥ = x i n ∥ M ∥ ∥ M + N ∥ = ∥ M ∥ ∨ ∥ N ∥ ∥ M ⊕ N ∥ = ∥ M ∥ ∨ ∥ N ∥ ∥ M ⊗ N ∥ = ∥ M ∥ ∧ ∥ N ∥ ∥ a . M ∥ = ⟨ a ⟩ ∥ M ∥ ∥ g . M ∥ = ⟨ g ⟩ ∥ M ∥ ∥ X ∥ = X ∥ r e c X . M ∥ = min ( X , ∥ M ∥ ) \begin{aligned}
\lVert M \in\mathrm{VYES}\rVert&= \mathrm{tt} & \lVert M \in\mathrm{VNO}\rVert&= \lVert M \in\mathrm{VEND}\rVert= \mathrm{ff}\\
\lVert\mathrm{let}\ x\ \mathrm{in}\ M\rVert&= x\ \mathrm{in}\ \lVert M\rVert& \lVert M+N\rVert&= \lVert M\rVert\lor\lVert N\rVert\\
\lVert M\mathbin{\oplus}N\rVert&= \lVert M\rVert\lor\lVert N\rVert& \lVert M\mathbin{\otimes}N\rVert&= \lVert M\rVert\land\lVert N\rVert\\
\lVert a.M\rVert&= \langle a\rangle\lVert M\rVert& \lVert g.M\rVert&= \langle g\rangle\lVert M\rVert\\
\lVert X\rVert&= X & \lVert\mathrm{rec}\ X.M\rVert&= \min(X,\lVert M\rVert)
\end{aligned} ∥ M ∈ VYES ∥ ∥ let x in M ∥ ∥ M ⊕ N ∥ ∥ a . M ∥ ∥ X ∥ = tt = x in ∥ M ∥ = ∥ M ∥ ∨ ∥ N ∥ = ⟨ a ⟩ ∥ M ∥ = X ∥ M ∈ VNO ∥ ∥ M + N ∥ ∥ M ⊗ N ∥ ∥ g . M ∥ ∥ rec X . M ∥ = ∥ M ∈ VEND ∥ = ff = ∥ M ∥ ∨ ∥ N ∥ = ∥ M ∥ ∧ ∥ N ∥ = ⟨ g ⟩ ∥ M ∥ = min ( X , ∥ M ∥)
Figure 18. Compiler from monitors to S T l i n ST^{lin} S T l in , defined recursively on subterms of monitors.
⟨ ⟨ M ∈ V Y E S ⟩ ⟩ = ⟨ ⟨ M ∈ V E N D ⟩ ⟩ = t t ⟨ ⟨ M ∈ V N O ⟩ ⟩ = f f ⟨ ⟨ l e t x i n M ⟩ ⟩ = x i n ⟨ ⟨ M ⟩ ⟩ ⟨ ⟨ M + N ⟩ ⟩ = ⟨ ⟨ M ⟩ ⟩ ∧ ⟨ ⟨ N ⟩ ⟩ ⟨ ⟨ M ⊕ N ⟩ ⟩ = ⟨ ⟨ M ⟩ ⟩ ∨ ⟨ ⟨ N ⟩ ⟩ ⟨ ⟨ M ⊗ N ⟩ ⟩ = ⟨ ⟨ M ⟩ ⟩ ∧ ⟨ ⟨ N ⟩ ⟩ ⟨ ⟨ a . M ⟩ ⟩ = [ a ] ⟨ ⟨ M ⟩ ⟩ ⟨ ⟨ g . M ⟩ ⟩ = [ g ] ⟨ ⟨ M ⟩ ⟩ ⟨ ⟨ X ⟩ ⟩ = X ⟨ ⟨ r e c X . M ⟩ ⟩ = max ( X , ⟨ ⟨ M ⟩ ⟩ ) \begin{aligned}
\langle\!\langle M \in\mathrm{VYES}\rangle\!\rangle&= \langle\!\langle M \in\mathrm{VEND}\rangle\!\rangle= \mathrm{tt} & \langle\!\langle M \in\mathrm{VNO}\rangle\!\rangle&= \mathrm{ff}\\
\langle\!\langle\mathrm{let}\ x\ \mathrm{in}\ M\rangle\!\rangle&= x\ \mathrm{in}\langle\!\langle M\rangle\!\rangle& \langle\!\langle M+N\rangle\!\rangle&= \langle\!\langle M\rangle\!\rangle\land\langle\!\langle N\rangle\!\rangle\\
\langle\!\langle M\mathbin{\oplus}N\rangle\!\rangle&= \langle\!\langle M\rangle\!\rangle\lor\langle\!\langle N\rangle\!\rangle& \langle\!\langle M\mathbin{\otimes}N\rangle\!\rangle&= \langle\!\langle M\rangle\!\rangle\land\langle\!\langle N\rangle\!\rangle\\
\langle\!\langle a.M\rangle\!\rangle&= [a]\langle\!\langle M\rangle\!\rangle& \langle\!\langle g.M\rangle\!\rangle&= [g]\langle\!\langle M\rangle\!\rangle\\
\langle\!\langle X\rangle\!\rangle&= X & \langle\!\langle\mathrm{rec}\ X.M\rangle\!\rangle&= \max(X,\langle\!\langle M\rangle\!\rangle)
\end{aligned} ⟨ ⟨ M ∈ VYES ⟩ ⟩ ⟨ ⟨ let x in M ⟩ ⟩ ⟨ ⟨ M ⊕ N ⟩ ⟩ ⟨ ⟨ a . M ⟩ ⟩ ⟨ ⟨ X ⟩ ⟩ = ⟨ ⟨ M ∈ VEND ⟩ ⟩ = tt = x in ⟨ ⟨ M ⟩ ⟩ = ⟨ ⟨ M ⟩ ⟩ ∨ ⟨ ⟨ N ⟩ ⟩ = [ a ] ⟨ ⟨ M ⟩ ⟩ = X ⟨ ⟨ M ∈ VNO ⟩ ⟩ ⟨ ⟨ M + N ⟩ ⟩ ⟨ ⟨ M ⊗ N ⟩ ⟩ ⟨ ⟨ g . M ⟩ ⟩ ⟨ ⟨ rec X . M ⟩ ⟩ = ff = ⟨ ⟨ M ⟩ ⟩ ∧ ⟨ ⟨ N ⟩ ⟩ = ⟨ ⟨ M ⟩ ⟩ ∧ ⟨ ⟨ N ⟩ ⟩ = [ g ] ⟨ ⟨ M ⟩ ⟩ = max ( X , ⟨ ⟨ M ⟩ ⟩)
Figure 19. Compiler from monitors to V T l i n VT^{lin} V T l in , defined recursively on subterms of monitors.
Maximality
In this subsection, we prove the maximality of our monitorable fragments with regards to Mon. That is, we show that any monitorable formula ϕ \phi ϕ , in the sense that there exists a monitor in Mon that is sound and (violation or satisfaction) complete for ϕ \phi ϕ , there exists a formula ψ ∈ M T l i n \psi\in MT^{lin} ψ ∈ M T l in equivalent to ϕ \phi ϕ .
Definition 5.36 (Largest monitorable fragment). A fragment Γ ⊂ T l i n \Gamma\subset T^{lin} Γ ⊂ T l in is said:
The largest satisfaction- (resp. violation-, complete-) monitorable fragment of T l i n T^{lin} T l in iff (i) Γ \Gamma Γ is satisfaction (resp. violation, complete) monitorable and (ii) for every satisfaction- (resp. violation-, complete-) monitorable formula ψ ∈ T l i n \psi\in T^{lin} ψ ∈ T l in , there exists ϕ ∈ Γ \phi\in\Gamma ϕ ∈ Γ such that ⟦ ϕ ⟧ = ⟦ ψ ⟧ \llbracket\phi\rrbracket= \llbracket\psi\rrbracket [ [ ϕ ] ] = [ [ ψ ] ] .
The largest monitorable fragment of T l i n T^{lin} T l in iff (i) Γ \Gamma Γ is monitorable and (ii) for every monitorable formula ψ ∈ T l i n \psi\in T^{lin} ψ ∈ T l in , there exists ϕ ∈ Γ \phi\in\Gamma ϕ ∈ Γ such that ⟦ ϕ ⟧ = ⟦ ψ ⟧ \llbracket\phi\rrbracket= \llbracket\psi\rrbracket [ [ ϕ ] ] = [ [ ψ ] ] .
Since the satisfiability/validity of T l i n T^{lin} T l in are undecidable, we follow again a syntactic approach, inspired from [2 ] . First, we prove that for every monitor M M M , if M M M is satisfaction (resp. violation) complete for two formulae in T l i n T^{lin} T l in , then such formulae are semantically equivalent (Lemma 5.37). Second, we define two functions: ∥ − ∥ \lVert-\rVert ∥ − ∥ (Fig. 18), that maps any monitor M M M to a formula in S T l i n ST^{lin} S T l in , and ⟨ ⟨ − ⟩ ⟩ \langle\!\langle-\rangle\!\rangle ⟨ ⟨ − ⟩ ⟩ (Fig. 19) that maps any monitor M M M to a formula in V T l i n VT^{lin} V T l in ; then prove that any M M M is sound and satisfaction complete for its image by ∥ − ∥ \lVert-\rVert ∥ − ∥ (i.e., ∥ M ∥ \lVert M\rVert ∥ M ∥ ), and sound and violation complete for ⟨ ⟨ M ⟩ ⟩ \langle\!\langle M\rangle\!\rangle ⟨ ⟨ M ⟩ ⟩ (Lemma 5.38). We conclude therefore that any formula ϕ ∈ T l i n \phi\in T^{lin} ϕ ∈ T l in that is satisfaction (resp. violation) monitorable, through the existence of a monitor M M M that is satisfaction (resp. violation) complete for ϕ \phi ϕ , is necessarily equivalent to ∥ M ∥ ∈ S T l i n \lVert M\rVert\in ST^{lin} ∥ M ∥ ∈ S T l in (resp. ⟨ ⟨ M ⟩ ⟩ ∈ V T l i n \langle\langle M\rangle\rangle\in VT^{lin} ⟨⟨ M ⟩⟩ ∈ V T l in , Proposition 5.39 ). Accordingly, S T l i n ST^{lin} S T l in is the largest satisfaction-monitorable fragment of T l i n T^{lin} T l in , V T l i n VT^{lin} V T l in the largest violation-monitorable fragment of T l i n T^{lin} T l in , and M T l i n = V T l i n ∪ S T l i n MT^{lin} = VT^{lin} \cup ST^{lin} M T l in = V T l in ∪ S T l in the largest monitorable fragment of T l i n T^{lin} T l in (Theorem 5.40 , Theorem 5.41 ). We also prove that C T l i n CT^{lin} C T l in is the largest complete-monitorable fragment of T l i n T^{lin} T l in (Theorem 5.42 ).
Lemma 5.37. For every monitor M M M and formulae ϕ , ψ ∈ T l i n \phi, \psi\in T^{lin} ϕ , ψ ∈ T l in :
M M M is sound and satisfaction complete for ϕ \phi ϕ and ψ \psi ψ implies ⟦ ϕ ⟧ = ⟦ ψ ⟧ \llbracket\phi\rrbracket= \llbracket\psi\rrbracket [ [ ϕ ] ] = [ [ ψ ] ] ,
M M M is sound and violation complete for ϕ \phi ϕ and ψ \psi ψ implies ⟦ ϕ ⟧ = ⟦ ψ ⟧ \llbracket\phi\rrbracket= \llbracket\psi\rrbracket [ [ ϕ ] ] = [ [ ψ ] ] .
Lemma 5.38. For every monitor M M M , if M M M is consistent then:
M M M is sound and satisfaction complete for ∥ M ∥ \lVert M\rVert ∥ M ∥
M M M is sound and violation complete for ⟨ ⟨ M ⟩ ⟩ \langle\langle M\rangle\rangle ⟨⟨ M ⟩⟩
Proposition 5.39. For every formula ϕ ∈ T l i n \phi\in T^{lin} ϕ ∈ T l in :
if ϕ \phi ϕ is satisfaction monitorable, then there exists ψ ∈ S T l i n \psi\in ST^{lin} ψ ∈ S T l in such that ⟦ ϕ ⟧ = ⟦ ψ ⟧ \llbracket\phi\rrbracket= \llbracket\psi\rrbracket [ [ ϕ ] ] = [ [ ψ ] ] ,
if ϕ \phi ϕ is violation monitorable, then there exists ψ ∈ V T l i n \psi\in VT^{lin} ψ ∈ V T l in such that ⟦ ϕ ⟧ = ⟦ ψ ⟧ \llbracket\phi\rrbracket= \llbracket\psi\rrbracket [ [ ϕ ] ] = [ [ ψ ] ] .
Proof. Of Item 1. Assume ϕ ∈ T l i n \phi\in T^{lin} ϕ ∈ T l in is satisfaction monitorable. By definition, there exists a monitor M M M that is sound and satisfaction complete for ϕ \phi ϕ . By Lemma 5.6 , we have M M M is consistent. Now, by Lemma 5.38 (Item 1), we deduce M M M is sound and satisfaction complete for ∥ M ∥ ∈ S T l i n \lVert M\rVert\in ST^{lin} ∥ M ∥ ∈ S T l in , and finally we conclude ⟦ ϕ ⟧ = ⟦ ∥ M ∥ ⟧ \llbracket\phi\rrbracket= \llbracket\lVert M\rVert\rrbracket [ [ ϕ ] ] = [ [ ∥ M ∥ ] ] by Lemma 5.37 (Item 1). Of Item 2. Analogous.
Theorem 5.40.
S T l i n ST^{lin} S T l in is the largest satisfaction-monitorable fragment of T l i n T^{lin} T l in ,
V T l i n VT^{lin} V T l in is the largest violation-monitorable fragment of T l i n T^{lin} T l in .
Proof. Of Item 1. Direct from Definition 5.36 , Theorem 5.31, and Proposition 5.39 (Item 1). Of Item 2. Direct from Definition 5.36 , Theorem 5.34, and Proposition 5.39 (Item 2).
Theorem 5.41. M T l i n MT^{lin} M T l in is the largest monitorable fragment of T l i n T^{lin} T l in .
Proof. Direct from Definition 5.36 , Theorem 5.40 and Definition 5.28 .
Theorem 5.42. C T l i n CT^{lin} C T l in is the largest complete-monitorable fragment of T l i n T^{lin} T l in .
Monitorability of MTL
In this section, we identify useful satisfaction, violation, and complete-monitorable fragments of MTL. To this end, we exploit the results of Section 5 to determine which MTL formulae are compiled into the violation, satisfaction, and complete-monitorable fragments of T l i n T^{lin} T l in . Let us first define the set of general Until sub-formulae of an MTL formula. The proofs not enclosed in this section are given in Appendix § 12 .
Definition 6.1. Let ϕ \phi ϕ be an MTL formula (Figure 1 ). The set of general Until sub-formulae of ϕ \phi ϕ , denoted s u b U ( ϕ ) sub_U(\phi) s u b U ( ϕ ) is defined recursively: s u b U ( ⊤ ) = s u b U ( ⊥ ) = s u b U ( a ) = ∅ sub_U(\top) = sub_U(\bot) = sub_U(a) = \varnothing s u b U ( ⊤ ) = s u b U ( ⊥ ) = s u b U ( a ) = ∅ ;
s u b U ( ¬ ϕ ) = ⋃ ψ ∈ s u b U ( ϕ ) { ¬ ψ } sub_U(\neg\phi) = \bigcup_{\psi\in sub_U(\phi)} \{\neg\psi\} s u b U ( ¬ ϕ ) = ⋃ ψ ∈ s u b U ( ϕ ) { ¬ ψ } ;
s u b U ( ϕ ∧ ψ ) = s u b U ( ϕ ) ∪ s u b U ( ψ ) sub_U(\phi\land\psi) = sub_U(\phi) \cup sub_U(\psi) s u b U ( ϕ ∧ ψ ) = s u b U ( ϕ ) ∪ s u b U ( ψ ) ;
s u b U ( ϕ U I ψ ) = { ϕ U I ψ } ∪ s u b U ( ϕ ) ∪ s u b U ( ψ ) sub_U(\phi\ U_I\ \psi) = \{\phi\ U_I\ \psi\} \cup sub_U(\phi) \cup sub_U(\psi) s u b U ( ϕ U I ψ ) = { ϕ U I ψ } ∪ s u b U ( ϕ ) ∪ s u b U ( ψ ) .
Therefore, every element of s u b U ( ϕ ) sub_U(\phi) s u b U ( ϕ ) is of the form ψ 1 U I ψ 2 \psi_1 U_I \psi_2 ψ 1 U I ψ 2 preceded by a finite number of negations. We call each such ψ 1 U I ψ 2 \psi_1 U_I \psi_2 ψ 1 U I ψ 2 an Until sub-formula.
That is, s u b U ( ϕ ) sub_U(\phi) s u b U ( ϕ ) extracts every general Until sub-formula, i.e., every Until sub-formula ψ \psi ψ of ϕ \phi ϕ preceded by the number of negations ψ \psi ψ falls under within ϕ \phi ϕ .
Example 6.2. Let A c t = { a , b , c } \mathrm{Act} = \{a,b,c\} Act = { a , b , c } and ψ = ◊ ( b ∧ □ [ 0 , 1 ] c ) \psi= \Diamond(b \land\Box_{[0,1]}c) ψ = ◊ ( b ∧ □ [ 0 , 1 ] c ) , requiring the existence of a future b b b followed by only c c c actions within the relative interval [ 0 , 1 ] [0,1] [ 0 , 1 ] . Formula ψ \psi ψ is syntactic sugar for
ψ ′ = ⊤ U ( b ∧ ¬ ( ⊤ U [ 0 , 1 ] ¬ c ) ) \psi' = \top U (b \land\neg(\top U_{[0,1]} \neg c)) ψ ′ = ⊤ U ( b ∧ ¬ ( ⊤ U [ 0 , 1 ] ¬ c )) We have s u b U ( ψ ′ ) = { θ = ¬ ( ⊤ U [ 0 , 1 ] ¬ c ) , θ ′ = ⊤ U ( b ∧ θ ) } sub_U(\psi') = \{\theta= \neg(\top U_{[0,1]} \neg c),\theta' = \top U (b \land\theta)\} s u b U ( ψ ′ ) = { θ = ¬ ( ⊤ U [ 0 , 1 ] ¬ c ) , θ ′ = ⊤ U ( b ∧ θ )} .
We will hereafter use “ψ \psi ψ is preceded by” and “ψ \psi ψ falls under” some number of negation interchangeably.
Now, given our compiler M t o T l i n \mathrm{MtoT}^{lin} MtoT l in (Figure 6 ), the intuition is the following. Let ϕ \phi ϕ be an MTL formula. If every Until sub-formula in s u b U ( ϕ ) sub_U(\phi) s u b U ( ϕ ) falls under an even number of negations, then M t o T l i n ( ϕ ) \mathrm{MtoT}^{lin}(\phi) MtoT l in ( ϕ ) will contain no maximal fixpoint terms, i.e., M t o T l i n ( ϕ ) ∈ S T l i n \mathrm{MtoT}^{lin}(\phi) \in ST^{lin} MtoT l in ( ϕ ) ∈ S T l in and therefore ϕ \phi ϕ is satisfaction monitorable. Dually, if every Until sub-formula is preceded by an odd number of negations, then M t o T l i n ( ϕ ) \mathrm{MtoT}^{lin}(\phi) MtoT l in ( ϕ ) will contain no minimal fixpoint terms, i.e., M t o T l i n ( ϕ ) ∈ V T l i n \mathrm{MtoT}^{lin}(\phi) \in VT^{lin} MtoT l in ( ϕ ) ∈ V T l in and therefore ϕ \phi ϕ is violation monitorable.
The above reasoning is however too coarse leading to missing formulae that are clearly monitorable.
Example 6.3. Consider ψ ′ \psi' ψ ′ and its set of general Until sub-formulae s u b U ( ψ ′ ) sub_U(\psi') s u b U ( ψ ′ ) in Example 6.2 . In s u b U ( ψ ′ ) sub_U(\psi') s u b U ( ψ ′ ) , we have two general Until sub-formulae θ \theta θ and θ ′ \theta' θ ′ , such that the former is an Until sub-formula preceded by an odd number of negations (one) and the latter an Until sub-formula preceded by an even number of negations (zero), and therefore we cannot conclude on whether this formula is monitorable using the above reasoning. Yet, this formula is clearly satisfaction monitorable due to the bounded interval in θ \theta θ : if there exists a b b b followed only by c c c actions within the relative interval [ 0 , 1 ] [0,1] [ 0 , 1 ] , one may issue a satisfaction verdict when the right bound of [ 0 , 1 ] [0,1] [ 0 , 1 ] is exceeded.
Treating Until sub-formulae with bounded intervals differently would be still insufficient, however, as we can miss trivially monitorable formulae containing Until sub-formulae of the form ⊥ U ϕ \bot U \phi ⊥ U ϕ , i.e., encoding the Next operator.
Example 6.4. Let A c t = { a , b , c } \mathrm{Act} = \{a,b,c\} Act = { a , b , c } and ψ ′ = □ ( b ⇒ ◯ c ) \psi' = \Box(b \Rightarrow\bigcirc c) ψ ′ = □ ( b ⇒ ◯ c ) . This formula requires that every future b b b is followed immediately (i.e., at the next position) by a c c c . Here again, the above reasoning prevents to conclude on the monitorability of ψ ′ \psi' ψ ′ since the latter is syntactic sugar for
¬ ( ⊤ U ( b ∧ ¬ ( ⊥ U c ) ) ) \neg(\top U (b \land\neg(\bot U c))) ¬ ( ⊤ U ( b ∧ ¬ ( ⊥ U c ))) and we have one Until sub-formula falling under an odd number of negations and the another falling under an even number of negations, and none of them carries a bounded interval. Yet, the above formula is actually violation monitorable: since there is, by definition, an infinity of actions in an infinite timed word, whenever we encounter a b b b we will see its successor in a bounded amount of time, and if it is not a c c c , we can return the violation verdict.
The first step is therefore to define formally, based on the above observations, the kind of Until sub-formulae which do not impair the monitorability of the formula at hand, which we call constrained Until (sub)-formulae.
Definition 6.5 (Constrained Until formula). An Until sub-formula ϕ U I ψ \phi\ U_{I}\ \psi ϕ U I ψ is constrained iff (1) I I I is bounded (Definition 2.4 ) or (2) ϕ = ⊥ \phi= \bot ϕ = ⊥ . An Until sub-formula is unconstrained otherwise.
A more precise reasoning is therefore to delineate constrained from unconstrained Until sub-formulae (Definition 6.5). On the former, no condition should be imposed, whereas we require for the latter something on the number of negations they are preceded by, depending on whether we seek to characterise satisfaction or violation monitorability.
Now, our compiler M t o T l i n \mathrm{MtoT}^{lin} MtoT l in given in Figure 6 does not distinguish between constrained and unconstrained Until sub-formulae. In order to capture constrained Until sub-formula of type (1) in Definition 6.5, i.e., ϕ U I ψ \phi\ U_{I}\ \psi ϕ U I ψ where I I I is bounded (Definition 6.5), the idea is to develop an equivalent variant of M t o T l i n \mathrm{MtoT}^{lin} MtoT l in . In this variant, called c o n s M t o T l i n \mathrm{consMtoT}^{lin} consMtoT l in and detailed in Figure 20 , the compilation of ϕ ′ U I ψ \phi'\ U_{I}\ \psi ϕ ′ U I ψ , where ϕ ′ ≠ ⊥ \phi' \ne\bot ϕ ′ = ⊥ , adds a guard such that, if I I I is bounded, the recursion will be eventually prevented, i.e., when the right bound of I I I is exceeded. We recall that ≺ I = < \prec_{I} = < ≺ I =< if I I I is right open and ≤ \leq ≤ otherwise (Definition 2.5 ).
Vector (PDF) c o n s M t o T l i n ( ⊤ ) = t t c o n s M t o T l i n ( ⊥ ) = f f c o n s M t o T l i n ( a ) = ⟨ a ⟩ t t c o n s M t o T l i n ( ¬ ϕ ) = not ( c o n s M t o T l i n ( ϕ ) ) c o n s M t o T l i n ( ϕ ∧ ψ ) = c o n s M t o T l i n ( ϕ ) ∧ M t o T l i n ( ψ ) c o n s M t o T l i n ( ϕ ′ U I ψ ) = x s in ⟨ A c t ⟩ min ( Y , x e in ( ⟨ x e − x s ∈ I ⟩ c o n s M t o T l i n ( ψ ) ) ∨ ( c o n s M t o T l i n ( ϕ ′ ) ∧ ⟨ A c t ⟩ y in ⟨ y − x s ≺ I R B ( I ) ⟩ Y ) ) c o n s M t o T l i n ( ⊥ U I ψ ) = x s in ⟨ A c t ⟩ x e in ⟨ x e − x s ∈ I ⟩ c o n s M t o T l i n ( ϕ ) \begin{aligned}
\mathrm{consMtoT}^{lin}(\top) &= \mathrm{tt}\\
\mathrm{consMtoT}^{lin}(\bot) &= \mathrm{ff}\\
\mathrm{consMtoT}^{lin}(a) &= \langle a\rangle\mathrm{tt}\\
\mathrm{consMtoT}^{lin}(\neg\phi) &= \operatorname{not}(\mathrm{consMtoT}^{lin}(\phi))\\
\mathrm{consMtoT}^{lin}(\phi\land\psi) &= \mathrm{consMtoT}^{lin}(\phi)\land\mathrm{MtoT}^{lin}(\psi)\\
\mathrm{consMtoT}^{lin}(\phi'\ U_{I}\ \psi) &= x_s\ \operatorname{in}\langle\mathrm{Act}\rangle\min\left(Y,x_e\ \operatorname{in}\left(\langle x_e-x_s\in I\rangle\mathrm{consMtoT}^{lin}(\psi)\right)\right.\\
&\qquad\left.\lor\left(\mathrm{consMtoT}^{lin}(\phi')\land\langle\mathrm{Act}\rangle y\ \operatorname{in}\langle y-x_s\prec_I RB(I)\rangle Y\right)\right)\\
\mathrm{consMtoT}^{lin}(\bot\ U_{I}\ \psi) &= x_s\ \operatorname{in}\langle\mathrm{Act}\rangle x_e\ \operatorname{in}\langle x_e-x_s\in I\rangle\mathrm{consMtoT}^{lin}(\phi)
\end{aligned} consMtoT l in ( ⊤ ) consMtoT l in ( ⊥ ) consMtoT l in ( a ) consMtoT l in ( ¬ ϕ ) consMtoT l in ( ϕ ∧ ψ ) consMtoT l in ( ϕ ′ U I ψ ) consMtoT l in ( ⊥ U I ψ ) = tt = ff = ⟨ a ⟩ tt = not ( consMtoT l in ( ϕ )) = consMtoT l in ( ϕ ) ∧ MtoT l in ( ψ ) = x s in ⟨ Act ⟩ min ( Y , x e in ( ⟨ x e − x s ∈ I ⟩ consMtoT l in ( ψ ) ) ∨ ( consMtoT l in ( ϕ ′ ) ∧ ⟨ Act ⟩ y in ⟨ y − x s ≺ I R B ( I )⟩ Y ) ) = x s in ⟨ Act ⟩ x e in ⟨ x e − x s ∈ I ⟩ consMtoT l in ( ϕ ) Figure 20. From MTL to T l i n T^{lin} T l in , where ϕ ′ ≠ ⊥ \phi' \ne\bot ϕ ′ = ⊥
For constrained Until sub-formulae of type (2) in Definition 6.5, i.e., ⊥ U I ϕ \bot\ U_{I}\ \phi ⊥ U I ϕ , the compilation gives simply x s in ⟨ A c t ⟩ x e in ⟨ x e − x s ∈ I ⟩ c o n s M t o T l i n ( ϕ ) x_s\ \operatorname{in}\langle\mathrm{Act}\rangle x_e\ \operatorname{in}\langle x_e-x_s\in I\rangle\mathrm{consMtoT}^{lin}(\phi) x s in ⟨ Act ⟩ x e in ⟨ x e − x s ∈ I ⟩ consMtoT l in ( ϕ ) which coincides with the compilation of ◯ I ϕ \bigcirc_{I}\phi ◯ I ϕ given in [10 ] (explanation below).
The following proposition states that c o n s M t o T l i n \mathrm{consMtoT}^{lin} consMtoT l in is an equivalent variant of M t o T l i n \mathrm{MtoT}^{lin} MtoT l in , i.e., for any MTL formula ϕ \phi ϕ , c o n s M t o T l i n ϕ \mathrm{consMtoT}^{lin}\phi consMtoT l in ϕ and M t o T l i n ϕ \mathrm{MtoT}^{lin}\phi MtoT l in ϕ have the same semantics.
Proposition 6.6. For all ϕ ∈ M T L \phi\in\mathrm{MTL} ϕ ∈ MTL , we have ⟦ M t o T l i n ( ϕ ) ⟧ = ⟦ c o n s M t o T l i n ( ϕ ) ⟧ \llbracket\mathrm{MtoT}^{lin}(\phi)\rrbracket=\llbracket\mathrm{consMtoT}^{lin}(\phi)\rrbracket [ [ MtoT l in ( ϕ ) ] ] = [ [ consMtoT l in ( ϕ ) ] ] .
We give a proof sketch of Proposition 6.6 for the case ⊥ U I ϕ \bot\ U_{I}\ \phi ⊥ U I ϕ below. By the rules of M t o T l i n \mathrm{MtoT}^{lin} MtoT l in (Figure 6 ), we have
M t o T l i n ⊥ U I ϕ = x s in ⟨ A c t ⟩ min ( Y , x e in ( ⟨ x e − x s ∈ I ⟩ c o n s M t o T l i n ( ϕ ) ) ∨ ( f f ∧ ⟨ A c t ⟩ Y ) ) \mathrm{MtoT}^{lin}\bot\ U_{I}\ \phi=x_s\ \operatorname{in}\langle\mathrm{Act}\rangle\min\left(Y,x_e\ \operatorname{in}\left(\langle x_e-x_s\in I\rangle\mathrm{consMtoT}^{lin}(\phi)\right)\lor\left(\mathrm{ff}\land\langle\mathrm{Act}\rangle Y\right)\right) MtoT l in ⊥ U I ϕ = x s in ⟨ Act ⟩ min ( Y , x e in ( ⟨ x e − x s ∈ I ⟩ consMtoT l in ( ϕ ) ) ∨ ( ff ∧ ⟨ Act ⟩ Y ) )
And since f f ∧ ψ \mathrm{ff}\land\psi ff ∧ ψ is equivalent to f f \mathrm{ff} ff for any ψ \psi ψ we get:
x s in ⟨ A c t ⟩ min ( Y , x e in ( ⟨ x e − x s ∈ I ⟩ c o n s M t o T l i n ( ϕ ) ) ) x_s\ \operatorname{in}\langle\mathrm{Act}\rangle\min\left(Y,x_e\ \operatorname{in}\left(\langle x_e-x_s\in I\rangle\mathrm{consMtoT}^{lin}(\phi)\right)\right) x s in ⟨ Act ⟩ min ( Y , x e in ( ⟨ x e − x s ∈ I ⟩ consMtoT l in ( ϕ ) ) )
Finally, since the recursion variable Y Y Y does not appear at all under the min, the latter can be removed altogether as the above formula is equivalent to
x s ∈ ⟨ A c t ⟩ x e ∈ ⟨ x e − x s ∈ I ⟩ consMtoT l i n ( ϕ ) x_s \in\langle\mathrm{Act}\rangle x_e \in\langle x_e - x_s \in I\rangle\operatorname{consMtoT}^{lin}(\phi) x s ∈ ⟨ Act ⟩ x e ∈ ⟨ x e − x s ∈ I ⟩ consMtoT l in ( ϕ )
Now, in order to reason on the monitorability of an MTL formula ϕ \phi ϕ , a constrained Until sub-formula of ϕ \phi ϕ is exempt of any requirement: regardless of the number of negations it is preceded by, our compiler will give a constrained min, a constrained max, or no fixpoint term at all, and therefore if all Until sub-formulae are constrained, ϕ \phi ϕ is complete monitorable, i.e., both satisfaction and violation monitorable. This gives us the CMTL fragment defined below.
Definition 6.7. The CMTL fragment of MTL is defined as the set of MTL formulae where every Until sub-formula is constrained (Definition 6.1,Definition 6.5).
Otherwise, i.e., if not all Until sub-formulae are constrained, we look only at the unconstrained ones. If each falls within an even number of negations, then consMtoT l i n ( ϕ ) \operatorname{consMtoT}^{lin}(\phi) consMtoT l in ( ϕ ) does not contain any max sub-formula (except for the constrained max terms resulting from the compilation of constrained Until sub-formulae of type (1) preceded by an odd number of negations, which we rewrite as min terms, Proposition 5.27). It follows that, in this case, consMtoT l i n ( ϕ ) \operatorname{consMtoT}^{lin}(\phi) consMtoT l in ( ϕ ) falls within S T l i n ST^{lin} S T l in and therefore ϕ \phi ϕ is satisfaction monitorable. We get accordingly the SMTL fragment.
Definition 6.8. The SMTL fragment of MTL, is defined as the set of all formulae in which each unconstrained Until sub-formula falls under an even number of negations (Definition 6.1,Definition 6.5).
For violation monitorability, the reasoning is dual requiring every unconstrained Until sub-formula to fall within an odd number of negations.
Definition 6.9. The VMTL fragment of MTL is defined as the set of all formulae in which each unconstrained Until sub-formula falls under an odd number of negations (Definition 6.1,Definition 6.5).
Proposition 6.10 (Monitorability of MTL). The following holds:
C M T L CMTL C M T L is complete monitorable.
S M T L SMTL S M T L is satisfaction monitorable.
V M T L VMTL V M T L is violation monitorable.
Proof. 1. CMTL is complete monitorable: Let ϕ ∈ C M T L \phi\in CMTL ϕ ∈ C M T L . Since by the definition of CMTL, every Until sub-formula of ϕ \phi ϕ is constrained, we have that in each fixpoint sub-formula of consMtoT l i n ( ϕ ) \operatorname{consMtoT}^{lin}(\phi) consMtoT l in ( ϕ ) , each recursion variable appears under the form y ∈ ⟨ y − x s ≺ n ⟩ Y y \in\langle y - x_s \prec n\rangle Y y ∈ ⟨ y − x s ≺ n ⟩ Y , n ∈ N n \in\mathbb{N} n ∈ N . Since x s x_s x s is free in each such sub-formula, we get that every fixpoint sub-formula of ⟦ consMtoT l i n ( ϕ ) ⟧ \llbracket\operatorname{consMtoT}^{lin}(\phi)\rrbracket [ [ consMtoT l in ( ϕ ) ] ] is constrained and therefore ⟦ consMtoT l i n ( ϕ ) ⟧ ∈ C T l i n \llbracket\operatorname{consMtoT}^{lin}(\phi)\rrbracket\in CT^{lin} [ [ consMtoT l in ( ϕ ) ] ] ∈ C T l in (Definition 5.17). Given that every formula in C T l i n CT^{lin} C T l in is complete monitorable (Theorem 5.22), and by Proposition 3.8 and Proposition 6.6, we have ⟦ ϕ ⟧ = ⟦ consMtoT l i n ( ϕ ) ⟧ \llbracket\phi\rrbracket= \llbracket\operatorname{consMtoT}^{lin}(\phi)\rrbracket [ [ ϕ ] ] = [ [ consMtoT l in ( ϕ ) ] ] , we conclude that ϕ \phi ϕ is complete monitorable.
SMTL is satisfaction monitorable: Let ϕ ∈ S M T L \phi\in SMTL ϕ ∈ S M T L . Since by the definition of SMTL, each unconstrained Until sub-formula of ϕ \phi ϕ falls under an even number of negation, we have that each fixpoint sub-formula of consMtoT l i n ( ϕ ) \operatorname{consMtoT}^{lin}(\phi) consMtoT l in ( ϕ ) is a min or a constrained max. By Proposition 5.27, each max ( X , ψ ) \max(X,\psi) max ( X , ψ ) sub-formula in consMtoT l i n ( ϕ ) \operatorname{consMtoT}^{lin}(\phi) consMtoT l in ( ϕ ) can be rewritten to min ( X , ψ ) \min(X,\psi) min ( X , ψ ) to get an equivalent formula w.r.t. divergent timed words. Therefore, we get an equivalent formula of ϕ \phi ϕ in S T l i n ST^{lin} S T l in , because every fixpoint operator is a min (Fig. 16). Given that every formula in S T l i n ST^{lin} S T l in is satisfaction monitorable (Theorem 5.31), and by
::: Proposition 3.8 and Proposition 6.6, we have ⟦ ϕ ⟧ = ⟦ consMtoT l i n ( ϕ ) ⟧ \llbracket\phi\rrbracket= \llbracket\operatorname{consMtoT}^{lin}(\phi) \rrbracket [ [ ϕ ] ] = [ [ consMtoT l in ( ϕ ) ] ] , we conclude that ϕ \phi ϕ is satisfaction monitorable.
VMTL is violation monitorable: Analogous.
Reasoning on monitorability can be easily extended to formulae using syntactic sugar. Any Next sub-formula is a constrained Until since ◯ I ϕ \bigcirc_{I}\phi ◯ I ϕ is syntactic sugar for ⊥ U I ϕ \bot\ U_{I}\phi ⊥ U I ϕ (§ 2.4.1 ).
Non-strict Until sub-formulae follow the same conditions as the strict ones. On the one hand, ϕ U I ≤ ψ \phi\ U_{I}^{\leq}\ \psi ϕ U I ≤ ψ is syntactic sugar for ¬ ( ¬ ψ ∧ ¬ ( ϕ ∧ ( ϕ U I ψ ) ) ) \neg(\neg\psi\land\neg(\phi\land(\phi\ U_{I}\psi))) ¬ ( ¬ ψ ∧ ¬ ( ϕ ∧ ( ϕ U I ψ ))) or ϕ ∧ ( ϕ U I ψ ) \phi\land(\phi\ U_{I}\psi) ϕ ∧ ( ϕ U I ψ ) , depending on whether I I I is left closed at 0 (§ 2.4.1 ). On the other hand, we have
s u b U ( ϕ ∧ ( ϕ U I ψ ) ) = s u b U ( ϕ U I ψ ) sub_{U}(\phi\land(\phi\ U_{I}\psi))=sub_{U}(\phi\ U_{I}\psi) s u b U ( ϕ ∧ ( ϕ U I ψ )) = s u b U ( ϕ U I ψ )
And s u b U ( ¬ ( ψ ∧ ¬ ( ϕ ∧ ( ϕ U I ψ ) ) ) ) sub_{U}(\neg(\psi\land\neg(\phi\land(\phi\ U_{I}\psi)))) s u b U ( ¬ ( ψ ∧ ¬ ( ϕ ∧ ( ϕ U I ψ )))) contains the same Until sub-formulae as s u b U ( ϕ U I ψ ) sub_{U}(\phi\ U_{I}\psi) s u b U ( ϕ U I ψ ) where the oddity/evenness of negations preceding each of them is preserved. In summary, the set of Until sub-formulae, as well as the oddity/evenness of the number of negations preceding each of them, is preserved across the two versions of the Until operator.
An unconstrained (strict or non-strict) Finally (resp. Globally) sub-formula is simply an unconstrained Until under the scope of an even (resp. odd) number of negations.
Example 6.11. Consider the MTL formula
ψ n m = □ ≤ ( c ⇒ ◊ [ 2 , 5 ] ≤ ( b ∧ ◊ ≤ c ) ) \psi_{nm}=\Box^{\leq}(c\Rightarrow\Diamond^{\leq}_{[2,5]}(b\land\Diamond^{\leq}c)) ψ nm = □ ≤ ( c ⇒ ◊ [ 2 , 5 ] ≤ ( b ∧ ◊ ≤ c )) Notice how ψ n m \psi_{nm} ψ nm contains a constrained Until sub-formula, but also two unconstrained sub-formulae that correspond, respectively, to a non-strict Until under an odd number of negations (non-strict Globally) and a non-strict Until under an even number of negations (the innermost non-strict Finally). Now, ψ n m \psi_{nm} ψ nm belongs neither to SMTL (there is an unconstrained Until sub-formula under an odd number of negation) nor to VMTL (there is an unconstrained Until sub-formula under an even number of negations). Even though we do not claim maximality of our MTL monitorable fragments, we remark that ψ n m \psi_{nm} ψ nm is indeed not monitorable.
For satisfactions, the reasoning is similar to bounded response (Example 5.24): take the infinite set S = { π ∈ T A c t ω ∣ ∀ i ∈ N > 0 : a i ( π ) = b } S=\{\pi\in\mathrm{TAct}^{\omega}\mid\forall i\in\mathbb{N}_{>0}:a_i(\pi)=b\} S = { π ∈ TAct ω ∣ ∀ i ∈ N > 0 : a i ( π ) = b } , i.e., of all infinite timed words containing only b b b actions. Then for every π ∈ S \pi\in S π ∈ S , we have π ∈ ⟦ ψ n m ⟧ \pi\in\llbracket\psi_{nm}\rrbracket π ∈ [ [ ψ nm ] ] . Pick any π ′ \pi' π ′ prefix of such π \pi π . One cannot issue a satisfaction verdict after observing π ′ \pi' π ′ because there is at least one infinite extension of π ′ \pi' π ′ violating ψ n m \psi_{nm} ψ nm , for example π ′ ⋅ π ′ ′ ∈ T A c t ω \pi'\cdot\pi''\in\mathrm{TAct}^{\omega} π ′ ⋅ π ′′ ∈ TAct ω where π ′ ′ \pi'' π ′′ is any infinite suffix containing only c c c actions. For violations, take the infinite set S ′ = { π ∈ T A c t ω ∣ ( c , 1 ) ( b , 4 ) ∈ P f ( π ) and ∀ i ∈ N > 2 : a i ( π ) = b } S'=\{\pi\in\mathrm{TAct}^{\omega}\mid(c,1)(b,4)\in Pf(\pi)\text{ and }\forall i\in\mathbb{N}_{>2}:a_i(\pi)=b\} S ′ = { π ∈ TAct ω ∣ ( c , 1 ) ( b , 4 ) ∈ P f ( π ) and ∀ i ∈ N > 2 : a i ( π ) = b } . Then for every π ∈ S ′ \pi\in S' π ∈ S ′ , we have π ∉ ⟦ ψ n m ⟧ \pi\notin\llbracket\psi_{nm}\rrbracket π ∈ / [ [ ψ nm ] ] . Yet, there is no way to reach a violation verdict based on a finite prefix of any π ∈ S ′ \pi\in S' π ∈ S ′ , because any such prefix has an infinite extension satisfying ψ n m \psi_{nm} ψ nm .
This is an interesting example showing how the existence of a constrained Until sub-formula in MTL does not guarantee monitorability neither for satisfactions nor for violations. It also gives an idea on the importance of verdict guarantees for at least all bad behaviours or all good behaviours w.r.t. to a formula according to our definition of monitorability.
Example 6.12. Consider the following MTL formula
γ = ◊ [ 0 , 1 ] ≤ ( ◯ b ∧ □ [ 1 , 2 ] c ) \gamma=\Diamond^{\leq}_{[0,1]}(\bigcirc b\land\Box_{[1,2]}c) γ = ◊ [ 0 , 1 ] ≤ ( ◯ b ∧ □ [ 1 , 2 ] c ) The formula γ \gamma γ expresses the following precise property:
There exists an action at some position i ∈ N i \in\mathbb{N} i ∈ N , occurring at some t t t within the interval [ 0 , 1 ] [0,1] [ 0 , 1 ] relative to the first action, and
The action at position i + 1 i+1 i + 1 is a b b b ,
Every action within [ 1 , 2 ] [1,2] [ 1 , 2 ] relative to t t t is a c c c .
Since all temporal operators are derived from the strict Until operator, we deduce that rewriting γ \gamma γ in the standard syntax results in every Until sub-formula being constrained, either because it carries a bounded interval (the Until counterparts of the Finally and Globally sub-formulae) or because it is of the form ⊥ U I ϕ \bot\ U_I\ \phi ⊥ U I ϕ (the Until counterpart of the Next sub-formula) and therefore γ \gamma γ is complete monitorable.
Independence of formulae depth.
In MTL, the depth of a formula ϕ \phi ϕ is the maximum number of nestings of temporal operators in a sub-formula of ϕ \phi ϕ . Notice how our monitorability fragments are completely independent from the depth of a formula: in an SMTL formula ϕ \phi ϕ , for instance, the depth of a sub-formula of ϕ \phi ϕ can be any as long as every unconstrained Until is preceded by an even number of negations.
Monitorability of TPTL
To isolate useful monitorable fragments of TPTL, we rely again on the results of Section 5, and use a similar reasoning as in the previous section. In the following, we say that a TPTL term ϕ U ψ \phi\ U\ \psi ϕ U ψ is constrained iff ϕ = ⊥ \phi= \bot ϕ = ⊥ or ψ \psi ψ is of the form ( x ≺ n ) ∧ ψ ′ (x \prec n) \land\psi' ( x ≺ n ) ∧ ψ ′ for some variable x x x , natural number n n n , and term ψ ′ \psi' ψ ′ . We modify the compiler defined in Figure 7 so that constrained Until sub-terms are mapped to the appropriate T l i n T^{lin} T l in fragment. The proofs not enclosed in this section are given in Appendix § 12 .
The modified compiler from TPTL to T l i n T^{lin} T l in is presented in Figure 21 where ϕ ′ ≠ ⊥ \phi' \ne\bot ϕ ′ = ⊥ , and its correctness is established in Proposition 7.1. The definition of the term N X T ( X ) NXT(X) N X T ( X ) used in Figure 21 depends on the form of ψ \psi ψ : if ψ \psi ψ is of the form ( x ≺ n ) ∧ ψ ′ (x \prec n) \land\psi' ( x ≺ n ) ∧ ψ ′ , then N X T ( X ) = ⟨ A c t ⟩ y i n ⟨ y − x ≺ n ⟩ X NXT(X) = \langle Act\rangle y\ \mathsf{in}\langle y-x \prec n\rangle X N X T ( X ) = ⟨ A c t ⟩ y in ⟨ y − x ≺ n ⟩ X ; otherwise, N X T ( X ) = ⟨ A c t ⟩ X NXT(X) = \langle Act\rangle X N X T ( X ) = ⟨ A c t ⟩ X . Notice here also that for the constrained Until formula ⊥ U ϕ \bot\ U\ \phi ⊥ U ϕ , the compiler output reduces to ⟨ A c t ⟩ consPtoT l i n ( ψ ) \langle Act\rangle\operatorname{consPtoT}^{lin}(\psi) ⟨ A c t ⟩ consPtoT l in ( ψ ) using similar arguments as in the previous section.
Figure 21. From TPTL terms to T T l i n TT^{lin} T T l in where ϕ ′ ≠ ⊥ \phi' \ne\bot ϕ ′ = ⊥
Proposition 7.1. For all ϕ ∈ T P T L \phi\in TPTL ϕ ∈ T P T L , we have ⟦ P t o T l i n ( ϕ ) ⟧ = ⟦ C o n s P t o T l i n ( ϕ ) ⟧ \llbracket PtoT^{lin}(\phi)\rrbracket= \llbracket ConsPtoT^{lin}(\phi)\rrbracket [ [ P t o T l in ( ϕ ) ] ] = [ [ C o n s P t o T l in ( ϕ ) ] ] .
ConsPtoT l i n ( ⊤ ) = t t ConsPtoT l i n ( ⊥ ) = f f ConsPtoT l i n ( a ) = ⟨ a ⟩ t t ConsPtoT l i n ( ϕ ∨ ψ ) = ConsPtoT l i n ( ϕ ) ∨ ConsPtoT l i n ( ψ ) ConsPtoT l i n ( ¬ ϕ ) = not ( ConsPtoT l i n ( ϕ ) ) ConsPtoT l i n ( ϕ ′ U ψ ) = ⟨ A c t ⟩ min ( X , ConsPtoT l i n ( ψ ) ∨ ( ConsPtoT l i n ( ϕ ′ ) ∧ N X T ( X ) ) ) ConsPtoT l i n ( ⊥ U ψ ) = ⟨ A c t ⟩ ConsPtoT l i n ( ψ ) ConsPtoT l i n ( x . ϕ ) = x i n ConsPtoT l i n ( ϕ ) ConsPtoT l i n ( x ∼ n ) = y i n ⟨ y − x ∼ n ⟩ t t \begin{aligned}
\operatorname{ConsPtoT}^{lin}(\top) &= \mathsf{tt} \\
\operatorname{ConsPtoT}^{lin}(\bot) &= \mathsf{ff} \\
\operatorname{ConsPtoT}^{lin}(a) &= \langle a\rangle\mathsf{tt} \\
\operatorname{ConsPtoT}^{lin}(\phi\lor\psi) &= \operatorname{ConsPtoT}^{lin}(\phi) \lor\operatorname{ConsPtoT}^{lin}(\psi) \\
\operatorname{ConsPtoT}^{lin}(\neg\phi) &= \operatorname{not}(\operatorname{ConsPtoT}^{lin}(\phi)) \\
\operatorname{ConsPtoT}^{lin}(\phi'\ U\ \psi) &= \langle Act\rangle\min\left(X,\operatorname{ConsPtoT}^{lin}(\psi)\lor\left(\operatorname{ConsPtoT}^{lin}(\phi')\land NXT(X)\right)\right) \\
\operatorname{ConsPtoT}^{lin}(\bot\ U\ \psi) &= \langle Act\rangle\operatorname{ConsPtoT}^{lin}(\psi) \\
\operatorname{ConsPtoT}^{lin}(x.\phi) &= x\ \mathsf{in}\ \operatorname{ConsPtoT}^{lin}(\phi) \\
\operatorname{ConsPtoT}^{lin}(x\sim n) &= y\ \mathsf{in}\langle y-x\sim n\rangle\mathsf{tt}
\end{aligned} ConsPtoT l in ( ⊤ ) ConsPtoT l in ( ⊥ ) ConsPtoT l in ( a ) ConsPtoT l in ( ϕ ∨ ψ ) ConsPtoT l in ( ¬ ϕ ) ConsPtoT l in ( ϕ ′ U ψ ) ConsPtoT l in ( ⊥ U ψ ) ConsPtoT l in ( x . ϕ ) ConsPtoT l in ( x ∼ n ) = tt = ff = ⟨ a ⟩ tt = ConsPtoT l in ( ϕ ) ∨ ConsPtoT l in ( ψ ) = not ( ConsPtoT l in ( ϕ )) = ⟨ A c t ⟩ min ( X , ConsPtoT l in ( ψ ) ∨ ( ConsPtoT l in ( ϕ ′ ) ∧ N X T ( X ) ) ) = ⟨ A c t ⟩ ConsPtoT l in ( ψ ) = x in ConsPtoT l in ( ϕ ) = y in ⟨ y − x ∼ n ⟩ tt
The monitorable fragments then follow using the same reasoning as in the previous section, i.e., if all Until sub-terms of ϕ ∈ T P T L \phi\in\mathrm{TPTL} ϕ ∈ TPTL are constrained, then ϕ \phi ϕ is complete monitorable; otherwise if all unconstrained Until sub-terms fall under an even (resp. odd) number of negations then ϕ \phi ϕ is satisfaction (resp. violation) monitorable. Obtaining general Until sub-terms to reason on Until sub-terms and the number of negations they are preceded by is done in similar fashion as for MTL, with sub U ( x ∼ n ) = ∅ \operatorname{sub}_{U}(x \sim n) = \emptyset sub U ( x ∼ n ) = ∅ and sub U ( x . ϕ ) = sub U ( ϕ ) \operatorname{sub}_{U}(x.\phi) = \operatorname{sub}_{U}(\phi) sub U ( x . ϕ ) = sub U ( ϕ ) , and the technical detail that sub U \operatorname{sub}_{U} sub U may return (open) terms. Notice here also how our monitorable fragments of TPTL are completely independent of the depth of sub-formulae.
Definition 7.2. The fragment CTPTL is defined as the set of all TPTL formulae with all Until sub-terms constrained.
Definition 7.3. The fragment STPTL is defined as the set of all TPTL formulae in which each unconstrained Until sub-term falls under an even number of negations.
Definition 7.4. The fragment VTPTL is defined as the set of all TPTL formulae in which each unconstrained Until sub-term falls under an odd number of negations.
Proposition 7.5 (Monitorability of TPTL). The following holds:
CTPTL is complete monitorable.
STPTL is satisfaction monitorable.
VTPTL is violation monitorable.
The proof of Proposition 7.5 follows the same arguments used in the proof of Proposition 6.10.
Example 7.6. Recall the formula
ϕ ≤ 1 = x . ◊ ( b ∧ x ≤ 1 ∧ ( □ ( x ≤ 1 ) ⇒ ¬ b ) ) \phi_{\leq1} = x.\Diamond\left(b \land x \leq1 \land\left(\Box(x \leq1) \Rightarrow\neg b\right)\right) ϕ ≤ 1 = x . ◊ ( b ∧ x ≤ 1 ∧ ( □ ( x ≤ 1 ) ⇒ ¬ b ) ) from Example 2.12. Removing the syntactic sugar to fall back on the minimal syntax (Figure 3 ), we get:
x . ⊤ U ( b ∧ x ≤ 1 ∧ ¬ ( ⊤ U ( x ≤ 1 ∧ b ) ) ) x.\top\mathbin{\mathcal{U}} \left(b \land x \leq1 \land\neg\left(\top\mathbin{\mathcal{U}} (x \leq1 \land b)\right)\right) x .⊤ U ( b ∧ x ≤ 1 ∧ ¬ ( ⊤ U ( x ≤ 1 ∧ b ) ) ) We remark that every Until is constrained and therefore ϕ ≤ 1 \phi_{\leq1} ϕ ≤ 1 is complete monitorable. Naturally, using the compiler in Figure 21 , we get a T l i n T^{\mathrm{lin}} T lin formula that is directly in the complete-monitorable fragment C T l i n CT^{\mathrm{lin}} C T lin
consPToT l i n ( ϕ ≤ 1 ) = x ∈ ‾ ⟨ A c t ⟩ min ( X , ( y ∈ ‾ ⟨ y − x ≤ 1 ⟩ t t ∧ ⟨ b ⟩ t t ∧ ⋀ a ∈ A c t [ a ] max ( Y , ( z ∈ ‾ [ z − x ≤ 1 ] f f ∨ [ b ] f f ) ) ∧ ⋀ a ∈ A c t [ a ] y ∈ ‾ [ y − x ≤ 1 ] Y ) ∨ ⟨ A c t ⟩ z ∈ ‾ ⟨ z − x ≤ 1 ⟩ X ) \operatorname{consPToT}^{\mathrm{lin}}(\phi_{\leq1}) = x\mathbin{\underline{\in}}\langle\mathrm{Act}\rangle\min\left(X,\left(y\mathbin{\underline{\in}}\langle y-x \leq1\rangle\mathrm{tt} \land\langle b\rangle\mathrm{tt}\land\bigwedge_{a\in\mathrm{Act}}[a]\max\left(Y,\left(z\mathbin{\underline{\in}}[z-x \leq1]\mathrm{ff} \lor[b]\mathrm{ff}\right)\right)\land\bigwedge_{a\in\mathrm{Act}}[a]y\mathbin{\underline{\in}}[y-x \leq1]Y\right)\lor\langle\mathrm{Act}\rangle z\mathbin{\underline{\in}}\langle z-x \leq1\rangle X\right) consPToT lin ( ϕ ≤ 1 ) = x ∈ ⟨ Act ⟩ min ( X , ( y ∈ ⟨ y − x ≤ 1 ⟩ tt ∧ ⟨ b ⟩ tt ∧ a ∈ Act ⋀ [ a ] max ( Y , ( z ∈ [ z − x ≤ 1 ] ff ∨ [ b ] ff ) ) ∧ a ∈ Act ⋀ [ a ] y ∈ [ y − x ≤ 1 ] Y ) ∨ ⟨ Act ⟩ z ∈ ⟨ z − x ≤ 1 ⟩ X ) As in MTL, we can extend the rules to include non-strict temporal operators, where non-strict Until sub-terms should obey the same requirements as for the strict ones.
Example 7.7. Consider the formula ψ a l t , I \psi_{\mathrm{alt},I} ψ alt , I from Example 3.16, that is
ψ a l t , I = x . ( ψ 1 ∧ ψ 2 ∧ ψ 3 ∧ ψ 4 ) \psi_{\mathrm{alt},I} = x.(\psi_1 \land\psi_2 \land\psi_3 \land\psi_4) ψ alt , I = x . ( ψ 1 ∧ ψ 2 ∧ ψ 3 ∧ ψ 4 ) Where
ψ 1 = x ∈ I ⇒ b \psi_1 = x \in I \Rightarrow b ψ 1 = x ∈ I ⇒ b
ψ 2 = □ ≤ ( ( ( x ≺ ← I R B ( I ˉ ) ∧ ◯ x ∈ I ) ⇒ ◯ b ) ) \psi_2 = \Box^{\leq}\left(((x \prec_{\leftarrow I} RB(\bar{I}) \land\bigcirc x \in I) \Rightarrow\bigcirc b)\right) ψ 2 = □ ≤ ( (( x ≺ ← I R B ( I ˉ ) ∧ ◯ x ∈ I ) ⇒ ◯ b ) )
ψ 3 = □ ≤ ( ( ( x ∈ I ∧ b ∧ ◯ x ∈ I ) ⇒ ◯ c ) ) \psi_3 = \Box^{\leq}\left(((x \in I \land b \land\bigcirc x \in I) \Rightarrow\bigcirc c)\right) ψ 3 = □ ≤ ( (( x ∈ I ∧ b ∧ ◯ x ∈ I ) ⇒ ◯ c ) )
ψ 4 = □ ≤ ( ( ( x ∈ I ∧ c ∧ ◯ x ∈ I ) ⇒ ◯ b ) ) \psi_4 = \Box^{\leq}\left(((x \in I \land c \land\bigcirc x \in I) \Rightarrow\bigcirc b)\right) ψ 4 = □ ≤ ( (( x ∈ I ∧ c ∧ ◯ x ∈ I ) ⇒ ◯ b ) )
For any unbounded interval I I I , we can easily deduce that ψ a l t , I \psi_{alt,I} ψ a l t , I is violation monitorable: every Next sub-term is a constrained Until, the remaining sub-terms are (non-strict) unconstrained Globally, and therefore non-strict unconstrained Until under an odd number of negations.
If I I I is bounded, ψ a l t , I \psi_{alt,I} ψ a l t , I becomes also satisfaction monitorable and therefore complete monitorable. Let us show this going through its clauses. There is no Until sub-term in ψ 1 \psi_1 ψ 1 . For ψ 2 \psi_2 ψ 2 , we already know that the Next sub-terms are constrained Until, so we only rewrite the non-strict Globally as non-strict Until:
¬ ( ⊤ U ≤ ( x ≺ ← I R B ( I ˉ ) ∧ ◯ x ∈ I ∧ ¬ ◯ b ) ) \neg\left(\top\ U^{\leq}\left(x \prec_{\leftarrow I} RB(\bar{I}) \land\bigcirc x \in I \land\neg\bigcirc b\right)\right) ¬ ( ⊤ U ≤ ( x ≺ ← I R B ( I ˉ ) ∧ ◯ x ∈ I ∧ ¬ ◯ b ) )
The above term is of the form ¬ ( ϕ U ≤ ( x ≺ n ∧ ψ ′ ) ) \neg\left(\phi\ U^{\leq}\left(x \prec n \land\psi'\right)\right) ¬ ( ϕ U ≤ ( x ≺ n ∧ ψ ′ ) ) with ψ ′ = ◯ x ∈ I ∧ ¬ ◯ b \psi' = \bigcirc x \in I \land\neg\bigcirc b ψ ′ = ◯ x ∈ I ∧ ¬ ◯ b and is therefore (the negation of) a constrained Until.
For ψ 3 \psi_3 ψ 3 , since I I I is bounded, we have x ∈ I x \in I x ∈ I is of the form x ≺ n ∧ ψ ′ x \prec n \land\psi' x ≺ n ∧ ψ ′ with n = R B ( I ) n = RB(I) n = R B ( I ) and ψ ′ = ¬ ( x ≺ ← I ) ∧ ◯ x ∈ I ∧ ¬ ◯ c \psi' = \neg(x \prec_{\leftarrow I}) \land\bigcirc x \in I \land\neg\bigcirc c ψ ′ = ¬ ( x ≺ ← I ) ∧ ◯ x ∈ I ∧ ¬ ◯ c and therefore we get again the non-strict Globally sub-term corresponding to a non-strict constrained Until. The same reasoning carries on for ψ 4 \psi_4 ψ 4 . Therefore, if I I I is bounded, then every Until sub-term of ψ a l t , I \psi_{alt,I} ψ a l t , I is constrained. We conclude that ψ a l t , I \psi_{alt,I} ψ a l t , I is complete monitorable whenever I I I is bounded.
Related Work
The state of the art on RV of timed properties mainly centres around the study of LTL extensions such as MTL [36 ] and MITL, the fragment of MTL excluding singular intervals [6 ] . The use of a declarative logic to describe system behaviour creates a clear delineation between what can be specified and how this can then be verified algorithmically. This is in line with our approach and is more conducive to the study of monitorability. Baldor et al. [13 ] were the first to propose a transition based approach to monitoring of MITL formulae and establish complexity results for their proposed synthesis. Ho et al. [34 ] split unbounded and bounded parts of a dense-time MTL formula to permit a simpler construction for the bounded parts to obtain space-bounded monitors. Neither of these works consider monitorability issues.
The influential work by Bauer et al. [16 ] introduces the idea of an n n n -valued semantics for a timed version of LTL called TLTL, defined over trace prefixes by incorporating inconclusive outcome, typically denoted by “?”. This is used as a definition of the expected monitor behaviour when analysing a trace prefix online, which then guides a method of obtaining executable monitors from timed properties. The main drawback of the approach is that monitor synthesis disregards monitorability aspects; it generates monitors for any timed property, without information on whether such property is monitorable or not. The recent work on monitoring MITL by Grosen et al. [32 ] also suffers from this drawback as a result of adopting a three-valued semantics. Despite this, they propose new symbolic method of synthesising monitors for MITL properties via a translation into timed Büchi automata (TBA) [5 ] . Pinisetty et al. [48 ] focus on how prior knowledge can be used for sound predictive monitoring. All of the above works take into account in one sense or another infinite executions; the infinitary nature of traces poses the main complication when considering the monitorability of linear-time properties [2 ] . Popular work on synthesising monitors for timed LTL properties with a finitary semantics, such as that of Thati and Rosu [55 ] and of Basin et al. [15 ] sidestep any monitorability issues since every property becomes monitorable. The work by Basin et al. considers a first-order version of MTL called MFOTL to describe properties involving data ranging over an infinite domain. Ulus et al. [56 ] describe a monitor algorithm for Timed Regular Expressions based on the union of two-dimensional zones for finite words. Raszyk et al. [51 ] extend this work to an augmented monitoring setup that uses multiple analysis points (i.e., multi-head monitors) that relates to our parallel monitoring setup. The multi-head setup is used to lower the overheads of runtime executions, but bears no effect on the analytic power of the monitors or monitorability. Lima et al. [41 ] augment monitoring verdicts of MFOTL with explanations of why the monitored execution led to violations/satisfactions. This relies on the definition of a local proof-system [29 ] , and can be developed for T l i n T^{\mathrm{lin}} T lin as it has been for the untimed version of the linear-time μ \mu μ -calculus in [21 ] but is left for future work. Roussanaly et al. [53 ] study a decentralised monitor synthesis procedure for timed regular expressions that is similar to our parallel monitors. Note that a number of works study quantitative monitoring of STL [43 ] , a version of MITL interpreted over continuous signals, proposing thereby a robustness measure instead of yes/no verdicts. Such works sidestep monitorability problems either through approximate measures under infinitary semantics (see e.g., [22 ] ) or more precise measures under finitary semantics [52 ] .
In summary, our approach is complementary to the above efforts. On the one hand, our work is the first that proposes complete monitorability results for prominent timed logics within a unified framework. On the other hand, works such as [34 ] and [32 ] focus on efficiency of monitoring algorithms rather than monitorability issues.
Studies on monitorability generally consider one of two definitions; the one due to Pnueli and Zaks [49 ] or that due to Schneider [54 ] . Aceto et al. [4 ] have shown that the latter definition is strictly stronger and have systematised the various variants in terms of soundness and completeness criteria similar to those we used. In particular, the definition of monitorability assumed in our work is the stronger variant due to Schneider. Very recently, and subsequently to our [10 ] , Grosen et al. [31 ] studied monitorability in the timed setting using a straightforward extension of Pnueli-Zaks. They defined the following verdict function over finite timed words, parameterised with a property ϕ \phi ϕ
ν ϕ ( π ) = { ⊤ if ∀ π ′ ∈ Ext ( π ) : π ∈ [ [ ϕ ] ] ⊥ if ∀ π ′ ∈ Ext ( π ) : π ∉ [ [ ϕ ] ] ? otherwise \nu_{\phi}(\pi) =
\begin{cases}
\top& \text{if } \forall\pi' \in\operatorname{Ext}(\pi): \pi\in[\![\phi]\!] \\
\bot& \text{if } \forall\pi' \in\operatorname{Ext}(\pi): \pi\notin[\![\phi]\!] \\
? & \text{otherwise}
\end{cases} ν ϕ ( π ) = ⎩ ⎨ ⎧ ⊤ ⊥ ? if ∀ π ′ ∈ Ext ( π ) : π ∈ [ [ ϕ ] ] if ∀ π ′ ∈ Ext ( π ) : π ∈ / [ [ ϕ ] ] otherwise
and deemed ϕ \phi ϕ (strongly) monitorable iff for every π ∈ T A c t ∗ \pi\in\mathrm{TAct}^{*} π ∈ TAct ∗ , there exists π ′ \pi' π ′ , a finite extension of π \pi π , such that ν ϕ ( π ′ ) ∈ { ⊤ , ⊥ } \nu_{\phi}(\pi') \in\{\top,\bot\} ν ϕ ( π ′ ) ∈ { ⊤ , ⊥ } [31 Definition 3, point 4] . Our definition of monitorability differs from Grosen et al.’s w.r.t. to at least two aspects. First, we guarantee, for any monitorable formula ϕ \phi ϕ , the detection of all bad behaviours or all good behaviours, whereas the definition above does not. Take for instance the MTL formula ψ n m \psi_{nm} ψ nm in Example 6.11. We have showed within the same example that ψ n m \psi_{nm} ψ nm is not monitorable, and actually there is an infinite number of executions that violate ψ n m \psi_{nm} ψ nm and and an infinite number of executions that satisfy ψ n m \psi_{nm} ψ nm for which no verdict can ever be reached. In contrast ψ n m \psi_{nm} ψ nm is monitorable according to Grosen et al: for any finite timed word π \pi π , take the finite extension π ′ = π . ( c , t i ( ∣ π ∣ ) ) ( b , t i ( ∣ π ∣ ) + 10 ) \pi' = \pi.(c,t_i(\lvert\pi\rvert))(b,t_i(\lvert\pi\rvert)+10) π ′ = π . ( c , t i (∣ π ∣)) ( b , t i (∣ π ∣) + 10 ) and get ν ψ n m ( π ′ ) = ⊥ \nu_{\psi_{nm}}(\pi') = \bot ν ψ nm ( π ′ ) = ⊥ . This is because Pnueli-Zaks monitorability, of which Grosen et al.’s above is the timed counterpart, ensures the possibility to reach verdicts without guarantees to actually reach them. Second, as proven by Grosen et al. [31 Theorem 1] , the verdict function above is uncomputable for expressive formalisms such as non-deterministic TBA (NTBA), MTL, TPTL or our T l i n T^{lin} T l in . This is because, on the one hand, the verdict ⊤ \top ⊤ must be reached given the empty timed word iff ⟦ ϕ ⟧ = T A c t ω \llbracket\phi\rrbracket= \mathrm{TAct}^{\omega} [ [ ϕ ] ] = TAct ω , and on the other hand, the universality problem in NTBA is undecidable [5 ] , and so is the validity problem in MTL, TPTL and T l i n T^{lin} T l in (Theorem 2.10 , Theorem 2.13 , Theorem 3.12 ). This prevented reasoning on monitorability of NTBA altogether4 in [31 ] , and would have made such reasoning impossible in MTL, TPTL or T l i n T^{lin} T l in . The main reason behind this is the fact that V ϕ V_{\phi} V ϕ requires verdicts to be both sound and tight , i.e., it requires implicitly verdicts to be issued on the shortest prefix with all extensions in or outside the semantics of ϕ \phi ϕ . In contrast, our sound monitors, that can be seen as sound approximations of the verdict function, are a trade-off to reason on the inevitability of reaching verdicts without tightness requirements.
Conclusion
In this paper, we solved the monitorability problem for an expressive timed logic. We proposed T l i n T^{lin} T l in , a modal timed μ \mu μ -calculus with linear-time semantics and proved that it is strictly more expressive than the well-known and popular MTL and TPTL. Then, we precisely identified the maximal fragments, w.r.t. a rich monitorable fragment that we proposed, of violation-monitorable, satisfaction-monitorable, complete-monitorable, and monitorable formulae of T l i n T^{lin} T l in . Moreover, relying on automatic translations from MTL and TPTL to T l i n T^{lin} T l in and our characterisation of monitorable fragments of T l i n T^{lin} T l in , we isolated important monitorable fragments in MTL and TPTL that do not depend on the depth of formulae.
A natural direction of future work is to study the relationship between TBA and T l i n T^{lin} T l in , as we currently do not handle properties specified using the former. Another open question is the class of timed languages characterised by T l i n T^{lin} T l in , in comparison with that of languages recognised by alternating TBA.
Closure under complement of T l i n T^{lin} T l in
We first state a handy lemma (Lemma A.1) on the the duality between extremal fixed points of a function and its dual (see, e.g., [12 ] for further details). Let f : P ( T A c t ω ) → P ( T A c t ω ) f : \mathcal{P}(TAct^\omega) \to\mathcal{P}(TAct^\omega) f : P ( T A c t ω ) → P ( T A c t ω ) be a function. Its dual, denoted f ~ \tilde{f} f ~ , is defined as f ~ ( S ) = T A c t ω ∖ f ( T A c t ω ∖ S ) \tilde{f}(S) = TAct^\omega\setminus f(TAct^\omega\setminus S) f ~ ( S ) = T A c t ω ∖ f ( T A c t ω ∖ S ) for all S ⊆ T A c t ω S \subseteq TAct^\omega S ⊆ T A c t ω .
Lemma A.1. Let f : P ( T A c t ω ) → P ( T A c t ω ) f : \mathcal{P}(TAct^\omega) \to\mathcal{P}(TAct^\omega) f : P ( T A c t ω ) → P ( T A c t ω ) be monotone, then f ~ \tilde{f} f ~ is monotone and
μ x . f ~ ( x ) = T A c t ω ∖ ν x . f ( x ) \mu x.\tilde{f}(x) = TAct^\omega\setminus\nu x.f(x) μx . f ~ ( x ) = T A c t ω ∖ ν x . f ( x ) , and
ν x . f ~ ( x ) = T A c t ω ∖ μ x . f ( x ) \nu x.\tilde{f}(x) = TAct^\omega\setminus\mu x.f(x) ν x . f ~ ( x ) = T A c t ω ∖ μx . f ( x ) .
We are now ready to prove the main lemma
Lemma 3.7. Let ρ ˉ \bar{\rho} ρ ˉ denote the environment that maps any X ∈ dom ( ρ ) X \in\operatorname{dom}(\rho) X ∈ dom ( ρ ) to T A c t ω ∖ ρ ( X ) TAct^\omega\setminus\rho(X) T A c t ω ∖ ρ ( X ) . For all ϕ ∈ T T l i n \phi\in TT^{lin} ϕ ∈ T T l in , v ∈ V v \in\mathcal{V} v ∈ V and ρ ∈ Υ \rho\in\Upsilon ρ ∈ Υ with fv ( ϕ ) ⊆ dom ( ρ ) \operatorname{fv}(\phi) \subseteq\operatorname{dom}(\rho) fv ( ϕ ) ⊆ dom ( ρ ) , the following holds:
⟦ not ( ϕ ) , ρ ˉ ⟧ v = T A c t ω ∖ ⟦ ϕ , ρ ⟧ v \llbracket\operatorname{not}(\phi),\bar{\rho}\rrbracket_v = TAct^\omega\setminus\llbracket\phi,\rho\rrbracket_v [ [ not ( ϕ ) , ρ ˉ ] ] v = T A c t ω ∖ [ [ ϕ , ρ ] ] v
Proof. The proof proceeds by structural induction on ϕ \phi ϕ , with each case concluded by unfolding the definition of the semantics (Figure 5 ). For the case of fixed-point formulae, the proof relies on Eq. (3) and Lemma A.1.
The base cases are
ϕ = t t \phi= \mathsf{tt} ϕ = tt : ⟦ not ( t t ) , ρ ˉ ⟧ v = ∅ = T A c t ω ∖ T A c t ω = T A c t ω ∖ ⟦ t t , ρ ⟧ v \llbracket\operatorname{not}(\mathsf{tt}),\bar{\rho}\rrbracket_v = \varnothing= TAct^\omega\setminus TAct^\omega= TAct^\omega\setminus\llbracket\mathsf{tt},\rho\rrbracket_v [ [ not ( tt ) , ρ ˉ ] ] v = ∅ = T A c t ω ∖ T A c t ω = T A c t ω ∖ [ [ tt , ρ ] ] v .
ϕ = f f \phi= \mathsf{ff} ϕ = ff : ⟦ not ( f f ) , ρ ˉ ⟧ v = T A c t ω = T A c t ω ∖ ∅ = T A c t ω ∖ ⟦ f f , ρ ⟧ v \llbracket\operatorname{not}(\mathsf{ff}),\bar{\rho}\rrbracket_v = TAct^\omega= TAct^\omega\setminus\varnothing= TAct^\omega\setminus\llbracket\mathsf{ff},\rho\rrbracket_v [ [ not ( ff ) , ρ ˉ ] ] v = T A c t ω = T A c t ω ∖ ∅ = T A c t ω ∖ [ [ ff , ρ ] ] v .
ϕ = X \phi= X ϕ = X : ⟦ not ( X ) , ρ ˉ ⟧ v = ⟦ X , ρ ˉ ⟧ v = ρ ˉ ( X ) = T A c t ω ∖ ρ ( X ) = T A c t ω ∖ ⟦ X , ρ ⟧ v \llbracket\operatorname{not}(X),\bar{\rho}\rrbracket_v = \llbracket X,\bar{\rho}\rrbracket_v = \bar{\rho}(X) = TAct^\omega\setminus\rho(X) = TAct^\omega\setminus\llbracket X,\rho\rrbracket_v [ [ not ( X ) , ρ ˉ ] ] v = [ [ X , ρ ˉ ] ] v = ρ ˉ ( X ) = T A c t ω ∖ ρ ( X ) = T A c t ω ∖ [ [ X , ρ ] ] v .
The inductive cases are:
⟦ not ( ϕ 1 ∧ ϕ 2 ) , ρ ˉ ⟧ v = ⟦ not ( ϕ 1 ) ∨ not ( ϕ 2 ) , ρ ˉ ⟧ v = ⟦ not ( ϕ 1 ) , ρ ˉ ⟧ v ∪ ⟦ not ( ϕ 2 ) , ρ ˉ ⟧ v = ( T A c t ω ∖ ⟦ ϕ 1 , ρ ⟧ v ) ∪ ( T A c t ω ∖ ⟦ ϕ 2 , ρ ⟧ v ) ( I . H . ) = T A c t ω ∖ ( ⟦ ϕ 1 , ρ ⟧ v ∩ ⟦ ϕ 2 , ρ ⟧ v ) = T A c t ω ∖ ⟦ ϕ 1 ∧ ϕ 2 , ρ ⟧ v \begin{aligned}
\llbracket\operatorname{not}(\phi_1 \land\phi_2),\bar{\rho}\rrbracket_v
&= \llbracket\operatorname{not}(\phi_1) \lor\operatorname{not}(\phi_2),\bar{\rho}\rrbracket_v \\
&= \llbracket\operatorname{not}(\phi_1),\bar{\rho}\rrbracket_v \cup\llbracket\operatorname{not}(\phi_2),\bar{\rho}\rrbracket_v \\
&= (TAct^\omega\setminus\llbracket\phi_1,\rho\rrbracket_v) \cup(TAct^\omega\setminus\llbracket\phi_2,\rho\rrbracket_v) \quad(\mathrm{I.H.}) \\
&= TAct^\omega\setminus(\llbracket\phi_1,\rho\rrbracket_v \cap\llbracket\phi_2,\rho\rrbracket_v) \\
&= TAct^\omega\setminus\llbracket\phi_1 \land\phi_2,\rho\rrbracket_v
\end{aligned} [ [ not ( ϕ 1 ∧ ϕ 2 ) , ρ ˉ ] ] v = [ [ not ( ϕ 1 ) ∨ not ( ϕ 2 ) , ρ ˉ ] ] v = [ [ not ( ϕ 1 ) , ρ ˉ ] ] v ∪ [ [ not ( ϕ 2 ) , ρ ˉ ] ] v = ( T A c t ω ∖ [ [ ϕ 1 , ρ ] ] v ) ∪ ( T A c t ω ∖ [ [ ϕ 2 , ρ ] ] v ) ( I.H. ) = T A c t ω ∖ ( [ [ ϕ 1 , ρ ] ] v ∩ [ [ ϕ 2 , ρ ] ] v ) = T A c t ω ∖ [ [ ϕ 1 ∧ ϕ 2 , ρ ] ] v
⟦ not ( ϕ 1 ∨ ϕ 2 ) , ρ ˉ ⟧ v = ⟦ not ( ϕ 1 ) ∧ not ( ϕ 2 ) , ρ ˉ ⟧ v = ⟦ not ( ϕ 1 ) , ρ ˉ ⟧ v ∩ ⟦ not ( ϕ 2 ) , ρ ˉ ⟧ v = ( T A c t ω ∖ ⟦ ϕ 1 , ρ ⟧ v ) ∩ ( T A c t ω ∖ ⟦ ϕ 2 , ρ ⟧ v ) ( I . H . ) = T A c t ω ∖ ( ⟦ ϕ 1 , ρ ⟧ v ∪ ⟦ ϕ 2 , ρ ⟧ v ) = T A c t ω ∖ ⟦ ϕ 1 ∨ ϕ 2 , ρ ⟧ v \begin{aligned}
\llbracket\operatorname{not}(\phi_1 \lor\phi_2),\bar{\rho}\rrbracket_v
&= \llbracket\operatorname{not}(\phi_1) \land\operatorname{not}(\phi_2),\bar{\rho}\rrbracket_v \\
&= \llbracket\operatorname{not}(\phi_1),\bar{\rho}\rrbracket_v \cap\llbracket\operatorname{not}(\phi_2),\bar{\rho}\rrbracket_v \\
&= (TAct^\omega\setminus\llbracket\phi_1,\rho\rrbracket_v) \cap(TAct^\omega\setminus\llbracket\phi_2,\rho\rrbracket_v) \quad(\mathrm{I.H.}) \\
&= TAct^\omega\setminus(\llbracket\phi_1,\rho\rrbracket_v \cup\llbracket\phi_2,\rho\rrbracket_v) \\
&= TAct^\omega\setminus\llbracket\phi_1 \lor\phi_2,\rho\rrbracket_v
\end{aligned} [ [ not ( ϕ 1 ∨ ϕ 2 ) , ρ ˉ ] ] v = [ [ not ( ϕ 1 ) ∧ not ( ϕ 2 ) , ρ ˉ ] ] v = [ [ not ( ϕ 1 ) , ρ ˉ ] ] v ∩ [ [ not ( ϕ 2 ) , ρ ˉ ] ] v = ( T A c t ω ∖ [ [ ϕ 1 , ρ ] ] v ) ∩ ( T A c t ω ∖ [ [ ϕ 2 , ρ ] ] v ) ( I.H. ) = T A c t ω ∖ ( [ [ ϕ 1 , ρ ] ] v ∪ [ [ ϕ 2 , ρ ] ] v ) = T A c t ω ∖ [ [ ϕ 1 ∨ ϕ 2 , ρ ] ] v
⟦ not ( x i n ϕ 1 ) , ρ ˉ ⟧ v = ⟦ x i n not ( ϕ 1 ) , ρ ˉ ⟧ v = { π ∣ π ∈ ⟦ not ( ϕ 1 ) , ρ ˉ ⟧ v [ x : = t 1 ( π ) ] } = { π ∣ π ∈ T A c t ω ∖ ⟦ ϕ 1 , ρ ⟧ v [ x : = t 1 ( π ) ] } ( I . H . ) = T A c t ω ∖ { π ∣ π ∈ ⟦ ϕ 1 , ρ ⟧ v [ x : = t 1 ( π ) ] } = T A c t ω ∖ ⟦ x i n ϕ 1 , ρ ⟧ v \begin{aligned}
\llbracket\operatorname{not}(x \mathbin{\mathrm{in}} \phi_1),\bar{\rho}\rrbracket_v
&= \llbracket x \mathbin{\mathrm{in}} \operatorname{not}(\phi_1),\bar{\rho}\rrbracket_v \\
&= \{\pi\mid\pi\in\llbracket\operatorname{not}(\phi_1),\bar{\rho}\rrbracket_{v[x:=t_1(\pi)]}\} \\
&= \{\pi\mid\pi\in TAct^\omega\setminus\llbracket\phi_1,\rho\rrbracket_{v[x:=t_1(\pi)]}\} \quad(\mathrm{I.H.}) \\
&= TAct^\omega\setminus\{\pi\mid\pi\in\llbracket\phi_1,\rho\rrbracket_{v[x:=t_1(\pi)]}\} \\
&= TAct^\omega\setminus\llbracket x \mathbin{\mathrm{in}} \phi_1,\rho\rrbracket_v
\end{aligned} [ [ not ( x in ϕ 1 ) , ρ ˉ ] ] v = [ [ x in not ( ϕ 1 ) , ρ ˉ ] ] v = { π ∣ π ∈ [ [ not ( ϕ 1 ) , ρ ˉ ] ] v [ x := t 1 ( π )] } = { π ∣ π ∈ T A c t ω ∖ [ [ ϕ 1 , ρ ] ] v [ x := t 1 ( π )] } ( I.H. ) = T A c t ω ∖ { π ∣ π ∈ [ [ ϕ 1 , ρ ] ] v [ x := t 1 ( π )] } = T A c t ω ∖ [ [ x in ϕ 1 , ρ ] ] v
⟦ not ( ⟨ a ⟩ ϕ 1 ) , ρ ˉ ⟧ v = ⟦ [ a ] not ( ϕ 1 ) , ρ ˉ ⟧ v = ⟦ ⟨ a ⟩ not ( ϕ 1 ) , ρ ˉ ⟧ v ∪ { π ∣ a 1 ( π ) ≠ a } = ⟨ ⋅ a ⋅ ⟩ ( ⟦ not ( ϕ 1 ) , ρ ˉ ⟧ v ) ∪ { π ∣ a 1 ( π ) ≠ a } = ⟨ ⋅ a ⋅ ⟩ ( T A c t ω ∖ ⟦ ϕ 1 , ρ ⟧ v ) ∪ { π ∣ a 1 ( π ) ≠ a } ( I . H . ) = { π ∣ a 1 ( π ) ≠ a or π 2 ∈ T A c t ω ∖ ⟦ ϕ 1 , ρ ⟧ v } = T A c t ω ∖ ⟦ ⟨ a ⟩ ϕ 1 , ρ ⟧ v \begin{aligned}
\llbracket\operatorname{not}(\langle a\rangle\phi_1),\bar{\rho}\rrbracket_v
&= \llbracket[a]\operatorname{not}(\phi_1),\bar{\rho}\rrbracket_v\\
&= \llbracket\langle a\rangle\operatorname{not}(\phi_1),\bar{\rho}\rrbracket_v \cup\{\pi\mid a_1(\pi) \ne a\}\\
&= \langle\cdot a\cdot\rangle(\llbracket\operatorname{not}(\phi_1),\bar{\rho}\rrbracket_v) \cup\{\pi\mid a_1(\pi) \ne a\}\\
&= \langle\cdot a\cdot\rangle(\mathit{TAct}^{\omega}\setminus\llbracket\phi_1,\rho\rrbracket_v) \cup\{\pi\mid a_1(\pi) \ne a\}\quad(I.H.)\\
&= \{\pi\mid a_1(\pi) \ne a\ \text{or}\ \pi^2 \in\mathit{TAct}^{\omega}\setminus\llbracket\phi_1,\rho\rrbracket_v\}\\
&= \mathit{TAct}^{\omega}\setminus\llbracket\langle a\rangle\phi_1,\rho\rrbracket_v
\end{aligned} [ [ not (⟨ a ⟩ ϕ 1 ) , ρ ˉ ] ] v = [ [ [ a ] not ( ϕ 1 ) , ρ ˉ ] ] v = [ [ ⟨ a ⟩ not ( ϕ 1 ) , ρ ˉ ] ] v ∪ { π ∣ a 1 ( π ) = a } = ⟨ ⋅ a ⋅ ⟩ ( [ [ not ( ϕ 1 ) , ρ ˉ ] ] v ) ∪ { π ∣ a 1 ( π ) = a } = ⟨ ⋅ a ⋅ ⟩ ( TAct ω ∖ [ [ ϕ 1 , ρ ] ] v ) ∪ { π ∣ a 1 ( π ) = a } ( I . H . ) = { π ∣ a 1 ( π ) = a or π 2 ∈ TAct ω ∖ [ [ ϕ 1 , ρ ] ] v } = TAct ω ∖ [ [ ⟨ a ⟩ ϕ 1 , ρ ] ] v
⟦ not ( ⟨ g ⟩ ϕ 1 ) , ρ ˉ ⟧ v = ⟦ [ g ] not ( ϕ 1 ) , ρ ˉ ⟧ v = ⟦ ⟨ g ⟩ not ( ϕ 1 ) , ρ ˉ ⟧ v ∪ { π ∣ v ⊭ g } = ⟨ ⋅ g ⋅ ⟩ ( v , ⟦ not ( ϕ 1 ) , ρ ˉ ⟧ v ) ∪ { π ∣ v ⊭ g } = ⟨ ⋅ g ⋅ ⟩ ( v , T A c t ω ∖ ⟦ ϕ 1 , ρ ⟧ v ) ∪ { π ∣ v ⊭ g } ( I . H . ) = { π ∣ v ⊭ g or π ∈ T A c t ω ∖ ⟦ ϕ 1 , ρ ⟧ v } = T A c t ω ∖ ⟦ ⟨ g ⟩ ϕ 1 , ρ ⟧ v \begin{aligned}
\llbracket\operatorname{not}(\langle g\rangle\phi_1),\bar{\rho}\rrbracket_v
&= \llbracket[g]\operatorname{not}(\phi_1),\bar{\rho}\rrbracket_v\\
&= \llbracket\langle g\rangle\operatorname{not}(\phi_1),\bar{\rho}\rrbracket_v \cup\{\pi\mid v \not\models g\}\\
&= \langle\cdot g\cdot\rangle(v,\llbracket\operatorname{not}(\phi_1),\bar{\rho}\rrbracket_v) \cup\{\pi\mid v \not\models g\}\\
&= \langle\cdot g\cdot\rangle(v,\mathit{TAct}^{\omega}\setminus\llbracket\phi_1,\rho\rrbracket_v) \cup\{\pi\mid v \not\models g\}\quad(I.H.)\\
&= \{\pi\mid v \not\models g\ \text{or}\ \pi\in\mathit{TAct}^{\omega}\setminus\llbracket\phi_1,\rho\rrbracket_v\}\\
&= \mathit{TAct}^{\omega}\setminus\llbracket\langle g\rangle\phi_1,\rho\rrbracket_v
\end{aligned} [ [ not (⟨ g ⟩ ϕ 1 ) , ρ ˉ ] ] v = [ [ [ g ] not ( ϕ 1 ) , ρ ˉ ] ] v = [ [ ⟨ g ⟩ not ( ϕ 1 ) , ρ ˉ ] ] v ∪ { π ∣ v ⊨ g } = ⟨ ⋅ g ⋅ ⟩ ( v , [ [ not ( ϕ 1 ) , ρ ˉ ] ] v ) ∪ { π ∣ v ⊨ g } = ⟨ ⋅ g ⋅ ⟩ ( v , TAct ω ∖ [ [ ϕ 1 , ρ ] ] v ) ∪ { π ∣ v ⊨ g } ( I . H . ) = { π ∣ v ⊨ g or π ∈ TAct ω ∖ [ [ ϕ 1 , ρ ] ] v } = TAct ω ∖ [ [ ⟨ g ⟩ ϕ 1 , ρ ] ] v
⟦ not ( max ( X , ϕ 1 ) ) , ρ ˉ ⟧ v = ⟦ min ( X , not ( ϕ 1 ) ) , ρ ˉ ⟧ v = μ S . ⟦ not ( ϕ 1 ) , ρ ˉ [ X : = S ] ⟧ v = μ S . ⟦ not ( ϕ 1 ) , T A c t ω ∖ ρ [ X : = T A c t ω ∖ S ] ⟧ v = μ S . T A c t ω ∖ ⟦ ϕ 1 , ρ [ X : = T A c t ω ∖ S ] ⟧ v ( I . H . ) = T A c t ω ∖ ν S . ⟦ ϕ 1 , ρ [ X : = S ] ⟧ v ( Lemma A.1(1) ) = T A c t ω ∖ ⟦ max ( X , ϕ 1 ) , ρ ⟧ v \begin{aligned}
\llbracket\operatorname{not}(\max(X,\phi_1)),\bar{\rho}\rrbracket_v
&= \llbracket\min(X,\operatorname{not}(\phi_1)),\bar{\rho}\rrbracket_v\\
&= \mu S.\llbracket\operatorname{not}(\phi_1),\bar{\rho}[X := S]\rrbracket_v\\
&= \mu S.\llbracket\operatorname{not}(\phi_1),\mathit{TAct}^{\omega}\setminus\rho[X := \mathit{TAct}^{\omega}\setminus S]\rrbracket_v\\
&= \mu S.\mathit{TAct}^{\omega}\setminus\llbracket\phi_1,\rho[X := \mathit{TAct}^{\omega}\setminus S]\rrbracket_v\quad(I.H.)\\
&= \mathit{TAct}^{\omega}\setminus\nu S.\llbracket\phi_1,\rho[X := S]\rrbracket_v\quad(\textit{Lemma A.1(1)})\\
&= \mathit{TAct}^{\omega}\setminus\llbracket\max(X,\phi_1),\rho\rrbracket_v
\end{aligned} [ [ not ( max ( X , ϕ 1 )) , ρ ˉ ] ] v = [ [ min ( X , not ( ϕ 1 )) , ρ ˉ ] ] v = μ S . [ [ not ( ϕ 1 ) , ρ ˉ [ X := S ] ] ] v = μ S . [ [ not ( ϕ 1 ) , TAct ω ∖ ρ [ X := TAct ω ∖ S ] ] ] v = μ S . TAct ω ∖ [ [ ϕ 1 , ρ [ X := TAct ω ∖ S ] ] ] v ( I . H . ) = TAct ω ∖ ν S . [ [ ϕ 1 , ρ [ X := S ] ] ] v ( Lemma A.1(1) ) = TAct ω ∖ [ [ max ( X , ϕ 1 ) , ρ ] ] v
⟦ not ( min ( X , ϕ 1 ) ) , ρ ˉ ⟧ v = ⟦ max ( X , not ( ϕ 1 ) ) , ρ ˉ ⟧ v = ν S . ⟦ not ( ϕ 1 ) , ρ ˉ [ X : = S ] ⟧ v = ν S . ⟦ not ( ϕ 1 ) , T A c t ω ∖ ρ [ X : = T A c t ω ∖ S ] ⟧ v = ν S . T A c t ω ∖ ⟦ ϕ 1 , ρ [ X : = T A c t ω ∖ S ] ⟧ v ( I . H . ) = T A c t ω ∖ μ S . ⟦ ϕ 1 , ρ [ X : = S ] ⟧ v ( Lemma A.1(2) ) = T A c t ω ∖ ⟦ min ( X , ϕ 1 ) , ρ ⟧ v \begin{aligned}
\llbracket\operatorname{not}(\min(X,\phi_1)),\bar{\rho}\rrbracket_v
&= \llbracket\max(X,\operatorname{not}(\phi_1)),\bar{\rho}\rrbracket_v\\
&= \nu S.\llbracket\operatorname{not}(\phi_1),\bar{\rho}[X := S]\rrbracket_v\\
&= \nu S.\llbracket\operatorname{not}(\phi_1),\mathit{TAct}^{\omega}\setminus\rho[X := \mathit{TAct}^{\omega}\setminus S]\rrbracket_v\\
&= \nu S.\mathit{TAct}^{\omega}\setminus\llbracket\phi_1,\rho[X := \mathit{TAct}^{\omega}\setminus S]\rrbracket_v\quad(I.H.)\\
&= \mathit{TAct}^{\omega}\setminus\mu S.\llbracket\phi_1,\rho[X := S]\rrbracket_v\quad(\textit{Lemma A.1(2)})\\
&= \mathit{TAct}^{\omega}\setminus\llbracket\min(X,\phi_1),\rho\rrbracket_v
\end{aligned} [ [ not ( min ( X , ϕ 1 )) , ρ ˉ ] ] v = [ [ max ( X , not ( ϕ 1 )) , ρ ˉ ] ] v = ν S . [ [ not ( ϕ 1 ) , ρ ˉ [ X := S ] ] ] v = ν S . [ [ not ( ϕ 1 ) , TAct ω ∖ ρ [ X := TAct ω ∖ S ] ] ] v = ν S . TAct ω ∖ [ [ ϕ 1 , ρ [ X := TAct ω ∖ S ] ] ] v ( I . H . ) = TAct ω ∖ μ S . [ [ ϕ 1 , ρ [ X := S ] ] ] v ( Lemma A.1(2) ) = TAct ω ∖ [ [ min ( X , ϕ 1 ) , ρ ] ] v
Proofs about M t o T l i n \mathrm{MtoT}^{lin} MtoT l in and P t o T l i n \mathrm{PtoT}^{lin} PtoT l in
Correctness of M t o T l i n \mathrm{MtoT}^{lin} MtoT l in
Our aim now is to prove the following
Proposition 3.8. For every ϕ ∈ M T L \phi\in MTL ϕ ∈ M T L we have ⟦ ϕ ⟧ = ⟦ M t o T l i n ( ϕ ) ⟧ \llbracket\phi\rrbracket= \llbracket\mathrm{MtoT}^{lin}(\phi)\rrbracket [ [ ϕ ] ] = [ [ MtoT l in ( ϕ ) ] ] .
To avoid ambiguity, we use the symbol ⟦ − ⟧ M T L \llbracket-\rrbracket^{\mathrm{MTL}} [ [ − ] ] MTL when reasoning on the semantics of MTL formulae (i.e. Figure 2 ).
Proposition 3.8 follows from Lemma B.6, where we prove the soundness and completeness of M t o T l i n ( − ) \mathrm{MtoT}^{lin}(-) MtoT l in ( − ) simultaneously. This lemma is stated at the end of this subsection. Rather unsurprisingly, the proof of Proposition 3.8 relies on continuity and induction to reason about Until formulae.
We now review minor technicalities used in this appendix. Recall that 0 \boldsymbol{0} 0 denotes the valuation that maps any x ∈ D x \in\mathcal{D} x ∈ D to 0 \boldsymbol{0} 0 . Whenever convenient we use the following fact,
∀ ϕ ∈ T l i n , ρ ∈ Γ , v ∈ V : ⟦ ϕ , ρ ⟧ v = ⟦ ϕ ⟧ (7) \forall\phi\in T^{lin},\rho\in\Gamma,v \in\mathcal{V}: \llbracket\phi,\rho\rrbracket_v=\llbracket\phi\rrbracket \tag*{(7)} ∀ ϕ ∈ T l in , ρ ∈ Γ , v ∈ V : [ [ ϕ , ρ ] ] v = [ [ ϕ ] ] (7)
Where ⟦ ϕ ⟧ \llbracket\phi\rrbracket [ [ ϕ ] ] is a notation for ⟦ ϕ , ∅ ⟧ 0 \llbracket\phi,\emptyset\rrbracket_{\boldsymbol{0}} [ [ ϕ , ∅ ] ] 0 . This equality holds because the semantic of formulae in T l i n T^{lin} T l in (i.e. closed and guarded terms in T T l i n TT^{lin} T T l in ) does not depend on valuations and environments.
Notation: We use α , β , … \alpha,\beta,\ldots α , β , … to range over Act, while a , b , c a,b,c a , b , c are elements of Act. Recall that a i ( π ) a_i(\pi) a i ( π ) (resp. t i ( π ) t_i(\pi) t i ( π ) ) is the action (resp. the timestamp) of the timed event at position i i i in π \pi π . Given a timed word π \pi π and an i ∈ N > 0 i \in\mathbb{N}_{>0} i ∈ N > 0 we let
π i = { π if i = 1 , ( a i ( π ) , t i ( π ) ) . π i + 1 if i > 1 (8) \pi^i =
\begin{cases}
\pi& \text{if } i=1,\\
(a_i(\pi),t_i(\pi)).\pi^{i+1} & \text{if } i>1
\end{cases} \tag*{(8)} π i = { π ( a i ( π ) , t i ( π )) . π i + 1 if i = 1 , if i > 1 (8)
where the operation ⋅ \cdot ⋅ denotes concatenation. A more formal definition on paper can be given by coinduction. An implementation of π i \pi^i π i is the function Str_nth_tl of the standard Coq library for streams.5
Whenever we apply the functions ⟦ ϕ ⟧ v , Y , ρ \llbracket\phi\rrbracket_{v,Y,\rho} [ [ ϕ ] ] v , Y , ρ , ⟨ ⋅ α ⋅ ⟩ ( − ) \langle\cdot\alpha\cdot\rangle(-) ⟨ ⋅ α ⋅ ⟩ ( − ) and [ ⋅ α ⋅ ] ( − ) [\cdot\alpha\cdot](-) [ ⋅ α ⋅ ] ( − ) to a singleton set, for instance { π } \{\pi\} { π } , we shorten the notation to ⟦ ϕ ⟧ v , Y , ρ ( π ) \llbracket\phi\rrbracket_{v,Y,\rho}(\pi) [ [ ϕ ] ] v , Y , ρ ( π ) , ⟨ ⋅ α ⋅ ⟩ ( π ) \langle\cdot\alpha\cdot\rangle(\pi) ⟨ ⋅ α ⋅ ⟩ ( π ) , [ ⋅ α ⋅ ] ( π ) [\cdot\alpha\cdot](\pi) [ ⋅ α ⋅ ] ( π ) .
An auxiliary function and its properties
Consider the following term:
⋁ α ∈ A c t ⟨ α ⟩ Y \bigvee_{\alpha\in\mathrm{Act}}\langle\alpha\rangle Y α ∈ Act ⋁ ⟨ α ⟩ Y
It is syntactically defined thanks to the assumption that the set Act is finite (see § 2 ), and it plays a crucial role in the definition of M t o T l i n \mathrm{MtoT}^{lin} MtoT l in . In fact, we introduce a function from variables to the above term,
D s j A c t ( Y ) = ⋁ α ∈ A c t ⟨ α ⟩ Y \mathrm{DsjAct}(Y)=\bigvee_{\alpha\in\mathrm{Act}}\langle\alpha\rangle Y DsjAct ( Y ) = α ∈ Act ⋁ ⟨ α ⟩ Y
The term D s j A c t ( Y ) \mathrm{DsjAct}(Y) DsjAct ( Y ) plays a crucial in the main proofs of this section, so in this section we gather its key properties, that are given in the next three lemmas.
Lemma B.1. For every term ϕ ∈ T T l i n \phi\in TT^{lin} ϕ ∈ T T l in , every v v v , every Y Y Y , every ρ \rho ρ such that f v ( ϕ ) ⊆ dom ( ρ ) ∪ { Y } fv(\phi) \subseteq\operatorname{dom}(\rho) \cup\{Y\} f v ( ϕ ) ⊆ dom ( ρ ) ∪ { Y } , and every S ∈ P ( T A c t ω ) S \in\mathcal{P}(TAct^\omega) S ∈ P ( T A c t ω ) , it holds that
⟦ D s j A c t ( Y ) ⟧ v , Y , ρ ( S ) = ⋃ α ∈ A c t { π ∣ a 1 ( π ) = α and π 2 ∈ S } . \llbracket DsjAct(Y)\rrbracket_{v,Y,\rho}(S) = \bigcup_{\alpha\in Act} \{\pi\mid a_1(\pi) = \alpha\text{ and } \pi^2 \in S\}. [ [ D s j A c t ( Y ) ] ] v , Y , ρ ( S ) = α ∈ A c t ⋃ { π ∣ a 1 ( π ) = α and π 2 ∈ S } . Proof. By unfolding the definitions:
⟦ D s j A c t ( Y ) ⟧ v , Y , ρ ( S ) = ⋃ α ∈ A c t ( ⟨ α ⟩ Y ⟧ v , Y , ρ ( S ) ) = ⋃ α ∈ A c t ( ⟨ ⋅ α ⋅ ⟩ ( ⟦ Y ⟧ v , Y , ρ ( S ) ) ) = ⋃ α ∈ A c t ( ⟨ ⋅ α ⋅ ⟩ ( S ) ) = ⋃ α ∈ A c t { π ∣ a 1 ( π ^ ) = α and π 2 ∈ { S } } . \begin{aligned}
\llbracket DsjAct(Y)\rrbracket_{v,Y,\rho}(S) &= \bigcup_{\alpha\in Act}(\langle\alpha\rangle Y\rrbracket_{v,Y,\rho}(S)) \\
&= \bigcup_{\alpha\in Act}(\langle\cdot\alpha\cdot\rangle(\llbracket Y\rrbracket_{v,Y,\rho}(S))) \\
&= \bigcup_{\alpha\in Act}(\langle\cdot\alpha\cdot\rangle(S)) \\
&= \bigcup_{\alpha\in Act}\{\pi\mid a_1(\hat{\pi}) = \alpha\text{ and } \pi^2 \in\{S\}\}.
\end{aligned} [ [ D s j A c t ( Y ) ] ] v , Y , ρ ( S ) = α ∈ A c t ⋃ (⟨ α ⟩ Y ] ] v , Y , ρ ( S )) = α ∈ A c t ⋃ (⟨ ⋅ α ⋅ ⟩ ( [ [ Y ] ] v , Y , ρ ( S ))) = α ∈ A c t ⋃ (⟨ ⋅ α ⋅ ⟩ ( S )) = α ∈ A c t ⋃ { π ∣ a 1 ( π ^ ) = α and π 2 ∈ { S }} .
We now explain the next two lemmas. Our aim is to establish a relation between the semantics of M T L MTL M T L -formulae and of T l i n T^{lin} T l in ones.
On one hand the semantics of M T L MTL M T L -formulae explicitly uses positions in timed words. For instance, a timed word π \pi π is in the semantics of a formula ϕ 1 U I ϕ 2 \phi_1\ U_I\ \phi_2 ϕ 1 U I ϕ 2 if there exists a position (i.e. a natural) i i i such that the suffix π i \pi^i π i is in the semantics of ϕ 2 \phi_2 ϕ 2 and for all position j j j strictly smaller than i i i , the suffix π j \pi^j π j is in the semantics of ϕ 1 \phi_1 ϕ 1 and the time elapsed i.e. t i ( π ) − t 1 ( π ) t_i(\pi)-t_1(\pi) t i ( π ) − t 1 ( π ) is in I I I . On the other hand, the semantics of T l i n T^{lin} T l in -formulae uses fixed points of functions instead of positions in timed words. For instance, π \pi π is in the semantics of min ( X , ϕ ) \min(X,\phi) min ( X , ϕ ) if it belongs to all prefixed points of the function λ x . ⟦ ϕ , [ X ↦ x ] ⟧ v \lambda x.\llbracket\phi,[X\mapsto x]\rrbracket_v λ x . [ [ ϕ , [ X ↦ x ] ] ] v (See Example 3.9).
Thanks to the continuity of the semantics of T l i n T^{lin} T l in , and in particular to Eq. (4) , the approach based on fixed points captures the properties expressed via positions. The first steps to lay this bare are carried out in Lemma B.3 and Lemma B.4 . These lemmas are helpful to prove the soundness and completeness of M t o T l i n MtoT^{lin} M t o T l in respectively, and some explanations are in order.
The Lemma B.3 states that if a timed word π \pi π is in the semantics of the term min ( Y , ϕ ∨ ( ψ ∧ D s j A c t ( Y ) ) ) \min(Y,\phi\vee(\psi\wedge DsjAct(Y))) min ( Y , ϕ ∨ ( ψ ∧ D s j A c t ( Y ))) then there exists a position i i i in π \pi π such that π i \pi^i π i is in the semantics of ϕ \phi ϕ and for every position j j j strictly smaller that i i i , π j \pi^j π j is in the semantics of ψ \psi ψ . This is the intuition that we have of the semantics of this formula and one should notice the similarity with the semantics of ϕ 1 U I ϕ 2 \phi_1\ U_I\ \phi_2 ϕ 1 U I ϕ 2 .
First, an auxiliary fact.
Lemma B.2. For all π ∈ T A c t ω \pi\in TAct^\omega π ∈ T A c t ω and k ∈ N k \in\mathbb{N} k ∈ N we have that ( π k ) 2 = ( π k ) 2 = ( π ) k + 1 (\pi^k)^2 = (\pi^k)_2 = (\pi)^{k+1} ( π k ) 2 = ( π k ) 2 = ( π ) k + 1 .
Proof. By induction on k k k .
Lemma B.3. For all terms ϕ , ψ ∈ T T l i n \phi,\psi\in TT^{lin} ϕ , ψ ∈ T T l in with f v ( ϕ ) = f v ( ψ ) = ∅ fv(\phi)=fv(\psi)=\varnothing f v ( ϕ ) = f v ( ψ ) = ∅ , every v ∈ V v \in\mathcal{V} v ∈ V , x ∈ D x \in\mathcal{D} x ∈ D , Y ∈ Y Y \in\mathcal{Y} Y ∈ Y , π ∈ T A c t ω \pi\in TAct^\omega π ∈ T A c t ω and n ≥ 0 n \ge0 n ≥ 0 , if
π ∈ { x i n ( ϕ ∨ ( ψ ∧ D s j A c t ( Y ) ) ) } v , Y , ∅ n ( ∅ ) (9) \pi\in\{x\mathbin{\mathrm{in}}(\phi\vee(\psi\wedge DsjAct(Y)))\}_{v,Y,\varnothing}^{n}(\varnothing) \tag*{(9)} π ∈ { x in ( ϕ ∨ ( ψ ∧ D s j A c t ( Y ))) } v , Y , ∅ n ( ∅ ) (9) then there exists some i ≥ 1 i \ge1 i ≥ 1 such that
π i ∈ ⟦ ϕ ⟧ v [ x : = t i ( π ) ] \pi^i \in\llbracket\phi\rrbracket_{v[x:=t_i(\pi)]} π i ∈ [ [ ϕ ] ] v [ x := t i ( π )] , and
For all 1 ≤ j < i 1 \le j < i 1 ≤ j < i : π j ∈ ⟦ ψ ⟧ v [ x : = t j ( π ) ] \pi^j \in\llbracket\psi\rrbracket_{v[x:=t_j(\pi)]} π j ∈ [ [ ψ ] ] v [ x := t j ( π )] .
Proof. We prove (1) and (2) at the same time reasoning by induction on n n n :
{ x i n ( ϕ ∨ ( ψ ∧ D s j A c t ( Y ) ) ) } v , Y , ∅ n ( ∅ ) = ∅ \{x\mathbin{\mathrm{in}}(\phi\vee(\psi\wedge DsjAct(Y)))\}_{v,Y,\varnothing}^{n}(\varnothing)=\varnothing { x in ( ϕ ∨ ( ψ ∧ D s j A c t ( Y ))) } v , Y , ∅ n ( ∅ ) = ∅ which contradicts the hypothesis in Eq. (9) .
n = m + 1 n=m+1 n = m + 1 : By Eq. (9) , we have
π ∈ { φ ∨ ( ψ ∧ D s A c t ( Y ) ) } v , Y , ∅ ( S ) (10) \pi\in\{\varphi\lor(\psi\land\mathrm{DsAct}(Y))\}_{v,Y,\varnothing}(S) \tag*{(10)} π ∈ { φ ∨ ( ψ ∧ DsAct ( Y )) } v , Y , ∅ ( S ) (10)
where S = { φ ∨ ( ψ ∧ D s A c t ( Y ) ) } v , Y , ∅ m ( ∅ ) S=\{\varphi\lor(\psi\land\mathrm{DsAct}(Y))\}^{m}_{v,Y,\varnothing}(\varnothing) S = { φ ∨ ( ψ ∧ DsAct ( Y )) } v , Y , ∅ m ( ∅ ) . To conclude the proof, we have to define i ≥ 1 i\geq1 i ≥ 1 such that (1) and (2) hold. From Eq. (9) and Figure 5 , at least one the following holds
(a) π ∈ ⟦ φ , [ Y ↦ S ] ⟧ v [ x : = t 1 ( π ) ] \pi\in\llbracket\varphi,[Y\mapsto S]\rrbracket_{v[x:=t_1(\pi)]} π ∈ [ [ φ , [ Y ↦ S ] ] ] v [ x := t 1 ( π )] , or
(b) π ∈ ⟦ ψ ∧ D s A c t ( Y ) , [ Y ↦ S ] ⟧ v [ x : = t 1 ( π ) ] \pi\in\llbracket\psi\land\mathrm{DsAct}(Y),[Y\mapsto S]\rrbracket_{v[x:=t_1(\pi)]} π ∈ [ [ ψ ∧ DsAct ( Y ) , [ Y ↦ S ] ] ] v [ x := t 1 ( π )] .
If (a) holds, then, for i = 1 i=1 i = 1 , we conclude (1) because f v ( φ ) = ∅ fv(\varphi)=\varnothing f v ( φ ) = ∅ , meaning that the environment is irrelevant; and (2) holds by vacuity. The second case, where (b) is true, requires more work. The semantics of conjunction and Lemma B.1 ensure that
π ∈ ⟦ ψ , [ Y ↦ S ] ⟧ v [ x : = t 1 ( π ) ] and ∃ α ∈ A c t : a 1 ( π ) = α and π 2 ∈ S (11) \pi\in\llbracket\psi,[Y\mapsto S]\rrbracket_{v[x:=t_1(\pi)]}\ \text{and}\ \exists\alpha\in\mathrm{Act}:a_1(\pi)=\alpha\ \text{and}\ \pi^2\in S \tag*{(11)} π ∈ [ [ ψ , [ Y ↦ S ] ] ] v [ x := t 1 ( π )] and ∃ α ∈ Act : a 1 ( π ) = α and π 2 ∈ S (11)
Since m < n m<n m < n the inductive hypothesis guarantees the existence of k ≥ 1 k\geq1 k ≥ 1 such that
( π 2 ) k ∈ ⟦ φ ⟧ v [ x : = t k ( π 2 ) ] and for all 1 ≤ j < k : ( π 2 ) j ∈ ⟦ ψ ⟧ v [ x : = t j ( π 2 ) ] (\pi^2)^k\in\llbracket\varphi\rrbracket_{v[x:=t_k(\pi^2)]}\ \text{and for all }1\leq j<k:(\pi^2)^j\in\llbracket\psi\rrbracket_{v[x:=t_j(\pi^2)]} ( π 2 ) k ∈ [ [ φ ] ] v [ x := t k ( π 2 )] and for all 1 ≤ j < k : ( π 2 ) j ∈ [ [ ψ ] ] v [ x := t j ( π 2 )]
which thanks to Lemma B.2 becomes
( π ) k + 1 ∈ ⟦ φ ⟧ v [ x : = t k + 1 ( π ) ] and for all 1 ≤ j < k : ( π ) j + 1 ∈ ⟦ ψ ⟧ v [ x : = t j + 1 ( π ) ] (\pi)^{k+1}\in\llbracket\varphi\rrbracket_{v[x:=t_{k+1}(\pi)]}\ \text{and for all }1\leq j<k:(\pi)^{j+1}\in\llbracket\psi\rrbracket_{v[x:=t_{j+1}(\pi)]} ( π ) k + 1 ∈ [ [ φ ] ] v [ x := t k + 1 ( π )] and for all 1 ≤ j < k : ( π ) j + 1 ∈ [ [ ψ ] ] v [ x := t j + 1 ( π )]
By manipulating the naturals in the statement on the right, the above statement is equivalent to
( π ) k + 1 ∈ ⟦ φ ⟧ v [ x : = t k + 1 ( π ) ] and for all 2 ≤ j < k + 1 : ( π ) j ∈ ⟦ ψ ⟧ v [ x : = t j ( π ) ] (\pi)^{k+1}\in\llbracket\varphi\rrbracket_{v[x:=t_{k+1}(\pi)]}\ \text{and for all }2\leq j<k+1:(\pi)^j\in\llbracket\psi\rrbracket_{v[x:=t_j(\pi)]} ( π ) k + 1 ∈ [ [ φ ] ] v [ x := t k + 1 ( π )] and for all 2 ≤ j < k + 1 : ( π ) j ∈ [ [ ψ ] ] v [ x := t j ( π )]
Therefore, we conclude (1) by letting i = k + 1 i=k+1 i = k + 1 . Moreover, (2) follows from the above statement and from π ∈ ⟦ ψ ⟧ v [ x : = t 1 ( π ) ] \pi\in\llbracket\psi\rrbracket_{v[x:=t_1(\pi)]} π ∈ [ [ ψ ] ] v [ x := t 1 ( π )] , as given in Eq. (11) , since f v ( ψ ) = ∅ fv(\psi)=\varnothing f v ( ψ ) = ∅ .
We use the next lemma in the proof of the completeness of M t o T l i n \mathrm{MtoT}^{lin} MtoT l in .
Lemma B.4. For every term ϕ ∈ T T l i n \phi\in TT^{lin} ϕ ∈ T T l in , every v v v , every Y Y Y , every ρ \rho ρ such that f v ( ϕ ) ⊆ d o m ( ρ ) ∪ { Y } fv(\phi)\subseteq dom(\rho)\cup\{Y\} f v ( ϕ ) ⊆ d o m ( ρ ) ∪ { Y } , for every i ≥ 1 i\geq1 i ≥ 1 and π \pi π , if
( ∀ j .1 ≤ j ≤ i : π j ∈ ⟦ ϕ ⟧ v , Y , ρ ( π j + 1 ) ) (\forall j.1\leq j\leq i:\pi^j\in\llbracket\phi\rrbracket_{v,Y,\rho}(\pi^{j+1})) ( ∀ j .1 ≤ j ≤ i : π j ∈ [ [ ϕ ] ] v , Y , ρ ( π j + 1 )) then
π ∈ ⟦ ϕ ∧ D s A c t ( Y ) ⟧ v , Y , ρ ( π i + 1 ) . \pi\in\llbracket\phi\land\mathrm{DsAct}(Y)\rrbracket_{v,Y,\rho}(\pi^{i+1}). π ∈ [ [ ϕ ∧ DsAct ( Y ) ] ] v , Y , ρ ( π i + 1 ) .
Proof. By induction on i i i :
i = 1 i=1 i = 1 : Suppose π 1 ∈ ⟦ ϕ ⟧ v , Y , ρ ( π 2 ) \pi^1\in\llbracket\phi\rrbracket_{v,Y,\rho}(\pi^2) π 1 ∈ [ [ ϕ ] ] v , Y , ρ ( π 2 ) . Thanks to Eq. (8) we know π 1 = π \pi^1=\pi π 1 = π , and hence we have to prove π ∈ ⟦ ϕ ∧ D s A c t ( Y ) ⟧ v , Y , ρ ( π 2 ) \pi\in\llbracket\phi\land\mathrm{DsAct}(Y)\rrbracket_{v,Y,\rho}(\pi^2) π ∈ [ [ ϕ ∧ DsAct ( Y ) ] ] v , Y , ρ ( π 2 ) , that is
π ∈ ⟦ ϕ ⟧ v , Y , ρ ( π 2 ) ∩ ⟦ D s A c t ( Y ) ⟧ v , Y , ρ ( π 2 ) . \pi\in\llbracket\phi\rrbracket_{v,Y,\rho}(\pi^2)\cap\llbracket\mathrm{DsAct}(Y)\rrbracket_{v,Y,\rho}(\pi^2). π ∈ [ [ ϕ ] ] v , Y , ρ ( π 2 ) ∩ [ [ DsAct ( Y ) ] ] v , Y , ρ ( π 2 ) .
Since we already know π ∈ ⟦ ϕ ⟧ v , Y , ρ ( π 2 ) \pi\in\llbracket\phi\rrbracket_{v,Y,\rho}(\pi^2) π ∈ [ [ ϕ ] ] v , Y , ρ ( π 2 ) by assumption, it remains to prove that π ∈ ⟦ D s A c t ( Y ) ⟧ v , Y , ρ ( π 2 ) \pi\in\llbracket\mathrm{DsAct}(Y)\rrbracket_{v,Y,\rho}(\pi^2) π ∈ [ [ DsAct ( Y ) ] ] v , Y , ρ ( π 2 ) . Lemma B.1 implies that
⟦ D s A c t ( Y ) ⟧ v , Y , ρ ( π 2 ) = ⋃ α ∈ A c t { π ∣ a 1 ( π ) = α and π 2 = π 2 } \llbracket\mathrm{DsAct}(Y)\rrbracket_{v,Y,\rho}(\pi^2)=\bigcup_{\alpha\in\mathrm{Act}}\{\pi\mid a_1(\pi)=\alpha\ \text{and}\ \pi^2=\pi^2\} [ [ DsAct ( Y ) ] ] v , Y , ρ ( π 2 ) = α ∈ Act ⋃ { π ∣ a 1 ( π ) = α and π 2 = π 2 }
thus we have to prove that
π ∈ ⋃ α ∈ A c t { π ∣ a 1 ( π ) = α and π 2 = π 2 } \pi\in\bigcup_{\alpha\in\mathrm{Act}}\{\pi\mid a_1(\pi)=\alpha\ \text{and}\ \pi^2=\pi^2\} π ∈ α ∈ Act ⋃ { π ∣ a 1 ( π ) = α and π 2 = π 2 }
and this is trivially true, because a 1 ( π ) ∈ A c t a_1(\pi)\in\mathrm{Act} a 1 ( π ) ∈ Act and π 2 = π 2 \pi^2=\pi^2 π 2 = π 2 . i = k + 1 i = k + 1 i = k + 1 : The hypothesis states that
∀ j .1 ≤ j ≤ i : π j ∈ { φ } v , Y , ρ ( π j + 1 ) (12) \forall j. 1 \le j \le i : \pi^j \in\{\varphi\}_{v,Y,\rho}(\pi^{j+1}) \tag*{(12)} ∀ j .1 ≤ j ≤ i : π j ∈ { φ } v , Y , ρ ( π j + 1 ) (12)
and the goal is to prove that
π ∈ { φ ∧ D S j A c t ( Y ) } v , Y , ρ i ( π i + 1 ) . \pi\in\{\varphi\land\mathrm{DSjAct}(Y)\}_{v,Y,\rho}^{i}(\pi^{i+1}). π ∈ { φ ∧ DSjAct ( Y ) } v , Y , ρ i ( π i + 1 ) .
Let f = { φ ∧ D S j A c t ( Y ) } v , Y , ρ f = \{\varphi\land\mathrm{DSjAct}(Y)\}_{v,Y,\rho} f = { φ ∧ DSjAct ( Y ) } v , Y , ρ . Given that i = k + 1 i = k + 1 i = k + 1 , (5) implies
f i ( π i + 1 ) = ( f k ∘ f ) ( π i + 1 ) = f k ( f ( π i + 1 ) ) f^i(\pi^{i+1}) = (f^k \circ f)(\pi^{i+1}) = f^k(f(\pi^{i+1})) f i ( π i + 1 ) = ( f k ∘ f ) ( π i + 1 ) = f k ( f ( π i + 1 ))
and thus our goal becomes the proof of
π ∈ f k ( f ( π i + 1 ) ) (13) \pi\in f^k(f(\pi^{i+1})) \tag*{(13)} π ∈ f k ( f ( π i + 1 )) (13)
To prove (13) it suffices to construct a set B B B such that
π ∈ f k ( B ) \pi\in f^k(B) π ∈ f k ( B ) .
B ⊆ f ( π i + 1 ) B \subseteq f(\pi^{i+1}) B ⊆ f ( π i + 1 ) .
The rest of the argument explains how to do this. The inductive hypothesis ensures the following,
( ∀ m .1 ≤ m ≤ k : π m ∈ { φ } v , Y , ρ ( π m + 1 ) ) implies π ∈ f k ( π k + 1 ) (14) (\forall m. 1 \le m \le k : \pi^m \in\{\varphi\}_{v,Y,\rho}(\pi^{m+1})) \text{ implies } \pi\in f^k(\pi^{k+1}) \tag*{(14)} ( ∀ m .1 ≤ m ≤ k : π m ∈ { φ } v , Y , ρ ( π m + 1 )) implies π ∈ f k ( π k + 1 ) (14)
(12) ensures that the premises of the implication (14) are true, hence we know that the conclusion holds: π ∈ f k ( π k + 1 ) \pi\in f^k(\pi^{k+1}) π ∈ f k ( π k + 1 ) . Since i = k + 1 i = k + 1 i = k + 1 we obtain
π ∈ f k ( π i ) (15) \pi\in f^k(\pi^i) \tag*{(15)} π ∈ f k ( π i ) (15)
Now let B = { π i } B = \{\pi^i\} B = { π i } . By construction (1) is true, and it remains to explain why (2) is true. As by definition f = { φ ∧ D S j A c t ( Y ) } v , Y , ρ f = \{\varphi\land\mathrm{DSjAct}(Y)\}_{v,Y,\rho} f = { φ ∧ DSjAct ( Y ) } v , Y , ρ and B B B contains only π i \pi^i π i , we have to prove the following two facts:
π i ∈ { φ } v , Y , ρ ( π i + 1 ) (16) \pi^i \in\{\varphi\}_{v,Y,\rho}(\pi^{i+1}) \tag*{(16)} π i ∈ { φ } v , Y , ρ ( π i + 1 ) (16)
and
π i ∈ { D S j A c t ( Y ) } v , Y , ρ ( π i + 1 ) (17) \pi^i \in\{\mathrm{DSjAct}(Y)\}_{v,Y,\rho}(\pi^{i+1}) \tag*{(17)} π i ∈ { DSjAct ( Y ) } v , Y , ρ ( π i + 1 ) (17)
hold. (16) follows from the hypothesis, i.e. (12) , letting j = i j = i j = i . To prove (17) , thanks to Lemma B.1, it suffices to explain why ( π i ) 2 ∈ { π i + 1 } (\pi^i)^2 \in\{\pi^{i+1}\} ( π i ) 2 ∈ { π i + 1 } . This is a consequence of Lemma B.2, and so we conclude the argument.
Recall the semantics of the logics M T L MTL M T L in Figure 2 , T l i n T^{lin} T l in in Figure 5 , and the definition of the function M t o T l i n \mathrm{MtoT}^{lin} MtoT l in in Figure 6 .
As preliminary fact, observe that the function M t o T l i n \mathrm{MtoT}^{lin} MtoT l in generates formulae (i.e. closed and guarded terms).
Lemma B.5. For every ϕ ∈ M T L \phi\in MTL ϕ ∈ M T L we have that M t o T l i n ( ϕ ) ∈ T l i n \mathrm{MtoT}^{lin}(\phi) \in T^{lin} MtoT l in ( ϕ ) ∈ T l in .
Proof. Pick ϕ ∈ M T L \phi\in MTL ϕ ∈ M T L . Since M t o T l i n ( ϕ ) ∈ T T l i n \mathrm{MtoT}^{lin}(\phi) \in TT^{lin} MtoT l in ( ϕ ) ∈ T T l in we have to show that M t o T l i n ( ϕ ) \mathrm{MtoT}^{lin}(\phi) MtoT l in ( ϕ ) is closed and guarded. We proceed by structural induction on ϕ \phi ϕ .
For the cases ϕ = ⊤ \phi= \top ϕ = ⊤ and ϕ = α \phi= \alpha ϕ = α we know M t o T l i n ( ϕ ) = t t \mathrm{MtoT}^{lin}(\phi) = \mathrm{tt} MtoT l in ( ϕ ) = tt and M t o T l i n ( ϕ ) = ⟨ α ⟩ t t \mathrm{MtoT}^{lin}(\phi) = \langle\alpha\rangle\mathrm{tt} MtoT l in ( ϕ ) = ⟨ α ⟩ tt respectively. These terms are both trivially closed and guarded for they contain no variables.
For the case ϕ = ϕ 1 ∧ ϕ 2 \phi= \phi_1 \land\phi_2 ϕ = ϕ 1 ∧ ϕ 2 where M t o T l i n ( ϕ ) = M t o T l i n ( ϕ 1 ) ∧ M t o T l i n ( ϕ 2 ) \mathrm{MtoT}^{lin}(\phi) = \mathrm{MtoT}^{lin}(\phi_1) \land\mathrm{MtoT}^{lin}(\phi_2) MtoT l in ( ϕ ) = MtoT l in ( ϕ 1 ) ∧ MtoT l in ( ϕ 2 ) , it is immediate by the inductive hypothesis applied to ϕ 1 \phi_1 ϕ 1 and ϕ 2 \phi_2 ϕ 2 .
In the case ϕ = ¬ ϕ 1 \phi= \neg\phi_1 ϕ = ¬ ϕ 1 by definition we have
M t o T l i n ( ϕ ) = not ( M t o T l i n ( ϕ 1 ) ) \mathrm{MtoT}^{lin}(\phi) = \operatorname{not}(\mathrm{MtoT}^{lin}(\phi_1)) MtoT l in ( ϕ ) = not ( MtoT l in ( ϕ 1 ))
and M t o T l i n ( ϕ 1 ) \mathrm{MtoT}^{lin}(\phi_1) MtoT l in ( ϕ 1 ) is closed and guarded by the inductive hypothesis. Since not ( ) \operatorname{not}() not ( ) maps formulae to formulae, it follows that M t o T l i n ( ϕ ) \mathrm{MtoT}^{lin}(\phi) MtoT l in ( ϕ ) is also closed and guarded.
M t o T l i n ( ϕ ) = x s in ⟨ A c t ⟩ min ( Y , x e in ( ⟨ x e − x s ∈ I ⟩ M t o T l i n ( ϕ 2 ) ) ∨ ( M t o T l i n ( ϕ 1 ) ∧ D s j A c t ( Y ) ) ) \mathrm{MtoT}^{lin}(\phi)=x_s\ \operatorname{in}\langle\mathrm{Act}\rangle\min\left(Y,x_e\ \operatorname{in}\left(\langle x_e-x_s\in I\rangle\mathrm{MtoT}^{lin}(\phi_2)\right)\lor\left(\mathrm{MtoT}^{lin}(\phi_1)\land\mathrm{D}_{\mathrm{sjAct}}(Y)\right)\right) MtoT l in ( ϕ ) = x s in ⟨ Act ⟩ min ( Y , x e in ( ⟨ x e − x s ∈ I ⟩ MtoT l in ( ϕ 2 ) ) ∨ ( MtoT l in ( ϕ 1 ) ∧ D sjAct ( Y ) ) )
and M t o T l i n ( ϕ 1 ) \mathrm{MtoT}^{lin}(\phi_1) MtoT l in ( ϕ 1 ) and M t o T l i n ( ϕ 2 ) \mathrm{MtoT}^{lin}(\phi_2) MtoT l in ( ϕ 2 ) are closed and guarded by the induction hypothesis. The variables x e x_e x e , x s x_s x s and Y Y Y are bounded and each occurrence of Y Y Y appear under the scope of the modality ⟨ α ⟩ − \langle\alpha\rangle^{-} ⟨ α ⟩ − for some α ∈ A c t \alpha\in\mathrm{Act} α ∈ Act within its binder. Therefore, M t o T l i n ( ϕ ) \mathrm{MtoT}^{lin}(\phi) MtoT l in ( ϕ ) is closed and guarded.
Lemma B.6. For all ϕ ∈ M T L \phi\in MTL ϕ ∈ M T L and π ∈ T A c t ω \pi\in TAct^\omega π ∈ T A c t ω :
(Soundness) π ∈ ⟦ M t o T l i n ( ϕ ) ⟧ \pi\in\llbracket\mathrm{MtoT}^{lin}(\phi)\rrbracket π ∈ [ [ MtoT l in ( ϕ ) ] ] implies π ∈ ⟦ ϕ ⟧ M T L \pi\in\llbracket\phi\rrbracket^{MTL} π ∈ [ [ ϕ ] ] M T L , and
(Completeness) π ∈ ⟦ ϕ ⟧ M T L \pi\in\llbracket\phi\rrbracket^{MTL} π ∈ [ [ ϕ ] ] M T L implies π ∈ ⟦ M t o T l i n ( ϕ ) ⟧ \pi\in\llbracket\mathrm{MtoT}^{lin}(\phi)\rrbracket π ∈ [ [ MtoT l in ( ϕ ) ] ] .
Proof. Pick ϕ ∈ M T L \phi\in MTL ϕ ∈ M T L , we proceed by structural induction on ϕ \phi ϕ to prove 1 and 2 simultaneously. The base cases are:
ϕ = ⊤ \phi= \top ϕ = ⊤ : By Figure 2 , Figure 5 , and Figure 6 , we obtain ⟦ ϕ ⟧ M T L = ⟦ M t o T l i n ( ϕ ) ⟧ = T A c t ω \llbracket\phi\rrbracket^{MTL} = \llbracket\mathrm{MtoT}^{lin}(\phi)\rrbracket= TAct^\omega [ [ ϕ ] ] M T L = [ [ MtoT l in ( ϕ ) ] ] = T A c t ω , from which (1) and (2) follow.
ϕ = ⊥ \phi= \bot ϕ = ⊥ : Analogous.
ϕ = α \phi= \alpha ϕ = α : By Figure 6 , we have M t o T l i n ( ϕ ) = ⟨ α ⟩ t t \mathrm{MtoT}^{lin}(\phi) = \langle\alpha\rangle\mathrm{tt} MtoT l in ( ϕ ) = ⟨ α ⟩ tt . To prove (1), suppose that π ∈ ⟦ M t o T l i n ( ϕ ) ⟧ \pi\in\llbracket\mathrm{MtoT}^{lin}(\phi)\rrbracket π ∈ [ [ MtoT l in ( ϕ ) ] ] . By Figure 5 , we have a 1 ( π ) = α a_1(\pi) = \alpha a 1 ( π ) = α , from which we obtain π ∈ ⟦ α ⟧ M T L \pi\in\llbracket\alpha\rrbracket^{MTL} π ∈ [ [ α ] ] M T L by Figure 2 . To prove (2), suppose that π ∈ ⟦ α ⟧ M T L \pi\in\llbracket\alpha\rrbracket^{MTL} π ∈ [ [ α ] ] M T L . By Figure 2 , we have a 1 ( π ) = α a_1(\pi) = \alpha a 1 ( π ) = α , which implies π ∈ ⟦ M t o T l i n ( ϕ ) ⟧ \pi\in\llbracket\mathrm{MtoT}^{lin}(\phi)\rrbracket π ∈ [ [ MtoT l in ( ϕ ) ] ] by Figure 5 .
We now discuss one by one the inductive cases.
( ϕ = ϕ 1 ∧ ϕ 2 ) (\phi= \phi_1 \land\phi_2) ( ϕ = ϕ 1 ∧ ϕ 2 ) : By Figure 6 , M t o T l i n ( ϕ ) = M t o T l i n ( ϕ 1 ) ∨ M t o T l i n ( ϕ 2 ) \mathrm{MtoT}^{lin}(\phi) = \mathrm{MtoT}^{lin}(\phi_1) \lor\mathrm{MtoT}^{lin}(\phi_2) MtoT l in ( ϕ ) = MtoT l in ( ϕ 1 ) ∨ MtoT l in ( ϕ 2 ) .
π ∈ ⟦ M t o T l i n ( ϕ 1 ) ⟧ and π ∈ ⟦ M t o T l i n ( ϕ 2 ) ⟧ \pi\in\llbracket\mathrm{MtoT}^{lin}(\phi_1)\rrbracket\text{ and } \pi\in\llbracket\mathrm{MtoT}^{lin}(\phi_2)\rrbracket π ∈ [ [ MtoT l in ( ϕ 1 ) ] ] and π ∈ [ [ MtoT l in ( ϕ 2 ) ] ]
Since ϕ 1 \phi_1 ϕ 1 and ϕ 2 \phi_2 ϕ 2 are syntactically smaller than ϕ \phi ϕ , the inductive hypothesis (1) guarantees
π ∈ ⟦ ϕ 1 ⟧ M T L and π ∈ ⟦ ϕ 2 ⟧ M T L , \pi\in\llbracket\phi_1\rrbracket^{MTL} \text{ and } \pi\in\llbracket\phi_2\rrbracket^{MTL}, π ∈ [ [ ϕ 1 ] ] M T L and π ∈ [ [ ϕ 2 ] ] M T L ,
and so Figure 2 implies the required π ∈ ⟦ ϕ 1 ∨ ϕ 2 ⟧ M T L \pi\in\llbracket\phi_1 \lor\phi_2\rrbracket^{MTL} π ∈ [ [ ϕ 1 ∨ ϕ 2 ] ] M T L .
π ∈ ⟦ ϕ 1 ⟧ M T L and π ∈ ⟦ ϕ 2 ⟧ M T L \pi\in\llbracket\phi_1\rrbracket^{MTL} \text{ and } \pi\in\llbracket\phi_2\rrbracket^{MTL} π ∈ [ [ ϕ 1 ] ] M T L and π ∈ [ [ ϕ 2 ] ] M T L
The inductive hypothesis (2) applied to ϕ 1 \phi_1 ϕ 1 and ϕ 2 \phi_2 ϕ 2 ensures than
π ∈ ⟦ M t o T l i n ( ϕ 1 ) ⟧ and π ∈ ⟦ M t o T l i n ( ϕ 2 ) ⟧ \pi\in\llbracket\mathrm{MtoT}^{lin}(\phi_1)\rrbracket\text{ and } \pi\in\llbracket\mathrm{MtoT}^{lin}(\phi_2)\rrbracket π ∈ [ [ MtoT l in ( ϕ 1 ) ] ] and π ∈ [ [ MtoT l in ( ϕ 2 ) ] ]
We conclude π ∈ ⟦ M t o T l i n ( ϕ ) ⟧ \pi\in\llbracket\mathrm{MtoT}^{lin}(\phi)\rrbracket π ∈ [ [ MtoT l in ( ϕ ) ] ] by Figure 5 .
( ϕ = ¬ ϕ 1 ) (\phi= \neg\phi_{1}) ( ϕ = ¬ ϕ 1 ) : By Figure 6 , M t o T l i n ( ϕ ) = not ( M t o T l i n ( ϕ 1 ) ) \mathrm{MtoT}^{lin}(\phi) = \operatorname{not}(\mathrm{MtoT}^{lin}(\phi_{1})) MtoT l in ( ϕ ) = not ( MtoT l in ( ϕ 1 )) .
Proof of (1): Suppose π ∈ [ [ M t o T l i n ( ϕ ) ] ] \pi\in[\![\mathrm{MtoT}^{lin}(\phi)]\!] π ∈ [ [ MtoT l in ( ϕ )] ] , then Proposition 3.6 implies π ∉ [ [ M t o T l i n ( ϕ 1 ) ] ] \pi\notin[\![\mathrm{MtoT}^{lin}(\phi_{1})]\!] π ∈ / [ [ MtoT l in ( ϕ 1 )] ] . The contrapositive of the inductive hypothesis (2) ensures π ∉ [ [ ϕ 1 ] ] M T L \pi\notin[\![\phi_{1}]\!]^{\mathrm{MTL}} π ∈ / [ [ ϕ 1 ] ] MTL which implies π ∈ [ [ ϕ ] ] M T L \pi\in[\![\phi]\!]^{\mathrm{MTL}} π ∈ [ [ ϕ ] ] MTL by Figure 2 .
Proof of (2): Suppose π ∈ [ [ ϕ ] ] M T L \pi\in[\![\phi]\!]^{\mathrm{MTL}} π ∈ [ [ ϕ ] ] MTL which by Figure 2 means π ∉ [ [ ϕ 1 ] ] M T L \pi\notin[\![\phi_{1}]\!]^{\mathrm{MTL}} π ∈ / [ [ ϕ 1 ] ] MTL . The contrapositive of the inductive hypothesis (1) ensures π ∉ [ [ M t o T l i n ( ϕ 1 ) ] ] \pi\notin[\![\mathrm{MtoT}^{lin}(\phi_{1})]\!] π ∈ / [ [ MtoT l in ( ϕ 1 )] ] , so we conclude π ∈ [ [ M t o T l i n ( ϕ ) ] ] \pi\in[\![\mathrm{MtoT}^{lin}(\phi)]\!] π ∈ [ [ MtoT l in ( ϕ )] ] by Proposition 3.6.
( ϕ = ϕ 1 U I ϕ 2 ) (\phi= \phi_{1}\ \mathbin{\mathsf{U}}_{I}\ \phi_{2}) ( ϕ = ϕ 1 U I ϕ 2 ) : By definition
M t o T l i n ( ϕ ) = x s i n ⟨ A c t ⟩ min ( Y , x e i n ( ⟨ x e − x s ∈ I ⟩ M t o T l i n ( ϕ 2 ) ∨ ( M t o T l i n ( ϕ 1 ) ∧ D s j A c t ( Y ) ) ) ) \mathrm{MtoT}^{lin}(\phi) = x_s\ \mathsf{in}\langle\mathrm{Act}\rangle\min\left(Y,x_e\ \mathsf{in}\left(\langle x_e-x_s \in I\rangle\mathrm{MtoT}^{lin}(\phi_{2}) \mathbin{\lor} \left(\mathrm{MtoT}^{lin}(\phi_{1}) \mathbin{\land} \mathrm{DsjAct}(Y)\right)\right)\right) MtoT l in ( ϕ ) = x s in ⟨ Act ⟩ min ( Y , x e in ( ⟨ x e − x s ∈ I ⟩ MtoT l in ( ϕ 2 ) ∨ ( MtoT l in ( ϕ 1 ) ∧ DsjAct ( Y ) ) ) )
π 2 ∈ [ [ min ( Y , x e i n ( ⟨ x e − x s ∈ I ⟩ M t o T l i n ( ϕ 2 ) ∨ ( M t o T l i n ( ϕ 1 ) ∧ D s j A c t ( Y ) ) ) ) ] ] 0 [ x s : = t 1 ( π ) ] \pi^{2} \in\left[\!\left[\min\left(Y,x_e\ \mathsf{in}\left(\langle x_e-x_s \in I\rangle\mathrm{MtoT}^{lin}(\phi_{2}) \mathbin{\lor} \left(\mathrm{MtoT}^{lin}(\phi_{1}) \mathbin{\land} \mathrm{DsjAct}(Y)\right)\right)\right)\right]\!\right]_{0[x_s:=t_1(\pi)]} π 2 ∈ [ [ min ( Y , x e in ( ⟨ x e − x s ∈ I ⟩ MtoT l in ( ϕ 2 ) ∨ ( MtoT l in ( ϕ 1 ) ∧ DsjAct ( Y ) ) ) ) ] ] 0 [ x s := t 1 ( π )]
The continuity of the semantics (Section 3), and in particular its consequence (Eq. (4)), guarantees that there exists n ∈ N n \in\mathbb{N} n ∈ N such that
π 2 ∈ [ [ x e i n ψ 1 ∨ ψ 2 ] ] [ x s : = t 1 ( π ) ] , Y , ∅ n ( ∅ ) (18) \pi^{2} \in[\![x_e\ \mathsf{in}\ \psi_{1} \mathbin{\lor} \psi_{2}]\!]^{n}_{[x_s:=t_1(\pi)],Y,\varnothing}(\varnothing) \tag*{(18)} π 2 ∈ [ [ x e in ψ 1 ∨ ψ 2 ] ] [ x s := t 1 ( π )] , Y , ∅ n ( ∅ ) (18)
To prove π ∈ [ [ ϕ ] ] M T L \pi\in[\![\phi]\!]^{\mathrm{MTL}} π ∈ [ [ ϕ ] ] MTL , Figure 2 requires us to explain why there exists i > 1 i > 1 i > 1 such that the following properties are true:
(a) t i ( π ) − t 1 ( π ) ∈ I t_i(\pi)-t_1(\pi) \in I t i ( π ) − t 1 ( π ) ∈ I ,
(b) π i ∈ [ [ ϕ 2 ] ] M T L \pi^{i} \in[\![\phi_{2}]\!]^{\mathrm{MTL}} π i ∈ [ [ ϕ 2 ] ] MTL , and
(c) ∀ 1 < j < i : π j ∈ [ [ ϕ 1 ] ] M T L \forall1 < j < i : \pi^{j} \in[\![\phi_{1}]\!]^{\mathrm{MTL}} ∀1 < j < i : π j ∈ [ [ ϕ 1 ] ] MTL .
Thanks to (18) , Lemma B.3 instantiated with ϕ = ψ 1 \phi= \psi_{1} ϕ = ψ 1 , ψ = M t o T l i n ( ϕ 1 ) \psi= \mathrm{MtoT}^{lin}(\phi_{1}) ψ = MtoT l in ( ϕ 1 ) , v = 0 [ x s : = t 1 ( π ) ] v = \mathbf{0}[x_s := t_1(\pi)] v = 0 [ x s := t 1 ( π )] , x = x e x = x_e x = x e , Y Y Y , π 2 \pi^{2} π 2 and n n n , gives us k ≥ 1 k \geq1 k ≥ 1 such that
π k + 1 ∈ [ [ ψ 1 ] ] 0 [ x s : = t 1 ( π ) ] [ x e : = t k + 1 ( π ) ] (19) \pi^{k+1} \in[\![\psi_{1}]\!]_{\mathbf{0}[x_s:=t_1(\pi)][x_e:=t_{k+1}(\pi)]} \tag*{(19)} π k + 1 ∈ [ [ ψ 1 ] ] 0 [ x s := t 1 ( π )] [ x e := t k + 1 ( π )] (19)
and
∀ j . 1 ≤ j < k : π j + 1 ∈ [ [ M t o T l i n ( ϕ 1 ) ] ] 0 [ x s ↦ t 1 ( π ) ] [ x e : = t j + 1 ( π ) ] \forall j.\ 1 \leq j < k : \pi^{j+1} \in[\![\mathrm{MtoT}^{lin}(\phi_{1})]\!]_{\mathbf{0}[x_s\mapsto t_1(\pi)][x_e:=t_{j+1}(\pi)]} ∀ j . 1 ≤ j < k : π j + 1 ∈ [ [ MtoT l in ( ϕ 1 )] ] 0 [ x s ↦ t 1 ( π )] [ x e := t j + 1 ( π )]
which is equivalent to
∀ j . 1 < j < k + 1 : π j ∈ [ [ M t o T l i n ( ϕ 1 ) ] ] 0 [ x s ↦ t 1 ( π ) ] [ x e : = t j ( π ) ] (20) \forall j.\ 1 < j < k+1 : \pi^{j} \in[\![\mathrm{MtoT}^{lin}(\phi_{1})]\!]_{\mathbf{0}[x_s\mapsto t_1(\pi)][x_e:=t_j(\pi)]} \tag*{(20)} ∀ j . 1 < j < k + 1 : π j ∈ [ [ MtoT l in ( ϕ 1 )] ] 0 [ x s ↦ t 1 ( π )] [ x e := t j ( π )] (20)
Let us denote v = 0 [ x s ↦ t 1 ( π ) ] [ x e : = t j ( π ) ] v = \mathbf{0}[x_s \mapsto t_1(\pi)][x_e := t_j(\pi)] v = 0 [ x s ↦ t 1 ( π )] [ x e := t j ( π )] . By unfolding further the definitions, (19) states that
v ⊨ x e − x s ∈ I and π k + 1 ∈ [ [ M t o T l i n ( ϕ 2 ) ] ] v (21) v \models x_e-x_s \in I \text{ and } \pi^{k+1} \in[\![\mathrm{MtoT}^{lin}(\phi_{2})]\!]_v \tag*{(21)} v ⊨ x e − x s ∈ I and π k + 1 ∈ [ [ MtoT l in ( ϕ 2 )] ] v (21)
(a) follows from v ⊨ x e − x s ∈ I v \models x_e-x_s \in I v ⊨ x e − x s ∈ I . Now recall that Lemma B.5 ensures that both M t o T l i n ( ϕ 1 ) \mathrm{MtoT}^{lin}(\phi_{1}) MtoT l in ( ϕ 1 ) and M t o T l i n ( ϕ 2 ) \mathrm{MtoT}^{lin}(\phi_{2}) MtoT l in ( ϕ 2 ) are formulae, therefore, by letting i = k + 1 i = k+1 i = k + 1 , the remaining (b) and (c) follow from (21) and (20) and the inductive hypothesis.
(a) t i ( π ) − t 1 ( π ) ∈ I t_i(\pi)-t_1(\pi) \in I t i ( π ) − t 1 ( π ) ∈ I ,
(b) π i ∈ [ [ ϕ 2 ] ] M T L \pi^{i} \in[\![\phi_{2}]\!]^{\mathrm{MTL}} π i ∈ [ [ ϕ 2 ] ] MTL ,
(c) ∀ 1 < j < i : π j ∈ [ [ ϕ 1 ] ] M T L \forall1 < j < i : \pi^{j} \in[\![\phi_{1}]\!]^{\mathrm{MTL}} ∀1 < j < i : π j ∈ [ [ ϕ 1 ] ] MTL . To conclude π ∈ ⟦ M t o T l i n ( φ ) ⟧ \pi\in\llbracket\mathrm{MtoT}^{lin}(\varphi)\rrbracket π ∈ [ [ MtoT l in ( φ ) ] ] , by Eq. (4) and Figure 5 , it suffices to find n ∈ N n \in\mathbb{N} n ∈ N such that
π 2 ∈ { x e i n ψ 1 ∨ ψ 2 } 0 [ x s : = t 1 ( π ) ] , Y , ∅ n ( ∅ ) (22) \pi^2 \in\{x_e \mathbin{\mathrm{in}} \psi_1 \lor\psi_2\}_{0[x_s:=t_1(\pi)],Y,\varnothing}^{n}(\varnothing) \tag*{(22)} π 2 ∈ { x e in ψ 1 ∨ ψ 2 } 0 [ x s := t 1 ( π )] , Y , ∅ n ( ∅ ) (22)
The natural n n n we are after is precisely i − 1 i-1 i − 1 . To prove Eq. (22) with n = i − 1 n=i-1 n = i − 1 , we follow the following strategy: thanks to Eq. (5) and the fact that i − 1 ≥ 1 i-1 \ge1 i − 1 ≥ 1 , we know
{ x e i n ψ 1 ∨ ψ 2 } 0 [ x s : = t 1 ( π ) ] , Y , ∅ i − 1 ( ∅ ) = { x e i n ψ 1 ∨ ψ 2 } 0 [ x s : = t 1 ( π ) ] , Y , ∅ i − 2 ( S ) \{x_e \mathbin{\mathrm{in}} \psi_1 \lor\psi_2\}_{0[x_s:=t_1(\pi)],Y,\varnothing}^{i-1}(\varnothing)
=
\{x_e \mathbin{\mathrm{in}} \psi_1 \lor\psi_2\}_{0[x_s:=t_1(\pi)],Y,\varnothing}^{i-2}(S) { x e in ψ 1 ∨ ψ 2 } 0 [ x s := t 1 ( π )] , Y , ∅ i − 1 ( ∅ ) = { x e in ψ 1 ∨ ψ 2 } 0 [ x s := t 1 ( π )] , Y , ∅ i − 2 ( S )
where
S = { x e i n ψ 1 ∨ ψ 2 } 0 [ x s : = t 1 ( π ) ] , Y , ∅ ( ∅ ) , S=\{x_e \mathbin{\mathrm{in}} \psi_1 \lor\psi_2\}_{0[x_s:=t_1(\pi)],Y,\varnothing}(\varnothing), S = { x e in ψ 1 ∨ ψ 2 } 0 [ x s := t 1 ( π )] , Y , ∅ ( ∅ ) ,
Then, it is enough to prove that
π 2 ∈ { x e i n ψ 2 } 0 [ x s : = t 1 ( π ) ] , Y , ∅ i − 2 ( S ) (23) \pi^2 \in\{x_e \mathbin{\mathrm{in}} \psi_2\}_{0[x_s:=t_1(\pi)],Y,\varnothing}^{i-2}(S) \tag*{(23)} π 2 ∈ { x e in ψ 2 } 0 [ x s := t 1 ( π )] , Y , ∅ i − 2 ( S ) (23)
Thanks the monotonicity of { x e i n ψ 2 } 0 [ x s : = t 1 ( π ) ] , Y , ∅ i − 2 \{x_e \mathbin{\mathrm{in}} \psi_2\}_{0[x_s:=t_1(\pi)],Y,\varnothing}^{i-2} { x e in ψ 2 } 0 [ x s := t 1 ( π )] , Y , ∅ i − 2 , to prove Eq. (23) , it suffices to show the following,
(i) { π i } ⊆ S \{\pi^i\} \subseteq S { π i } ⊆ S , and
(ii) π 2 ∈ { x e i n ψ 2 } 0 [ x s : = t 1 ( π ) ] , Y , ∅ i − 2 ( π i ) \pi^2 \in\{x_e \mathbin{\mathrm{in}} \psi_2\}_{0[x_s:=t_1(\pi)],Y,\varnothing}^{i-2}(\pi^i) π 2 ∈ { x e in ψ 2 } 0 [ x s := t 1 ( π )] , Y , ∅ i − 2 ( π i ) .
By definition of S S S and Figure 5 , to prove (i), it suffices to show that
π i ∈ ⟦ ψ 1 , [ Y ↦ ∅ ] ⟧ 0 [ x s : = t 1 ( π ) ] [ x e : = t i ( π ) ] \pi^i \in\llbracket\psi_1,[Y\mapsto\varnothing]\rrbracket_{0[x_s:=t_1(\pi)][x_e:=t_i(\pi)]} π i ∈ [ [ ψ 1 , [ Y ↦ ∅ ] ] ] 0 [ x s := t 1 ( π )] [ x e := t i ( π )]
which in turn is equivalent to 0 [ x s : = t 1 ( π ) ] [ x e : = t i ( π ) ] ⊨ x e − x s ∈ I \mathbf{0}[x_s:=t_1(\pi)][x_e:=t_i(\pi)] \models x_e-x_s\in I 0 [ x s := t 1 ( π )] [ x e := t i ( π )] ⊨ x e − x s ∈ I and π i ∈ ⟦ M t o T l i n ( φ 2 ) , [ Y ↦ ∅ ] ⟧ 0 [ x s : = t 1 ( π ) ] [ x e : = t i ( π ) ] \pi^i \in\llbracket\mathrm{MtoT}^{lin}(\varphi_2),[Y\mapsto\varnothing]\rrbracket_{0[x_s:=t_1(\pi)][x_e:=t_i(\pi)]} π i ∈ [ [ MtoT l in ( φ 2 ) , [ Y ↦ ∅ ] ] ] 0 [ x s := t 1 ( π )] [ x e := t i ( π )] . The former follows from (a). The former holds by Eq. (7) provided that π i ∈ ⟦ M t o T l i n ( φ 2 ) ⟧ \pi^i\in\llbracket\mathrm{MtoT}^{lin}(\varphi_2)\rrbracket π i ∈ [ [ MtoT l in ( φ 2 ) ] ] which holds by the inductive hypothesis (2) applied to φ 2 \varphi_2 φ 2 .
To conclude the proof, it remains only to show (ii) which we do now. Thanks to (c) and the inductive hypothesis (2), we know that
∀ 1 < j < i : π j ∈ ⟦ M t o T l i n ( φ 1 ) ⟧ = ⟨ M t o T l i n ( φ 1 ) ⟩ 0 , Y , ∅ ( ∅ ) , \forall1<j<i:\ \pi^j\in\llbracket\mathrm{MtoT}^{lin}(\varphi_1)\rrbracket
=
\langle\mathrm{MtoT}^{lin}(\varphi_1)\rangle_{0,Y,\varnothing}(\varnothing), ∀1 < j < i : π j ∈ [ [ MtoT l in ( φ 1 ) ] ] = ⟨ MtoT l in ( φ 1 ) ⟩ 0 , Y , ∅ ( ∅ ) ,
which means that
∀ 1 < j < i : π j ∈ ⟨ M t o T l i n ( φ 1 ) ⟩ 0 , Y , ∅ ( π j + 1 ) \forall1<j<i:\ \pi^j\in\langle\mathrm{MtoT}^{lin}(\varphi_1)\rangle_{0,Y,\varnothing}(\pi^{j+1}) ∀1 < j < i : π j ∈ ⟨ MtoT l in ( φ 1 ) ⟩ 0 , Y , ∅ ( π j + 1 )
which is equivalent to
∀ 1 ≤ j ≤ i − 2 : ( π 2 ) j ∈ ⟨ M t o T l i n ( φ 1 ) ⟩ 0 , Y , ∅ ( ( π 2 ) j + 1 ) \forall1\le j\le i-2:\ (\pi^2)^j\in\langle\mathrm{MtoT}^{lin}(\varphi_1)\rangle_{0,Y,\varnothing}((\pi^2)^{j+1}) ∀1 ≤ j ≤ i − 2 : ( π 2 ) j ∈ ⟨ MtoT l in ( φ 1 ) ⟩ 0 , Y , ∅ (( π 2 ) j + 1 )
Using Lemma B.4, we deduce
π 2 ∈ ⟨ ψ 2 ⟩ 0 , Y , ∅ ( π i ) \pi^2\in\langle\psi_2\rangle_{0,Y,\varnothing}(\pi^i) π 2 ∈ ⟨ ψ 2 ⟩ 0 , Y , ∅ ( π i )
Since ψ 2 \psi_2 ψ 2 contains no free timestamp variables, we also have
π 2 ∈ ⟨ ψ 2 ⟩ [ x s : = t 1 ( π ) ] , Y , ∅ ( π i ) , \pi^2\in\langle\psi_2\rangle_{[x_s:=t_1(\pi)],Y,\varnothing}(\pi^i), π 2 ∈ ⟨ ψ 2 ⟩ [ x s := t 1 ( π )] , Y , ∅ ( π i ) ,
which is exactly (ii).
Correctness of Pto
Proposition 3.10. For every formula ϕ ∈ T P T L \phi\in\mathrm{TPTL} ϕ ∈ TPTL we have ⟦ ϕ ⟧ = ⟦ P t o T l i n ( ϕ ) ⟧ \llbracket\phi\rrbracket= \llbracket\mathrm{PtoT}^{lin}(\phi)\rrbracket [ [ ϕ ] ] = [ [ PtoT l in ( ϕ ) ] ] .
Proof. We prove by structural induction that for any TPTL term ϕ \phi ϕ and valuation v v v we have ⟦ ϕ ⟧ v = ⟦ P t o T l i n ( ϕ ) ⟧ v \llbracket\phi\rrbracket_v = \llbracket\mathrm{PtoT}^{lin}(\phi)\rrbracket_v [ [ ϕ ] ] v = [ [ PtoT l in ( ϕ ) ] ] v . We omit the cases other than x . ψ x.\psi x . ψ and x ∼ n x \sim n x ∼ n , as they follow the same reasoning as the corresponding cases in the proof of Proposition 3.8 above.
⟦ P t o T l i n ( ϕ ) ⟧ v = ⟦ y i n ⟨ y − x ∼ n ⟩ t t ⟧ v = { π ∣ t 1 ( π ) − v ( x ) ∼ n } = ⟦ ϕ ⟧ \begin{aligned}
\llbracket\mathrm{PtoT}^{lin}(\phi)\rrbracket_v
&= \llbracket y\ \mathbin{\mathrm{in}}\langle y-x\sim n\rangle\mathrm{tt}\rrbracket_v \\
&= \{\pi\mid t_1(\pi)-v(x)\sim n\} \\
&= \llbracket\phi\rrbracket
\end{aligned} [ [ PtoT l in ( ϕ ) ] ] v = [ [ y in ⟨ y − x ∼ n ⟩ tt ] ] v = { π ∣ t 1 ( π ) − v ( x ) ∼ n } = [ [ ϕ ] ] ⟦ x . ψ ⟧ v = { π ∣ π ∈ ⟦ ψ ⟧ v [ x : = t 1 ( π ) ] } = I . H . { π ∣ π ∈ ⟦ P t o T l i n ( ψ ) ⟧ v [ x : = t 1 ( π ) ] } = ⟦ x i n P t o T l i n ( ψ ) ⟧ = ⟦ P t o T l i n ( ϕ ) ⟧ \begin{aligned}
\llbracket x.\psi\rrbracket_v
&= \{\pi\mid\pi\in\llbracket\psi\rrbracket_{v[x:=t_1(\pi)]}\} \\
&\overset{\mathrm{I.H.}}{=} \{\pi\mid\pi\in\llbracket\mathrm{PtoT}^{lin}(\psi)\rrbracket_{v[x:=t_1(\pi)]}\} \\
&= \llbracket x\ \mathbin{\mathrm{in}}\ \mathrm{PtoT}^{lin}(\psi)\rrbracket\\
&= \llbracket\mathrm{PtoT}^{lin}(\phi)\rrbracket
\end{aligned} [ [ x . ψ ] ] v = { π ∣ π ∈ [ [ ψ ] ] v [ x := t 1 ( π )] } = I.H. { π ∣ π ∈ [ [ PtoT l in ( ψ ) ] ] v [ x := t 1 ( π )] } = [ [ x in PtoT l in ( ψ ) ] ] = [ [ PtoT l in ( ϕ ) ] ]
Proofs about MTL and TPTL monitorability
Proposition 6.6. For all ϕ ∈ M T L \phi\in MTL ϕ ∈ M T L , we have ⟦ M t o T l i n ( ϕ ) ⟧ = ⟦ c o n s M t o T l i n ( ϕ ) ⟧ \llbracket\mathrm{MtoT}^{lin}(\phi)\rrbracket= \llbracket\mathrm{consMtoT}^{lin}(\phi)\rrbracket [ [ MtoT l in ( ϕ ) ] ] = [ [ consMtoT l in ( ϕ ) ] ] .
Proof. The proof proceeds by structural induction on ϕ \phi ϕ . The base cases are:
ϕ = ⊤ \phi= \top ϕ = ⊤ : M t o T l i n ( ⊤ ) = t t = c o n s M t o T l i n ( ⊤ ) \mathrm{MtoT}^{lin}(\top) = \mathrm{tt} = \mathrm{consMtoT}^{lin}(\top) MtoT l in ( ⊤ ) = tt = consMtoT l in ( ⊤ ) .
ϕ = ⊥ \phi= \bot ϕ = ⊥ : Analogous.
ϕ = a \phi= a ϕ = a : M t o T l i n ( a ) = ⟨ a ⟩ t t = c o n s M t o T l i n ( a ) \mathrm{MtoT}^{lin}(a) = \langle a\rangle\mathrm{tt} = \mathrm{consMtoT}^{lin}(a) MtoT l in ( a ) = ⟨ a ⟩ tt = consMtoT l in ( a ) .
The inductive cases are:
ϕ = ¬ ϕ ′ \phi= \neg\phi' ϕ = ¬ ϕ ′ : This case follows immediately from the inductive hypothesis.
ϕ = ϕ 1 ∧ ϕ 2 \phi= \phi_1 \land\phi_2 ϕ = ϕ 1 ∧ ϕ 2 : This case follows immediately from the inductive hypothesis.
ϕ = ϕ 1 U I ϕ 2 \phi= \phi_1\mathbin{\mathsf{U}}_I\phi_2 ϕ = ϕ 1 U I ϕ 2 : The inclusion from right to left follows by unfolding the definition of the semantics and applying the inductive hypothesis. The other inclusion relies on the inductive hypothesis, Lemma B.3, and the continuity of the semantics. Let π ∈ ⟦ M t o T l i n ( ϕ 1 U I ϕ 2 ) ⟧ \pi\in\llbracket\mathrm{MtoT}^{lin}(\phi_1\mathbin{\mathsf{U}}_I\phi_2)\rrbracket π ∈ [ [ MtoT l in ( ϕ 1 U I ϕ 2 ) ] ] . Then, by Figure 6 and Figure 5 ,
\pi^2 \in\left\llbracket\min\left(Y,x_e\mathbin{\mathrm{in}}\left(\langle x_e-x_s\in I\rangle\mathrm{MtoT}^{lin}(\phi_2)\right)\lor\left(\mathrm{MtoT}^{lin}(\phi_1)\land\langle\mathrm{Act}\rangle Y\right)\right)\right\rrbracket_{[x_s:=t_1(\pi)]}
By Eq. (4) , there exists n ∈ N n \in\mathbb{N} n ∈ N such that
π 2 ∈ { ( x e i n ( ⟨ x e − x s ∈ I ⟩ M t o T l i n ( ϕ 2 ) ) ∨ ( M t o T l i n ( ϕ 1 ) ∧ ⟨ A c t ⟩ Y ) ) n } [ x s : = t 1 ( π ) ] , Y , ∅ ( ∅ ) (24) \pi^2 \in\left\{\left(x_e\mathbin{\mathrm{in}}\left(\langle x_e-x_s\in I\rangle\mathrm{MtoT}^{lin}(\phi_2)\right)\lor\left(\mathrm{MtoT}^{lin}(\phi_1)\land\langle\mathrm{Act}\rangle Y\right)\right)^{n}\right\}_{[x_s:=t_1(\pi)],Y,\varnothing}(\varnothing) \tag*{(24)} π 2 ∈ { ( x e in ( ⟨ x e − x s ∈ I ⟩ MtoT l in ( ϕ 2 ) ) ∨ ( MtoT l in ( ϕ 1 ) ∧ ⟨ Act ⟩ Y ) ) n } [ x s := t 1 ( π )] , Y , ∅ ( ∅ ) (24)
We prove by induction on n n n that
π 2 ∈ { ( x e i n ( ⟨ x e − x s ∈ I ⟩ c o n s M t o T l i n ( ϕ 2 ) ) ∨ ψ ) n } [ x s : = t 1 ( π ) ] , Y , ∅ ( ∅ ) (25) \pi^2 \in\left\{\left(x_e\mathbin{\mathrm{in}}\left(\langle x_e-x_s\in I\rangle\mathrm{consMtoT}^{lin}(\phi_2)\right)\lor\psi\right)^{n}\right\}_{[x_s:=t_1(\pi)],Y,\varnothing}(\varnothing) \tag*{(25)} π 2 ∈ { ( x e in ( ⟨ x e − x s ∈ I ⟩ consMtoT l in ( ϕ 2 ) ) ∨ ψ ) n } [ x s := t 1 ( π )] , Y , ∅ ( ∅ ) (25)
where
ψ : = c o n s M t o T l i n ( ϕ 1 ) ∧ ⟨ A c t ⟩ y i n ⟨ y − x s ≺ I R B ( I ) ⟩ Y \psi:= \mathrm{consMtoT}^{lin}(\phi_1)\land\langle\mathrm{Act}\rangle y\mathbin{\mathrm{in}}\langle y-x_s\prec_I RB(I)\rangle Y ψ := consMtoT l in ( ϕ 1 ) ∧ ⟨ Act ⟩ y in ⟨ y − x s ≺ I R B ( I )⟩ Y
which, together with Figure 5 , implies the required π ∈ ⟦ c o n s M t o T l i n ( ϕ 1 U I ϕ 2 ) ⟧ \pi\in\llbracket\mathrm{consMtoT}^{lin}(\phi_1\mathbin{\mathsf{U}}_I\phi_2)\rrbracket π ∈ [ [ consMtoT l in ( ϕ 1 U I ϕ 2 ) ] ] . When n = 0 n=0 n = 0 , Eq. (24) leads to a contradiction, since its right-hand side is equal to the empty set. Suppose now that n = n ′ + 1 n=n'+1 n = n ′ + 1 . Then, Eq. (25) follows if we prove either
t 2 ( π ) − t 1 ( π ) ∈ I and π 2 ∈ ⟦ c o n s M t o T l i n ( ϕ 2 ) , [ Y : = S 1 ] ⟧ [ x s , x e : = t 1 ( π ) ] (26) t_2(\pi)-t_1(\pi)\in I\ \text{and}\ \pi^2\in\llbracket\mathrm{consMtoT}^{lin}(\phi_2),[Y:=S_1]\rrbracket_{[x_s,x_e:=t_1(\pi)]} \tag*{(26)} t 2 ( π ) − t 1 ( π ) ∈ I and π 2 ∈ [ [ consMtoT l in ( ϕ 2 ) , [ Y := S 1 ] ] ] [ x s , x e := t 1 ( π )] (26)
or
π 2 ∈ ⟦ c o n s M t o T l i n ( ϕ 1 ) , [ Y : = S 1 ] ⟧ [ x s : = t 1 ( π ) ] [ x e : = t 2 ( π ) ] , t 3 ( π ) − t 1 ( π ) ≺ I R B ( I ) and π 3 ∈ S 1 (27) \pi^2\in\llbracket\mathrm{consMtoT}^{lin}(\phi_1),[Y:=S_1]\rrbracket_{[x_s:=t_1(\pi)][x_e:=t_2(\pi)]},\ t_3(\pi)-t_1(\pi)\prec_I RB(I)\ \text{and}\ \pi^3\in S_1 \tag*{(27)} π 2 ∈ [ [ consMtoT l in ( ϕ 1 ) , [ Y := S 1 ] ] ] [ x s := t 1 ( π )] [ x e := t 2 ( π )] , t 3 ( π ) − t 1 ( π ) ≺ I R B ( I ) and π 3 ∈ S 1 (27)
where
S 1 : = { ( x e i n ( ⟨ x e − x s ∈ I ⟩ c o n s M t o T l i n ( ϕ 2 ) ) ∨ ψ ) n ′ } [ x s : = t 1 ( π ) ] , Y , ∅ ( ∅ ) S_1:=\left\{\left(x_e\mathbin{\mathrm{in}}\left(\langle x_e-x_s\in I\rangle\mathrm{consMtoT}^{lin}(\phi_2)\right)\lor\psi\right)^{n'}\right\}_{[x_s:=t_1(\pi)],Y,\varnothing}(\varnothing) S 1 := { ( x e in ( ⟨ x e − x s ∈ I ⟩ consMtoT l in ( ϕ 2 ) ) ∨ ψ ) n ′ } [ x s := t 1 ( π )] , Y , ∅ ( ∅ )
By the hypothesis in Eq. (24) , we have
π 2 ∈ { ( x e i n ( ⟨ x e − x s ∈ I ⟩ M t o T l i n ( ϕ 2 ) ) ∨ ( M t o T l i n ( ϕ 1 ) ∧ ⟨ A c t ⟩ Y ) ) n ′ } [ x s : = t 1 ( π ) ] , Y , ∅ ( S 2 ) \pi^2\in\left\{\left(x_e\mathbin{\mathrm{in}}\left(\langle x_e-x_s\in I\rangle\mathrm{MtoT}^{lin}(\phi_2)\right)\lor\left(\mathrm{MtoT}^{lin}(\phi_1)\land\langle\mathrm{Act}\rangle Y\right)\right)^{n'}\right\}_{[x_s:=t_1(\pi)],Y,\varnothing}(S_2) π 2 ∈ { ( x e in ( ⟨ x e − x s ∈ I ⟩ MtoT l in ( ϕ 2 ) ) ∨ ( MtoT l in ( ϕ 1 ) ∧ ⟨ Act ⟩ Y ) ) n ′ } [ x s := t 1 ( π )] , Y , ∅ ( S 2 )
where
S 2 : = { ( x e i n ( ⟨ x e − x s ∈ I ⟩ M t o T l i n ( ϕ 2 ) ) ∨ ( M t o T l i n ( ϕ 1 ) ∧ ⟨ A c t ⟩ Y ) ) n ′ } [ x s : = t 1 ( π ) ] , Y , ∅ ( ∅ ) S_2:=\left\{\left(x_e\mathbin{\mathrm{in}}\left(\langle x_e-x_s\in I\rangle\mathrm{MtoT}^{lin}(\phi_2)\right)\lor\left(\mathrm{MtoT}^{lin}(\phi_1)\land\langle\mathrm{Act}\rangle Y\right)\right)^{n'}\right\}_{[x_s:=t_1(\pi)],Y,\varnothing}(\varnothing) S 2 := { ( x e in ( ⟨ x e − x s ∈ I ⟩ MtoT l in ( ϕ 2 ) ) ∨ ( MtoT l in ( ϕ 1 ) ∧ ⟨ Act ⟩ Y ) ) n ′ } [ x s := t 1 ( π )] , Y , ∅ ( ∅ )
By unfolding the definitions of the semantic functions and using Figure 5 , we have two cases to consider. In the first case, t 2 ( π ) − t 1 ( π ) ∈ I t_2(\pi)-t_1(\pi)\in I t 2 ( π ) − t 1 ( π ) ∈ I and π 2 ∈ ⟦ c o n s M t o T l i n ( ϕ 2 ) , [ Y : = S 2 ] ⟧ [ x s : = t 1 ( π ) ] [ x e : = t 2 ( π ) ] \pi^2\in\llbracket\mathrm{consMtoT}^{lin}(\phi_2),[Y:=S_2]\rrbracket_{[x_s:=t_1(\pi)][x_e:=t_2(\pi)]} π 2 ∈ [ [ consMtoT l in ( ϕ 2 ) , [ Y := S 2 ] ] ] [ x s := t 1 ( π )] [ x e := t 2 ( π )] . Since Y Y Y , x e x_e x e , and x s x_s x s are not free in M t o T l i n ( ϕ 2 ) \mathrm{MtoT}^{lin}(\phi_2) MtoT l in ( ϕ 2 ) , we also have π 2 ∈ ⟦ M t o T l i n ( ϕ 2 ) ⟧ \pi^{2} \in\llbracket\mathrm{MtoT}^{lin}(\phi_{2}) \rrbracket π 2 ∈ [ [ MtoT l in ( ϕ 2 ) ] ] . By the inductive hypothesis, π 2 ∈ ⟦ C o n s M t o T l i n ( ϕ 2 ) ⟧ \pi^{2} \in\llbracket\mathrm{ConsMtoT}^{lin}(\phi_{2}) \rrbracket π 2 ∈ [ [ ConsMtoT l in ( ϕ 2 ) ] ] , and we conclude Eq. (26) since Y Y Y , x e x_e x e , and x s x_s x s are not free in C o n s M t o T l i n ( ϕ 2 ) \mathrm{ConsMtoT}^{lin}(\phi_{2}) ConsMtoT l in ( ϕ 2 ) . In the second case, we have π 2 ∈ ⟦ M t o T l i n ( ϕ 1 ) , [ Y : = S 2 ] ⟧ [ x e , x s : = t 1 ( π ) ] \pi^{2} \in\llbracket\mathrm{MtoT}^{lin}(\phi_{1}), [Y := S_{2}] \rrbracket_{[x_e,x_s:=t_{1}(\pi)]} π 2 ∈ [ [ MtoT l in ( ϕ 1 ) , [ Y := S 2 ] ] ] [ x e , x s := t 1 ( π )] and π 3 ∈ S 2 \pi^{3} \in S_{2} π 3 ∈ S 2 . Similarly to the previous case, we obtain π 2 ∈ ⟦ C o n s M t o T l i n ( ϕ 2 ) , [ Y : = S 1 ] ⟧ [ x e , x s : = t 1 ( π ) ] \pi^{2} \in\llbracket\mathrm{ConsMtoT}^{lin}(\phi_{2}), [Y := S_{1}] \rrbracket_{[x_e,x_s:=t_{1}(\pi)]} π 2 ∈ [ [ ConsMtoT l in ( ϕ 2 ) , [ Y := S 1 ] ] ] [ x e , x s := t 1 ( π )] . Therefore, to conclude Eq. (27) , it remains only to prove π 3 ∈ S 1 \pi^{3} \in S_{1} π 3 ∈ S 1 and t 3 ( π ) − t 1 ( π ) ≺ I R B ( I ) t_{3}(\pi)-t_{1}(\pi) \prec_{I} \mathcal{RB}(I) t 3 ( π ) − t 1 ( π ) ≺ I R B ( I ) . The former follows from the inductive hypothesis on n ′ n' n ′ . For the latter, since we have π 3 ∈ S 2 \pi^{3} \in S_{2} π 3 ∈ S 2 , Lemma B.3 ensures the existence of i ≥ 3 i \ge3 i ≥ 3 such that t i ( π ) − t 1 ( π ) ∈ I t_i(\pi)-t_1(\pi) \in I t i ( π ) − t 1 ( π ) ∈ I , therefore, we conclude t 3 ( π ) − t 1 ( π ) ≺ I R B ( I ) t_3(\pi)-t_1(\pi) \prec_{I} \mathcal{RB}(I) t 3 ( π ) − t 1 ( π ) ≺ I R B ( I ) by the monotonicity of timestamps.
Proposition 7.1. For all ϕ ∈ T P T L \phi\in TPTL ϕ ∈ T P T L , we have ⟦ P t o T l i n ( ϕ ) ⟧ = ⟦ C o n s P t o T l i n ( ϕ ) ⟧ \llbracket\mathrm{PtoT}^{lin}(\phi) \rrbracket= \llbracket\mathrm{ConsPtoT}^{lin}(\phi) \rrbracket [ [ PtoT l in ( ϕ ) ] ] = [ [ ConsPtoT l in ( ϕ ) ] ] .
Proof. We prove that, for every TPTL term ϕ \phi ϕ and valuation v v v , ⟦ P t o T l i n ( ϕ ) ⟧ v = ⟦ C o n s P t o T l i n ( ϕ ) ⟧ v \llbracket\mathrm{PtoT}^{lin}(\phi) \rrbracket_v = \llbracket\mathrm{ConsPtoT}^{lin}(\phi) \rrbracket_v [ [ PtoT l in ( ϕ ) ] ] v = [ [ ConsPtoT l in ( ϕ ) ] ] v . The proof proceeds by structural induction on ϕ \phi ϕ . All cases except constrained Until follow directly from the inductive hypothesis, since the two translations yield formulae of the same form. For the constrained Until case with ϕ = ϕ 1 U ( ( x ≺ n ) ∧ ϕ 2 ) \phi= \phi_1\ U\ ((x \prec n) \land\phi_2) ϕ = ϕ 1 U (( x ≺ n ) ∧ ϕ 2 ) , the proof is similar to the case ϕ 1 U I ϕ 2 \phi_1\ U_I\ \phi_2 ϕ 1 U I ϕ 2 in the proof of Proposition 6.6 with x s x_s x s replaced by x x x .