Computation Tree Logic with Deadlock Detection

Rob van Glabbeek^{1}^{,}^{2}, Bas Luttik^{3}^{,}^{4} & Nikola Trčka^{3}

1 National ICT Australia, Sydney, Australia

2 School of Computer Science and Engineering, Univ. of New South Wales, Sydney 3 Dept. of Math. & Comp. Sc., Technische Universiteit Eindhoven, The Netherlands

4 CWI, The Netherlands

Abstract. We study the equivalence relation on states of labelled transition systems of satisfying the same formulas in Computation Tree Logic without the next state modality (CTL_{−X}). This relation is obtained by De Nicola & Vaandrager by translating labelled transition systems to Kripke structures, while lifting the totality restriction on the latter. They characterised it as divergence sensitive branching bisimulation equivalence. We find that this equivalence fails to be a congruence for interleaving parallel composition. The reason is that the proposed application of CTL_{−X} to non-total Kripke structures lacks the expressiveness to cope with deadlock properties that are important in the context of parallel composition. We propose an extension of CTL_{−X}, or an alternative treatment of nontotality, that fills this hiatus. The equivalence induced by our extension is characterised as branching bisimulation equivalence with explicit divergence, which is, moreover, shown to be the coarsest congruence contained in divergence sensitive branching bisimulation equivalence.

1 Introduction

CTL^{∗} [5] is a powerful temporal logic combining linear time and branching time modalities; it generalises the branching time temporal logic CTL [4]. CTL^{∗} is interpreted in terms of Kripke structures. As the next state modality X is incompatible with abstraction of the notion of state, it is often excluded in high-level specifications. By CTL_{−X}^{∗} we denote CTL^{∗} without this modality. To characterise the equivalence induced on states of Kripke structures by validity of CTL_{−X}^{∗} formulas, Browne, Clarke & Grumberg [2] defined the notion of stuttering equivalence. They proved that two states in a finite Kripke structure are stuttering equivalent if and only if they satisfy the same CTL_{−X}^{∗} formulas, and moreover, they established that this is already the case if and only if the two states satisfy the same CTL_{−X} formulas.

There is an intuitive correspondence between the notions of stuttering equivalence on Kripke structures and branching bisimulation equivalence on labelled transition systems (LTSs) as defined in [8]. De Nicola & Vaandrager [3] have provided a framework for constructing natural translations between LTSs and Kripke structures in which this correspondence can be formalised. Stuttering equivalence corresponds in their framework to a divergence sensitive variant of branching bisimulation equivalence, and conversely, branching bisimulation equivalence corresponds to a divergence blind variant of stuttering equivalence. The latter characterises the equivalence induced on states of Kripke structures by a divergence blind variant of validity of CTL_{−X}^{∗} formulas.

In [4, 5, 2] and other work on CTL^{∗}, Kripke structures are required to be total, meaning that every state has an outgoing transition. These correspond with LTSs that are deadlock-free. In the world of LTSs requiring deadlock-freeness is considered a serious limitation, as deadlock is introduced by useful process algebraic operators like the restriction of CCS and the synchronous parallel composition of CSP. Conceptually, a deadlock may arise as the result of an unsuccessful synchronisation attempt between parallel components, and often one wants to verify that the result of a parallel composition is deadlock-free. This is possible only when working in a model of concurrency where deadlocks can be expressed.

Through the translations of [3] it is possible to define the validity of CTL_{−X}^{∗} formulas on states of LTSs. To apply CTL_{−X}^{∗}-formulas to LTSs that may contain deadlocks we consider Kripke structures with deadlocks as well, and hence lift the requirement of totality. Following [3], we do so by using maximal paths instead of infinite paths in the definition of validity of CTL_{−X}^{∗} formulas. Barring further changes, this amounts to the addition of a self loop to every deadlock state. As a consequence, CTL_{−X}^{∗} formulas cannot see the difference between a state without outgoing transitions (a deadlock) and one whose only outgoing transition constitutes a self loop (a livelock), and accordingly a deadlock state is stuttering equivalent to a livelock state that satisfies the same atomic propositions. This paper will challenge the wisdom of this set-up.

We observe that for systems with deadlock, the divergence sensitive branching bisimulation equivalence of [3] fails to be a congruence for interleaving operators. We characterise the coarsest congruence contained in divergence sensitive branching bisimulation equivalence as the branching bisimulation equivalence with explicit divergence, introduced in [8]. This equivalence differs from divergence sensitive branching bisimulation equivalence in that it distinguishes deadlock and livelock. For deadlock-free systems the equivalences coincide.

That divergence sensitive branching bisimulation equivalence is not a congruence for interleaving operators means that there are properties of concurrent systems, pertaining to their deadlock behaviour, that cannot be expressed in CTL_{−X}^{∗}, but that can be expressed in terms of the validity of a CTL_{−X}^{∗} formula on the result of putting these systems in a given context involving an interleaving operator. We find this unsatisfactory, and therefore propose an extension of CTL_{−X}^{∗} in which this type of property can be expressed directly. We obtain that two states are branching bisimulation equivalent with explicit divergence if and only if they satisfy the same formulas in the resulting logic.

Treating CTL_{−X} in the same way leads either to an extension of CTL_{−X} or, equivalently, to a modification of its semantics. The new semantics we propose for CTL_{−X} is a valid extension of the original semantics [4] to non-total Kripke structures. It slightly differs from the semantics of [3] and it is arguably better suited to deal with deadlock behaviour.

Instead of extending CTL_{−X}^{∗} or modifying CTL_{−X} we also achieve the same effect by amending the translation from LTSs to Kripke structures in such a way that every LTS maps to a total Kripke structure.

2 CTL _{−X}^{∗} and stuttering equivalence

We presuppose a set AP of atomic propositions. A Kripke structure is a tuple (S, ℒ , →) consisting of a set of states S, a labelling function ℒ : S → 2^{AP} and a transition relation → ⊆ S × S. For the remainder of the section we fix a Kripke structure (S, ℒ , →).

A finite path from s is a finite sequence of states s_{0}, …, s_{n} such that s = s_{0} and s_{k} ⟶ s_{k+1} for all 0 ≤ k < n. An infinite path from s is an infinite sequence of states s_{0}, s_{1}, s_{2}, … such that s = s_{0} and s_{k} ⟶ s_{k+1} for all k ∈ ω. A path is a finite or infinite path. A maximal path is an infinite path or a finite path s_{0}, …, s_{n} such that ¬∃s′. s_{n} ⟶ s′. We write π ⊵ π′ if the path π′ is a suffix of the path π, and π ⊳ π′ if π ⊵ π′ and π ≠ π′.

Temporal properties of states in S are defined using CTL_{−X}^{∗} formulas.

Definition 1. The classes Φ of CTL_{−X}^{∗} state formulas and Ψ of CTL_{−X}^{∗} path formulas are generated by the following grammar:

φ ::= p | ¬φ | ⋀ Φ′ | ∃ψ ψ ::= φ | ¬ψ | ⋀ Ψ′ | ψ U ψ

with p ∈ AP, φ ∈ Φ, Φ′ ⊆ Φ, ψ ∈ Ψ and Ψ′ ⊆ Ψ.

In case the cardinality of the set of states of our Kripke structure is less than some infinite cardinal κ,^{1} we may require that |Φ′| < κ and |Ψ′| < κ in conjunctions, thus obtaining a set of formulas rather than a proper class. Normally, S is required to be finite, and accordingly CTL_{−X}^{∗} admits finite conjunctions only.

Definition 2. We define when a CTL_{−X}^{∗} state formula φ is valid in a state s (notation: s ⊧ φ) and when a CTL_{−X}^{∗} path formula ψ is valid on a maximal path π (notation: π ⊧ ψ) by simultaneous induction as follows:

− s ⊧ p iff p ∈ ℒ (s); − s ⊧ ¬φ iff s |̸= φ; − s ⊧ ⋀ Φ′ iff s ⊧ φ for all φ ∈ Φ′; − s ⊧ ∃ψ iff there exists a maximal path π from s such that π ⊧ ψ; − π ⊧ φ iff s is the first state of π and s ⊧ φ; − π ⊧ ¬ψ iff π |̸= ψ; − π ⊧ ⋀ Ψ′ iff π ⊧ ψ for all ψ ∈ Ψ′; and − π ⊧ ψ U ψ′ iff there exists a suffix π′ of π such that π′ ⊧ ψ′, and π′′ ⊧ ψ

for all π ⊵ π′′ ⊳ π′.

A formula ψ U ψ′ says that, along a given path, ψ holds until ψ′ holds. One writes ⊤ for the empty conjunction (which is always valid), Fψ for ⊤ U ψ (“ψ will hold eventually”) and Gψ for ¬F¬ψ (“ψ holds always (along a path)”).

1 In fact it suffices to require that for every state s the cardinality of the set of states reachable from s is less than κ.

The above is the standard, divergence sensitive interpretation of CTL_{−X}^{∗} [5, 2], but extended to Kripke structures that are not required to be total. Following [3], this is achieved by using maximal paths in the definition of validity of CTL_{−X}^{∗} formulas, instead of the traditional use of infinite paths [5, 2]. The resulting definition generalises the traditional one, because for total Kripke structures a path is maximal iff it is infinite.

An equivalent way of thinking of this generalisation of CTL_{−X}^{∗} to non-total Kripke structures is by means of a transformation that makes a Kripke structure K total by the addition of a self loop s ⟶ s to every deadlock state s, together with the convention that a formula is valid in a state of K iff it is valid in the same state of the total Kripke structure obtained by this transformation. It is not hard to check that this yields the same notion of validity as our Definition 2.

The divergence blind interpretation of [3] (notation: s ⊧_{db} φ and π ⊧_{db} ψ) is obtained by dropping the word “maximal” in the fourth clause of Definition 2.

Definition 3. A colouring is a function C : S → C, for C any set of colours.

Given a colouring C and a (finite or infinite) path π = s_{0}, s_{1}, s_{2}, … from s, let C(π) be the sequence of colours obtained from C(s_{0}), C(s_{1}), C(s_{2}), … by contracting all its (finite or infinite) maximal consecutive subsequences C, C, C, … to C. The sequence C(π) is called a C-coloured trace of s; it is complete if π is maximal.

A colouring C is [fully] consistent if two states of the same colour always satisfy the same atomic propositions and have the same [complete] C-coloured traces. Two states s and t are divergence blind stuttering equivalent, notation s ≈_{dbs} t, if there exists a consistent colouring C such that C(s) = C(t). They are (divergence sensitive) stuttering equivalent, notation s ≈_{s} t, if there exists a fully consistent colouring C such that C(s) = C(t). The difference between ≈_{dbs} and ≈_{s} is illustrated in the following example.

Example 1. Consider the Kripke structure and its colouring depicted in Figure 1a. This colouring is consistent, implying s ≈_{dbs} t ≈_{dbs} u and x ≈_{dbs} y, but it is not fully consistent because state t has a complete trace while u does not. Note that t has, due to the self loop, a complete coloured trace that consists of just the colour of a p-labelled state, whereas the unique complete coloured trace of u contains the colour of a q-labelled state too. Since a consistent colouring assigns different colours to states with different labels, every fully consistent colouring must assign different colours to states t and u, i.e. it must be that t ≉_{s} u. One such colouring is given in Figure 1b. This colouring shows that x ≈_{s} y.

Lemma 1. Let C be a colouring such that two states with the same colour satisfy the same atomic propositions and have the same C-coloured traces of length two. Then C is consistent.

Proof. Suppose C(s_{0}) = C(t_{0}) and C_{0}, C_{1}, C_{2}, … is an infinite coloured trace of s_{0}. Then, for i > 0, there are states s_{i} and finite paths π_{i} from s_{i−1} to s_{i}, such that C(π_{i}) = C_{i−1}, C_{i}. With induction on i, for i > 0 we find states t_{i} with

a) [figure: s; p; t; p; u; p; x; q; y; q]  b) [figure: s; p; t; p; u; p; x; q; y; q]

Fig. 1. Difference between a) ≈_{dbs} and b) ≈_{s}.

C(s_{i}) = C(t_{i}) and finite paths ρ_{i} from t_{i−1} to t_{i} such that C(ρ_{i}) = C_{i−1}, C_{i}. Namely, the assumption about C allows us to find ρ_{i} given t_{i−1}, and then t_{i} is defined as the last state of ρ_{i}. Concatenating all the paths ρ_{i} yields an infinite path ρ from t_{0} with C(ρ) = C_{0}, C_{1}, C_{2}, . . ..

The case that C(s_{0}) = C(t_{0}) and C_{0}, …, C_{n} is a finite coloured trace of s_{0} goes likewise. □

Lemma 2. Let C be a colouring such that two states with the same colour satisfy the same atomic propositions and have the same C-coloured traces of length two, and the same complete C-coloured traces of length one. Then C is fully consistent.

Proof. Suppose C(s) = C(t) and σ is a complete C-coloured trace of s. Then σ = C(π) for a maximal path π from s. By Lemma 1, σ is also a C-coloured trace of t. It remains to show that it is a complete C-coloured trace of t. Let ρ be a path from t with C(ρ) = σ. If ρ is infinite, we are done. Otherwise, let t′ be the last state of ρ. Then C(t′) is the last colour of σ. Therefore, there is a state s′ on π such that the suffix π′ of π starting from s′ is a maximal path with C(π′) = C(s′) = C(t′). By the assumption about C, C(t′) must also be a complete C-coloured trace of t′, i.e. there is a maximal path ρ′ from t′ with C(ρ′) = C(t′). Concatenating ρ and ρ′ yields a maximal path ρ′′ from t with C(ρ′′) = σ. □

The following two theorems were proved in [3] and [2], respectively, for states s and t in a finite Kripke structure. Here we drop the finiteness restriction.

Theorem 1. s ≈_{dbs} t iff s⊧_{db} φ ⇔ t⊧_{db} φ for all CTL_{−X}^{∗} state formulas φ.

Proof. “Only if”: Let C be a consistent colouring. With structural induction on φ and ψ we show that

C(s) = C(t) ⇒ (s⊧_{db} φ ⇔ t⊧_{db} φ) and C(π) = C(ρ) ⇒ (π ⊧_{db} ψ ⇔ ρ⊧_{db} ψ).

The case φ = p for p ∈ AP follows immediately from Definition 3. The cases φ = ¬φ′ and φ = ⋀ Φ′ follow immediately from the induction hypothesis.

Suppose C(s) = C(t) and s ⊧_{db} ∃ψ. Then there exists a path π from s such that π ⊧_{db} ψ. C(π) is a coloured trace of s, and hence of t. Thus there must be a path ρ from t with C(π) = C(ρ). By induction, ρ⊧_{db} ψ. Hence, t⊧_{db} ∃ψ.

The case φ ∈ Φ follows since the first states of two paths with the same colour also have the same colour. The cases ψ = ¬ψ′ and ψ = ⋀ Ψ′ follow immediately from the induction hypothesis.

Finally, suppose C(π) = C(ρ) and π ⊧_{db} ψ U ψ′. Then there exists a suffix π′ of π such that π′ ⊧_{db} ψ′ and π′′ ⊧_{db} ψ for all π ⊵ π′′ ⊳ π′. As C(π) = C(ρ), there must be a suffix ρ′ of ρ such that C(π′) = C(ρ′) and for every path ρ′′ such that ρ ⊵ ρ′′ ⊳ ρ′ there exists a path π′′ with π ⊵ π′′ ⊳ π′ such that C(π′′) = C(ρ′′). By induction, this implies ρ′ ⊧_{db} ψ′ and ρ′′ ⊧_{db} ψ for all ρ ⊵ ρ′′ ⊳ ρ′. Hence ρ ⊧_{db} ψ U ψ′.

“If”: Let C be the colouring given by C(s) = {φ ∈ Φ | s ⊧_{db} φ}. It suffices to show that C is consistent. So suppose C(s) = C(t). Trivially, s and t satisfy the same atomic propositions. By Lemma 1 it remains to show that s and t have the same coloured traces of length two. Suppose s has a coloured trace C, D. Let s_{0}, …, s_{k} be a path from s such that C(s_{i}) = C for 0 ≤ i < k and C(s_{k}) = D ≠ C. Let

U = {u | there is a path from t to u and C(u) ≠ C}, V = {v | there is a path from t to v and C(v) ≠ D}.

For every u ∈ U pick a CTL_{−X}^{∗} formula φ_{u} ∈ C − C(u) (using negation on a formula in C(u) − C if needed), and for every v ∈ V pick a CTL_{−X}^{∗} formula φ′_{v} ∈ D − C(v). Now s ⊧_{db} ∃(⋀_{u∈U} φ_{u}) U (⋀_{v∈V} φ′_{v}) and, as C(s) = C(t), also t ⊧_{db} ∃(⋀_{u∈U} φ_{u}) U (⋀_{v∈V} φ′_{v}). Thus, there is a path t_{0}, …, t_{ℓ} from t such that t_{ℓ} ⊧_{db} ⋀_{v∈V} φ′_{v} and t_{j} ⊧_{db} ⋀_{u∈U} φ_{u} for 0 ≤ j < ℓ. It follows that t_{ℓ} ∉ V and t_{j} ∉ U for 0 ≤ j < ℓ. Hence C(t_{ℓ}) = D and C(t_{j}) = C for 0 ≤ j < ℓ, so C, D is also a coloured trace of t. □

Theorem 2. s ≈_{s} t iff s ⊧ φ ⇔ t ⊧ φ for all CTL_{−X}^{∗} state formulas φ.

Proof. “Only if” goes exactly as in the previous proof, reading ⊧ for ⊧_{db}, but requiring C to be fully consistent and, in the second paragraph, the paths π and ρ to be maximal and C(π) to be a complete coloured trace of s and t.

“If” goes as in the previous proof, but this time we have to show that C is fully consistent. Thus, applying Lemma 2, and assuming C(s) = C(t), we additionally have to show that s and t have the same complete coloured traces of length one. Let π be a maximal path from s with C(π) = C. Let

U = {u | there is a path from t to u and C(u) ≠ C}.

For every u ∈ U pick a CTL_{−X}^{∗} formula φ_{u} ∈ C − C(u). Now s ⊧ ∃G(⋀_{u∈U} φ_{u}) and, as C(s) = C(t), also t ⊧ ∃G(⋀_{u∈U} φ_{u}). Thus, there is a maximal path ρ from t such that t′ ⊧ ⋀_{u∈U} φ_{u} for all states t′ in ρ. It follows that t′ ∉ U. Hence C(t′) = C and thus C(ρ) = C. □

Corollary 1. ≈_{dbs} and ≈_{s} are equivalence relations. □

Note that, for any colouring C, the C-coloured traces of a state s are completely determined by the complete C-coloured traces of s, namely as their prefixes.

Hence, any colouring that is fully consistent is certainly consistent, and thus ≈_{s} is a finer (i.e. smaller, more discriminating) equivalence relation than ≈_{dbs}.

Above, the divergence blind interpretation of CTL_{−X}^{∗} is defined by using paths instead of maximal paths. It can equivalently be defined in terms of a transformation on Kripke structures, namely the addition of a self loop s ⟶ s for every state s. Now s ≈_{dbs} t holds in a certain Kripke structure iff s ≈_{s} t holds in the Kripke structure obtained by adding all these self loops. This is because the colour of a path doesn’t change when self-loops are added to it, and up to self loops any path is maximal. Likewise, s ⊧_{db} φ in the original Kripke structure iff s ⊧ φ in the modified one.

Just like ≈_{dbs} can be expressed in terms of ≈_{s} by means of a transformation on Kripke structures, by means of a different transformation, at least for finite Kripke structures, ≈_{s} can be expressed in terms of ≈_{dbs}. This is done in [3], Definitions 3.2.6 and 3.2.7.

3 Branching bisimulation in terms of coloured traces

We presuppose a set A of actions with a special element τ ∈ A. A labelled transition system (LTS) is a structure (S, →) consisting of a set of states S and a transition relation → ⊆ S × A × S. For the remainder of the section we fix an LTS (S, →). We write s ⟶^{a} s′ for (s, a, s′) ∈ →.

A path from s is an alternating sequence s_{0}, a_{1}, s_{1}, a_{2}, s_{2}, … of states and actions, ending with a state if the sequence is finite, such that s = s_{0} and s_{k−1} ⟶^{a_{k}} s_{k} for all relevant k > 0. A maximal path is an infinite path or a finite

path s_{0}, a_{1}, s_{1}, a_{2}, …, a_{n}, s_{n} such that ¬∃a, s′. s_{n} ⟶^{a} s′. We write π ⊵ π′ if the

path π′ is a suffix of the path π, and π ⊳ π′ if π ⊵ π′ and π ≠ π′.

Definition 4. A colouring is a function C : S → C, for C any set of colours.

For π = s_{0}, a_{1}, s_{1}, a_{2}, s_{2}, … a path from s, let C(π) be the alternating sequence of colours and actions obtained from C(s_{0}), a_{1}, C(s_{1}), a_{2}, C(s_{2}), … by contracting all (finite or infinite) maximal consecutive subsequences C, τ, C, τ, C, … to C. The sequence C(π) is called a C-coloured trace of s; it is complete if π is maximal; it is divergent if it is finite whilst π is infinite.

A colouring C is [fully] consistent if two states of the same colour always have the same [complete] C-coloured traces. Two states s and t are (divergence blind) branching bisimulation equivalent, notation s \underline{↔}_{b} t, if there exists a consistent colouring C such that C(s) = C(t). They are divergence sensitive branching bisimulation equivalent, notation s \underline{↔}_{b}^{λ} t, if there exists a fully consistent colouring C such that C(s) = C(t).

A consistent colouring preserves divergence if two states of the same colour always have the same divergent C-coloured traces. Two states s and t are branching bisimulation equivalent with explicit divergence, notation s \underline{↔}_{b}^{Δ} t, if there exists a consistent, divergence preserving colouring C with C(s) = C(t).

The difference between \underline{↔}_{b}, \underline{↔}_{b}^{λ}, and \underline{↔}_{b}^{Δ} is illustrated in the following example.

a) [figure: s; τ; τ; τ; t; τ; a; u; a; v; a; x; y; z; τ] b) [figure: s; τ; τ; τ; t; τ; a; u; a; v; a; x; y; z; τ] c) [figure: s; τ; τ; τ; t; τ; a; u; a; v; a; x; y; z; τ]

Fig. 2. Difference between a) \underline{↔}_{b}, b) \underline{↔}_{b}^{λ}, and c) \underline{↔}_{b}^{Δ}.

Example 2. Consider first the LTS and its colouring depicted in Figure 2a. This colouring is consistent and we have s \underline{↔}_{b} t \underline{↔}_{b} u \underline{↔}_{b} v and x \underline{↔}_{b} y \underline{↔}_{b} z. It is not fully consistent because state s has a complete trace whereas t has not. It is easy to see that every fully consistent colouring must assign different colours to states t and u, and so that t \underline{↮}_{b}^{λ} u. One such colouring is given in Figure 2b and it shows that u \underline{↔}_{b}^{λ} v and x \underline{↔}_{b}^{λ} y \underline{↔}_{b}^{λ} z. Note, however, that this colouring, although fully consistent, does not preserve divergence. State v has a divergent trace a whereas u has not, and similarly state z has a divergent trace whereas y has not. Any colouring that preserves divergence must assign different colours to states u and v and to states y and z, meaning that u \underline{↮}_{b}^{Δ} v and y \underline{↮}_{b}^{Δ} z. One such colouring is given in Figure 2c. It shows that x \underline{↔}_{b}^{Δ} y. In fact, these are the only two (different) states that are branching bisimulation equivalent with explicit divergence.

In the definition of \underline{↔}_{b}^{Δ} above, consistency and preservation of divergence appear as two separate properties of colourings. Instead we could have integrated them by adding an extra bit (Δ) at the end of those finite coloured traces that stem from infinite paths. Likewise, \underline{↔}_{b}^{λ} could have been defined by adding such an extra bit at the end of those finite coloured traces that stem from maximal paths.

Lemmas 1 and 2 about colourings on Kripke structures apply to labelled transition systems as well. The proofs are essentially the same.

Lemma 3. Let C be a colouring such that two states with the same colour have the same C-coloured traces of length three (i.e. colour - action - colour). Then C is consistent. □

Lemma 4. Let C be a consistent colouring such that two states with the same colour have the same complete C-coloured traces of length one. Then C is fully consistent. □

Lemma 5. Let C be a consistent colouring such that two states with the same colour have the same divergent C-coloured traces of length one. Then C preserves divergence.

Proof. Exactly like the proof of Lemma 2, but letting σ be a divergent C-coloured trace of s; π, π′ infinite paths; C(t′) a divergent C-coloured trace of t′; and ρ′, ρ′′ infinite paths. □

Branching bisimulation equivalence and branching bisimulation equivalence with explicit divergence were originally defined in Van Glabbeek & Weijland [8]. There, only finite coloured traces are considered, and a consistent colouring was defined as a colouring with the property that two states have the same colour only if they have the same finite coloured traces. By Lemma 3 this yields the same concept of consistent colouring as Definition 4 above.

In [8], a consistent colouring is said to preserve divergence if no divergent state has the same colour as a nondivergent state. Here a state s is divergent if it is the starting point of an infinite path of which all nodes have the same colour. This is the case if s has a divergent coloured trace of length one. Now Lemma 5 says that the definition of preservation of divergence from [8] agrees with the one proposed above. Hence the concepts of branching bisimulation and branching bisimulation with explicit divergence of [8] agree with ours.

Theorem 3. \underline{↔}_{b}, \underline{↔}_{b}^{λ} and \underline{↔}_{b}^{Δ} are equivalence relations.

Proof. We show the proof for \underline{↔}_{b}; the other two cases proceed likewise.

We will regard any equivalence relation on S as a colouring, the colour of a state being its equivalence class. Conversely, any colouring can be considered as an equivalence relation on states.

The diagonal on S (i.e., the binary relation {(s, s) | s ∈ S}) is a consistent colouring, so \underline{↔}_{b} is reflexive. That \underline{↔}_{b} is symmetric is immediate from the required symmetry of colourings.

To prove that \underline{↔}_{b} is transitive, suppose s \underline{↔}_{b} t and t \underline{↔}_{b} u. So there exist consistent colourings C and D with C(s) = C(t) and D(t) = D(u). Let E be the finest equivalence relation containing C and D. Then E(s) = E(t) = E(u). It suffices to show that E is consistent.

First of all note that the E-colour of a state is completely determined by its C-colour, as well as by its D-colour: C(p) = C(q) ⇒ E(p) = E(q) and D(p) = D(q) ⇒ E(p) = E(q) for all p, q ∈ S. Thus, if two states have the same sets of C-coloured traces or the same sets of D-coloured traces, they must also have the same sets of E-coloured traces.

Suppose E(p) = E(q). Then there must be a sequence of states (p_{i})_{0≤i≤n} such that p = p_{0}, q = p_{n} and for 0 ≤ i < n we have either C(p_{i}) = C(p_{i+1}) or D(p_{i}) = D(p_{i+1}). As C and D are consistent colourings, p_{i} and p_{i+1} have the same C-coloured traces or the same D-coloured traces. In either case they also have the same E-coloured traces. This holds for 0 ≤ i < n, so p and q have the same E-coloured traces. Thus E is consistent. □

Lemma 6. Let C be a consistent colouring and s ∈ S. Then the complete Ccoloured traces of s consist of the C-coloured traces of s that are infinite, divergent, or maximal, in the sense that they cannot be extended.

Proof. By definition, infinite and divergent C-coloured traces of s are complete. Let σ be a maximal C-coloured trace of s, and let π be a path from s such that C(π) = σ. Let π′ be an extension of π to a maximal path. As σ is a maximal C-coloured trace, in the sense that it cannot be extended, we have C(π′) = σ. Hence σ is a complete C-coloured trace of s.

Now let σ be a complete C-coloured trace of s that is not infinite, nor a divergent C-coloured trace of s. In that case σ = C(π) for π a finite maximal path from s. Let t be the last state of π. We have ¬∃a, t′. t ⟶^{a} t′. Suppose, towards a contradiction, that σ is not maximal, i.e. there is a path π′ from s such that C(π′) is a proper extension of σ. Then there must be a state u on π′ with C(u) = C(t), such that u has a coloured trace σ′ of length > 1, which is a suffix of C(π′). As C is consistent, σ′ is also a coloured trace of t, contradicting

¬∃a, t′. t ⟶^{a} t′. □

As for Kripke structures, for any colouring C, the C-coloured traces of a state s are the prefixes of the complete C-coloured traces of s. Moreover, Lemma 6 says that the complete C-coloured traces of a state s are completely determined by the C-coloured traces of s together with the divergent C-coloured traces of s. Hence, any colouring that is consistent and preserves divergence is also fully consistent. Therefore, \underline{↔}_{b}^{Δ} is finer than \underline{↔}_{b}^{λ}, which is finer than \underline{↔}_{b}.

The difference between \underline{↔}_{b}^{λ} and \underline{↔}_{b}^{Δ} is that only the latter sees the difference between those maximal finite coloured traces that stem from finite paths (ending in deadlock) and those that stem from infinite paths (ending in livelock). For deadlock-free LTSs (having no states s with ¬∃a, s′. s ⟶^{a} s′) the equivalences \underline{↔}_{b}^{λ} and \underline{↔}_{b}^{Δ} coincide.

4 Translating between Kripke structures and labelled transition systems

We presuppose a set A of actions with a special element τ ∈ A, and a set AP of atomic propositions. A doubly labelled transition system (L^{2}TS) is a structure (S, ℒ , →) that consists of a set of states S, a labelling function ℒ : S → 2^{AP} and a labelled transition relation → ⊆ S × A × S. From an L^{2}TS one naturally obtains an LTS by omitting the labelling function ℒ , and a Kripke structure by replacing the labelled transition relation by one from which the labels are omitted. We call these the LTS or Kripke structure associated to the L^{2}TS. An L^{2}TS (S, ℒ , →) is consistent if it satisfies the following three conditions:

(i) if s ⟶^{a} t, then (ℒ (s) = ℒ (t) iff a = τ); (ii) if s ⟶^{a} t, s′ ⟶^{a} t′ and ℒ (s) = ℒ (s′), then ℒ (t) = ℒ (t′); and (iii) if s ⟶^{a} t, s′ ⟶^{b} t′, ℒ (s) = ℒ (s′) and ℒ (t) = ℒ (t′), then a = b.

Consistent L^{2}TSs were introduced in De Nicola & Vaandrager [3] for studying relationships between notions defined for Kripke structures and notions defined for LTSs. Condition (iii) says that the label of a transition is fully determined by the labels of its source and target state, whereas condition (ii) entails that the label of a state t reachable from a state s is completely determined by the label of s and the sequence of labels of the transitions leading from s to t.

Example 3. The three L^{2}TSs from Figure 3a are not consistent because they violate condition (i), (ii), and (iii) respectively; the L^{2}TS in Figure 3b is consistent.

a) [figure: p; a] [figure: p; a; a; q; r] [figure: p; a; b; q; q] b) [figure: p; a; a; b; q; τ; q; r]

Fig. 3. a) Three inconsistent L^{2}TSs and b) a consistent L^{2}TS.

Many semantic equivalences on LTSs, such as \underline{↔}_{b}, \underline{↔}_{b}^{λ} and \underline{↔}_{b}^{Δ}, are considered in the literature; for an overview see [6].

Definition 5. Any semantic equivalence ∼ on LTSs extends to L^{2}TSs by declaring, for all states s and t in an L^{2}TS, that s ∼ t iff ℒ (s) = ℒ (t) and s ∼ t in the associated LTS.

Any semantic equivalence ∼ on Kripke structures extends to L^{2}TSs by declaring, for all states s and t in an L^{2}TS, that s ∼ t iff s ∼ t in the associated Kripke structure.

The following theorem was proved in [3] for finite consistent L^{2}TSs. Here we drop the finiteness restriction.

Theorem 4. On a consistent L^{2}TS, ≈_{dbs} equals \underline{↔}_{b}, and ≈_{s} equals \underline{↔}_{b}^{λ}.

Proof. Suppose s ≈_{dbs} t [or s ≈_{s} t]. Then there is a colouring C on the states of the L^{2}TS that is [fully] consistent on the associated Kripke structure K and satisfies C(s) = C(t). By definition, this entails ℒ (s) = ℒ (t). It remains to show that C is [fully] consistent on the associated LTS L. So let C(p) = C(q), and let σ be a [complete] coloured trace of p in L. Using symmetry, it suffices to show that σ is also a [complete] coloured trace of q in L. Let ρ be obtained by omitting all actions from the alternating sequence of states and actions σ. Using direction “only if” of clause (i) in the definition of a consistent L^{2}TS, ρ must be a [complete] coloured trace of p in K. As C is [fully] consistent on K, ρ must also be a [complete] coloured trace of q in K. Finally, using clauses (i) “only if” and (iii), σ must be a [complete] coloured trace of q in L.

Now suppose s \underline{↔}_{b} t [or s \underline{↔}_{b}^{λ} t]. Then ℒ (s) = ℒ (t) and there is a colouring C on the states of the L^{2}TS, with C(s) = C(t), that is [fully] consistent on L. Let D be the colouring given by D(p) := (C(p), ℒ (p)) for all p ∈ S, so that we have D(p) = D(q) ⇔ [C(p) = C(q) ∧ ℒ (p) = ℒ (q)]. It suffices to show that D is [fully] consistent on K. The requirement D(p) = D(q) ⇒ ℒ (p) = ℒ (q) is built into the definition of D. So let D(p) = D(q), and let ν be a [complete] D-coloured trace of p in K. Using symmetry, it suffices to show that ν is also a [complete] D-coloured trace of q in K. Using clause (i) “only if”, there must be a [complete] D-coloured trace ρ of p in L such that ν is obtained from ρ by omitting its actions. Let σ be the [complete] C-coloured trace of s in K obtained from ρ by omitting the second component of each D-colour of a state. As C(p) = C(q) and C is [fully] consistent on L, σ must also be a [complete] C-coloured trace of q in L. By applying clauses (i) “if” and (ii) one derives that ρ is a [complete] D-coloured trace of q in L. Therefore, again using clause (i) “only if”, ν must be a [complete] D-coloured trace of q in K. □

Observation 1. For every Kripke structure K there exists a consistent L^{2}TS D such that K is the Kripke structure associated to D.

One way to obtain D is to label any transition s ⟶ t by the pair (ℒ (s), ℒ (t)) (or simply by ℒ (t)) when ℒ (s) ≠ ℒ (t), or τ when ℒ (s) = ℒ (t). An alternative is the label (ℒ (s) − ℒ (t), ℒ (t) − ℒ (s)), where (∅, ∅) is identified with τ.

Unlike the situation for Kripke structures (Observation 1) it is not the case that every LTS can be obtained as the LTS associated to a consistent L^{2}TS. A simple counterexample is presented in [3]. Thus, in encoding LTSs as L^{2}TSs, it is in general not possible to keep the set of states the same.

Definition 6. An LTS-to-L^{2}TS transformation η consist of a function taking any LTS L to a consistent L^{2}TS η(L), and in addition taking any state s in L to a state η(s) in η(L). Such a transformation should at least satisfy s \underline{↔}_{b}^{λ} t ⇔ η(s) \underline{↔}_{b}^{λ} η(t), that is, it preserves (“⇒”) and reflects (“⇐”) divergence sensitive branching bisimulation equivalence, and likewise for \underline{↔}_{b}, and \underline{↔}_{b}^{Δ}.

A common LTS-to-L^{2}TS transformation is presented in [3]. It takes an LTS L = (S, →) to an L^{2}TS η(L) by inserting a new state halfway any transition s⟶^{a}t with a ≠ τ. This new state is labelled {a}, and each of the two transitions replacing s ⟶^{a} t (from s to the new state and from there to t) is labelled a. Transitions s ⟶^{τ} t are untouched. One takes η(s) = s for s ∈ S and all such states from L are labelled {⊥} in η(L). (Consult [3] for the formal definition and examples.) In [3] it is shown that this transformation preserves and reflects \underline{↔}_{b}^{λ}; the same proof applies to \underline{↔}_{b} and \underline{↔}_{b}^{Δ}.

An LTS-to-L^{2}TS transformation η yields an LTS-to-Kripke-structure transformation that we also call η, namely the one transforming an LTS L into the Kripke structure associated to η(L). In fact, using Theorem 4 and Observation 1, any LTS-to-Kripke-structure transformation η that preserves and reflects the required equivalences can be obtained in this way.

An LTS-to-L^{2}TS transformation η makes it possible to define when a state s in an LTS satisfies a CTL_{−X}^{∗} formula φ. Namely, one defines s ⊧^{η} φ iff η(s) ⊧ φ. This way, CTL_{−X}^{∗} can be used as temporal logic on LTSs.

Theorem 5. Let s and t be states in an LTS, and let η be an LTS-to-L^{2}TS transformation. Then

s \underline{↔}_{b} t iff s ⊧_{db}^{η} φ ⇔ t ⊧_{db}^{η} φ for all CTL_{−X}^{∗} state formulas φ
s \underline{↔}_{b}^{λ} t iff s ⊧^{η} φ ⇔ t ⊧^{η} φ for all CTL_{−X}^{∗} state formulas φ.

Proof. This is an immediate consequence of the requirement that η preserves and reflects \underline{↔}_{b} and \underline{↔}_{b}^{λ}, in combination with Theorems 1, 2 and 4. □

5 Parallel composition

For a behavioural equivalence to be useful in a process algebraic setting, it is essential that it is a congruence for the operations under consideration. In this section we prove that \underline{↔}_{b}^{Δ} and \underline{↔}_{b} are congruences for the merge or interleaving operator ∥. This operator is often used to represent (asynchronous) parallel composition. However, \underline{↔}_{b}^{λ} fails to be a congruence for ∥. We characterise the least discriminating congruence that makes all the distinctions of \underline{↔}_{b}^{λ} as \underline{↔}_{b}^{Δ}.

Definition 7. A binary operation ∥ on the states of an LTS is a merge if for all s, t, u ∈ S and for all a ∈ A it holds that s ∥ t ⟶^{a} u iff − there exists s′ ∈ S such that s ⟶^{a} s′ and u = s′ ∥ t; or − there exists t′ ∈ S such that t ⟶^{a} t′ and u = s ∥ t′. Using well known techniques from structural operational semantics [1] any LTS can be augmented with a merge. Moreover, an LTS with merge is generated by the structural operational semantics of any process calculus that includes an operation for pure interleaving. Henceforth we deal with LTSs with a merge ∥.

Theorem 6. The relation \underline{↔}_{b}^{Δ} is a congruence for ∥, i.e., if s \underline{↔}_{b}^{Δ} t and u \underline{↔}_{b}^{Δ} v, then s ∥ u \underline{↔}_{b}^{Δ} t ∥ v.

Proof. Let R be the reflexive and transitive closure of the relation

\{(p∥q, p′∥q′) | p \underline{↔}_{b}^{Δ} p′ & q \underline{↔}_{b}^{Δ} q′\} .

Let C be the function that assigns to each state its equivalence class with respect to R. It suffices to prove that C is a consistent divergence preserving colouring. So suppose C(r) = C(r′). Using Lemmas 3 and 5 it suffices to show that r and r′ have the same C-coloured traces of length three and the same divergent Ccoloured traces of length one. It is straightforward, but notationally cumbersome, to establish this in the special case that r = p ∥ q and r′ = p′ ∥ q′ with p \underline{↔}_{b}^{Δ} p′ and q \underline{↔}_{b}^{Δ} q′. The general case then follows by induction on the length of a chain of pairs from the relation displayed above showing that the pair (r, r′) is in its reflexive and transitive closure. □

A similar proof shows that also \underline{↔}_{b} is a congruence for ∥. However, \underline{↔}_{b}^{λ} is not.

Example 4. Consider an LTS with merge that contains a state 0 without outgoing transitions, a state Δ0 with a τ-loop (an outgoing τ-labelled transition to itself) and no other outgoing transitions, and a state a with a ⟶^{a} 0 and no other outgoing transitions. (Note that such an LTS is, e.g., generated by the structural operational semantics of CCS with recursion.) Then 0 \underline{↔}_{b}^{λ} Δ0. Figure 4a shows the fragment consisting of the states 0, Δ0 and a of the LTS under consideration. Figure 4b shows a fragment where the merge is applied. Observe that 0 ∥ a \underline{↮}_{b}^{λ} Δ0 ∥ a. The reason is that Δ0 ∥ a has a maximal path that stays in its initial state, whereas 0 ∥ a has not. This problem does not apply to \underline{↔}_{b} because 0 ∥ a \underline{↔}_{b} Δ0 ∥ a. It does not apply to \underline{↔}_{b}^{Δ} because 0 \underline{↮}_{b}^{Δ} Δ0.

a) [figure: a; a; Δ0; τ; _{\underline{↔}λ b}; 0]  b) [figure: 0∥a; a; \underline{↮}_{b}^{λ}; Δ0∥a; a; τ; 0∥0; Δ0∥0; τ]

Fig. 4. \underline{↔}_{b}^{λ} is not a congruence for parallel composition

The example above involves a deadlock state, namely 0. This is unavoidable, as on LTSs without deadlock \underline{↔}_{b}^{λ} coincides with \underline{↔}_{b}^{Δ} (cf. Section 3) and hence is a congruence for ∥.

The standard solution to the problem of an equivalence ∼ failing to be a congruence for a desirable operator Op is to replace it by the coarsest congruence for Op that is included in ∼ [10]. Applying this technique to the current situation, the coarsest congruence for ∥ included in \underline{↔}_{b}^{λ} turns out to be \underline{↔}_{b}^{Δ}.

Theorem 7. \underline{↔}_{b}^{Δ} is the coarsest congruence for ∥ that is included in \underline{↔}_{b}^{λ}.^{2}

Proof. We have already seen that \underline{↔}_{b}^{Δ} is a congruence for ∥, and that it is included in \underline{↔}_{b}^{λ}. To show that it is the coarsest, it suffices to show that whenever s \underline{↮}_{b}^{Δ} t, we can find a state u such that s ∥ u \underline{↮}_{b}^{λ} t ∥ u. In fact, we can always take u to be the state a from Example 4, for a an action that does not occur in any path from s or t.

Namely, suppose that s ∥ a \underline{↔}_{b}^{λ} t ∥ a. Let C be a fully consistent colouring with C(s∥a) = C(t∥a). Define the colouring D by D(p) = C(p∥a) for p a state

2 Strictly speaking, we merely show that \underline{↔}_{b}^{Δ} is the coarsest congruence for ∥ that is included in \underline{↔}_{b}^{λ} and satisfies the Fresh Atom Principle (FAP). This principle, described in [7], is satisfied by a semantic equivalence ∼ on LTSs when ∼ on an LTS L can always be obtained as the restriction of ∼ on any given larger LTS of which L is a subLTS, and whose transition labels may be drawn from a larger set of actions than those of L. FAP allows us to use the state a that figures in the proof of Theorem 7, regardless of whether such a state, or the fresh action a, occurs in the given LTS or not. FAP is satisfied by virtually all semantic equivalences documented in the literature, and can be used as a sanity check for meaningful equivalences [7].

reachable from s or t, and D(p) = p otherwise. Then D(s) = D(t). It suffices to show that D is consistent and preserves divergence, implying s \underline{↔}_{b}^{Δ} t.

So suppose D(p) = D(q) with p ≠ q. Then C(p∥a) = C(q∥a).

First we show that p and q have the same D-coloured traces. Let σ be a D-coloured trace of p. Then σ is also a C-coloured trace of p∥a. As p∥a and q ∥a have the same complete C-coloured traces, they surely have the same C-coloured traces (for the coloured traces of a state are the prefixes of its complete coloured traces). Hence σ is a C-coloured trace of q ∥ a. As p is reachable from s or t, the action a cannot occur in σ. Therefore, σ must also be a D-coloured trace of q. By symmetry, any D-coloured trace of q is also a D-coloured trace of p, and hence p and q have the same D-coloured traces.

Next, we show that p and q have the same divergent D-coloured traces. So let σ be a divergent D-coloured trace of p. Then σ is also a divergent C-coloured trace of p∥a. Hence σ is a complete C-coloured trace of p∥a and thus also of q∥a. As the action a cannot occur in σ, it is not possible that σ stems from a finite maximal path from q ∥ a. Therefore, σ must be a divergent C-coloured trace of q ∥ a, and hence a divergent D-coloured trace of q. Again invoking symmetry, p and q have the same divergent D-coloured traces.

It follows that D is consistent and preserves divergence; thus s \underline{↔}_{b}^{Δ} t. □

So if one is in search of a semantics such that, for s and t states in an LTS, − if there is a CTL_{−X}^{∗} state formula φ such that s ⊧^{η} φ but t |̸=^{η} φ, then s

and t should be distinguished, − if s and t can be distinguished after placing them in a context ∥ u for some

u, then they should be distinguished to start with − and no two states should be distinguished unless this is required by the

previous two conditions, then branching bisimulation semantics with explicit divergence is the answer, for s \underline{↔}_{b}^{Δ} t iff for all u and all φ ∈ Φ we have s ∥ u ⊧^{η} φ ⇔ t ∥ u ⊧^{η} φ.

6 Adding deadlock detection to CTL _{−X}^{∗}

We saw above that there are important properties of states s in an LTS that can be expressed in terms of a context ∥ u and a CTL_{−X}^{∗} formula φ, namely as s∥u ⊧^{η} φ, but that cannot be directly expressed in terms of CTL_{−X}^{∗}. This is somewhat unsatisfactory, and therefore we propose an extension of CTL_{−X}^{∗} in which this type of property can be expressed directly. We add a path modality ∞ that is valid on a path π iff π is infinite. This path modality, or actually an equally expressive one, was studied prior by Kaivola & Valmari [9] in the context of Linear Temporal Logic without the next state operator—see Section 9.

Definition 8. The syntax of CTL_{∞}^{∗} is given by

φ ::= p | ¬φ | ⋀ Φ′ | ∃ψ ψ ::= φ | ¬ψ | ⋀ Ψ′ | ψ U ψ | ∞

with p ∈ AP, φ ∈ Φ, Φ′ ⊆ Φ, ψ ∈ Ψ and Ψ′ ⊆ Ψ. Validity is defined as in Definition 2, but adding the clause − π ⊧ ∞ iff the path π is infinite.

We write ∃^{∞}ψ for ∃(∞ ∧ ψ); this formula holds in a state s if there exists an infinite path π from s such that π ⊧ ψ. Likewise ∀^{∞}ψ = ∀(∞ → ψ) holds in s if for all infinite paths π from s we have that s ⊧ ψ. These constructs are dual, in the sense that s ⊧ ¬∃^{∞}ψ iff s ⊧ ∀^{∞}¬ψ.

The negation of ∞ holds for a maximal path π iff π is finite, and hence ends in a deadlock. It is tempting to simply extend CTL_{−X}^{∗} with a state formula δ such that s ⊧ δ iff ¬∃s′. s ⟶ s′. This would make it possible to express ∞ as ¬Fδ. However, this would make the resulting logic too expressive: the two states in the Kripke structure ∘ ⟶ ∘ (with the empty labelling) are branching bisimulation equivalent with explicit divergence, yet they would be distinguished by this extension of CTL_{−X}^{∗}, as only the last state satisfies δ.

CTL_{∞}^{∗} is an extension of CTL_{−X}^{∗}. There is no need for a similar extension of CTL^{∗}, for δ can be expressed as ¬∃X⊤. In particular, CTL_{∞}^{∗} is not more expressive than CTL^{∗}.

The definition of branching bisimulation equivalence with explicit divergence lifts easily to Kripke structures: s \underline{↔}_{b}^{Δ} t, for s and t states in a Kripke structure, iff there exists a consistent and divergence preserving colouring C such that C(s) = C(t). Here divergence preserving is defined as in Section 3; by Lemma 5, this time applied to Kripke structures, a consistent colouring preserves divergence iff, for any states s and t, C(s) = C(t) implies

for any infinite path π from s with C(π) = C(s) there is an infinite path ρ from t with C(ρ) = C(t).

Theorem 8. s \underline{↔}_{b}^{Δ} t iff s ⊧ φ ⇔ t ⊧ φ for all CTL_{∞}^{∗} state formulas φ.

Proof. “Only if” goes as in the proof of Theorem 1, reading ⊧ for ⊧_{db}, requiring C to be consistent and divergence preserving, and, in the second paragraph, requiring the paths π and ρ to be maximal and C(π) to be a complete coloured trace of s and t. Here we use that if a colouring is consistent and divergence preserving, then two states with the same colour must also have the same complete coloured traces. This follows from Lemma 6, this time applied to Kripke structures.

There is one extra case to check. Suppose C(π) = C(ρ) and π ⊧ ∞, but ρ |̸= ∞. Then the last state t of ρ has the same colour C(t) as one of the states s of π. Let π′ be the (infinite) suffix of π starting at s. Then C(π′) = C(s) = C(t), yet there is no infinite path from t, contradicting that C is divergence preserving.

“If” goes as in the proof of Theorem 1, but this time we have also to show that C preserves divergence. So let s and t be states and π an infinite path from s with C(π) = C(s) = C(t) = C. Let

U = {u | there is a path from t to u and C(u) ≠ C}.

For every u∈ U pick a CTL_{∞}^{∗} formula φ_{u} ∈ C − C(u). Now s ⊧ ∃^{∞}G(⋀_{u∈U} φ_{u}) and, as C(s) = C(t), also t ⊧ ∃^{∞}G(⋀_{u∈U} φ_{u}). Thus, there is an infinite path ρ from t such that t′ ⊧ ⋀_{u∈U} φ_{u} for all states t′ in ρ. It follows that t′ ∉ U. Hence C(t′) = C and thus C(ρ) = C. □

7 Adding deadlock detection to CTL_{−X}

CTL_{−X} is the sublogic of CTL_{−X}^{∗} that only allows path formulas of the form φ U φ′ and ¬(φ U φ′), where φ and φ′ are state formulas. Equivalently, it can be defined as only allowing path formulas of the form φ U φ′ and Gφ, for we have

s ⊧ ∃Gφ iff s ⊧ ∃¬(⊤ U ¬φ)

s ⊧ ∃¬(φ U φ′) iff s ⊧ ∃[(¬φ′) U ¬(φ ∨ φ′)] ∨ ∃G¬φ′ .

Theorems 1 and 2 are also valid when using CTL_{−X} instead of CTL_{−X}^{∗}, for their proofs use no other temporal constructs than ∃(φ U φ′) and ∃Gφ.

A natural proposal for CTL_{∞} would be to add the path quantifier ∃^{∞} to CTL_{−X}, thus yielding the syntax

φ ::= p | ¬φ | ⋀ Φ′ | ∃(φ U φ) | ∃^{∞}(φ U φ) | ∃Gφ | ∃^{∞}Gφ .

However, we can economise on that, for

s ⊧ ∃^{∞}(φ U φ′) iff s ⊧ ∃(φ U (φ′ ∧ ∃^{∞}G⊤))

s ⊧ ∃Gφ iff s ⊧ ∃^{∞}Gφ ∨ ∃(φ U (∀Gφ))

where ∀Gφ is an abbreviation for ¬∃(⊤ U ¬φ). Hence CTL_{∞} can be given by the syntax

φ ::= p | ¬φ | ⋀ Φ′ | ∃(φ U φ) | ∃^{∞}Gφ .

It follows immediately from the proof of Theorem 8 that this language is sufficiently expressive to characterise branching bisimulation equivalence with explicit divergence:

Theorem 9. s \underline{↔}_{b}^{Δ} t iff s ⊧ φ ⇔ t ⊧ φ for all CTL_{∞} formulas φ. □

It is tempting to simply write ∃^{∞}G as ∃G; that is, to keep the same syntax as for CTL_{−X} but define its semantics in such a way that ∃(φ U φ′) asks merely for a finite path, whereas ∃Gφ asks for an infinite one. This deadlock sensitive interpretation of CTL_{−X} is an alternative for the interpretation of [3]. It is consistent with the classical interpretation of CTL [5, 2], as for total Kripke structures there is no difference between ∃^{∞} and ∃.

8 The deadlock extension of Kripke structures

Following De Nicola & Vaandrager [3] we have applied CTL_{−X}^{∗} to non-total Kripke structures by using maximal instead of infinite paths in the definition of validity. As remarked in Section 2, the same effect can be obtained by transforming a non-total Kripke structure into a total one by adding a self loop s⟶s to every deadlock state s, and applying the standard CTL_{−X}^{∗} semantics to the resulting total Kripke structure. However, the latter does not apply to CTL_{∞}^{∗}, because the self loop s ⟶ s invalidates the formula ∃¬∞ that holds in any deadlock state s. Here we define another transformation on Kripke structures that makes any Kripke structure total, and allows encoding of CTL_{∞}^{∗} in terms of CTL_{−X}^{∗}.

Definition 9. The deadlock extension D(K) of a Kripke structure K is obtained by the addition of a fresh state s_{δ}, labelled by the fresh atomic proposition δ, together with a transition from s_{δ} and from every deadlock state in K to s_{δ}.

An example of this transformation is depicted in Figure 5.

[figure: K :; p; q; r; D(K) :; p; q; r; s_{δ}; δ]

Fig. 5. Deadlock extension of a Kripke structure

Theorem 10. Let K be a Kripke structure, with states s and t. Then s \underline{↔}_{b}^{Δ} t within the Kripke structure K iff s \underline{↔}_{b}^{Δ} t within the Kripke structure D(K).

Proof. “If”: Let D be a consistent and divergence preserving colouring on D(K). Note that D(s_{δ}) ≠ D(s) for any state s ≠ s_{δ} in D(K). Let C be the restriction of D to the states of K. Then the C-coloured traces of a state s in K equal the Dcoloured traces of s in D(K), but with the colour D(s_{δ}) omitted from the end of such traces. It follows that C is consistent. It preserves divergence by Lemma 5.

“Only if”: Let C be a consistent and divergence preserving colouring on K. Extend it to a colouring D on D(K) by assigning a fresh colour δ to the extra state s_{δ} of D(K). It suffices to check that D is consistent and divergence preserving.

Claim. From any state s in K with the same colour as a deadlock state t in K there must be a path π to a deadlock state such that C(π) = C(t).

Proof of claim. As t has no C-coloured traces of length two, neither does s, and as t has no divergent C-coloured traces, neither does s. Thus, all paths from s are finite and only pass through states with colour C(t).

Application of the claim. The D-coloured traces of length two of a state s ≠ s_{δ} in D(K) are the C-coloured traces of length two of the state s in K, together with the trace C(t)δ in case s has the same colour as a deadlock state t in K. Thus D is consistent by Lemma 1, and preserves divergence by Lemma 5. □

The “if”-direction of the theorem, with a similar proof, also applies to ≈_{s} and ≈_{dbs}, but the “only if”-direction does not. As a counterexample, let K be a Kripke structure with a deadlock state d (having no outgoing transitions) and a livelock state l (with a self-loop as its only one outgoing transition); neither state satisfies any atomic propositions. In K we have d ≈_{s} l, and hence d ≈_{dbs} l, but in D(K) we have d ≉_{dbs} l, and hence d ≉_{s} l.

Considering that Kripke structures of the form D(K) are total, and that on total Kripke structures ≈_{s} and \underline{↔}_{b}^{Δ} coincide, it is in fact impossible to define a transformation like D for which Theorem 10 holds for both \underline{↔}_{b}^{Δ} and ≈_{s}.

Now let η be an arbitrary LTS-to-L^{2}TS-transformation, yielding an LTS-to-Kripke-structure transformation that is also called η (see Section 4). Then D ∘ η is not a valid LTS-to-Kripke-structure transformation as intended in [3], for it fails to preserve \underline{↔}_{b}^{λ} / ≈_{s} and \underline{↔}_{b} / ≈_{dbs} (cf. Definition 6). Yet, it satisfies

s \underline{↔}_{b}^{Δ} t ⇔ D ∘ η(s) ≈_{s} D ∘ η(t)

(because s \underline{↔}_{b}^{Δ} t ⇔ η(s) \underline{↔}_{b}^{Δ} η(t) ⇔ D ∘η(s) \underline{↔}_{b}^{Δ} D ∘η(t) and on total Kripke structures \underline{↔}_{b}^{Δ} and ≈_{s} coincide), and as such it is a suitable transformation for defining validity of CTL_{−X}^{∗} formula on states in LTSs. We obtain:

Corollary 2. Let s and t be states in an LTS, and let η be an LTS-to-L^{2}TS transformation. Then

s \underline{↔}_{b}^{Δ} t iff s ⊧^{D∘η} φ ⇔ t ⊧^{D∘η} φ for all CTL_{−X}^{∗} state formulas φ. □

Thus, one way to make CTL_{−X}^{∗} suitable for dealing with deadlock behaviour on LTSs is to stick to total Kripke structures and translate LTSs to Kripke structures by a translation D ∘η instead of a transformation η as proposed in [3]. This way branching bisimulation equivalence with explicit divergence becomes the natural counterpart of stuttering equivalence on Kripke structures, and we have the modal characterisation of Corollary 2.

An alternative is to stick to more natural transformations η meeting the criteria on Definition 6, apply the definition of validity of CTL_{−X}^{∗} formulas to non-total Kripke structures as in [3], and extend CTL_{−X}^{∗} to CTL_{∞}^{∗} as indicated in Section 6.

Below we show that these solutions lead to equally expressive logics on LTSs.

Definition 10. Given a set of atomic propositions, let CTL_{δ}^{∗} be the logic CTL_{−X}^{∗} extended with an extra atomic proposition δ. The mappings 𝒟 from CTL_{∞}^{∗} to CTL_{δ}^{∗} formula and ℰ from CTL_{∞}^{∗} to CTL_{δ}^{∗} formula are defined inductively by

\begin{matrix}𝒟 (p) = & p & ℰ (p) = & p \\ 𝒟 (¬φ) = & ¬δ ∧ ¬𝒟 (φ) & ℰ(¬φ) = & ¬ℰ(φ) \\ 𝒟 (⋀_{i∈I} φ_{i}) = & ⋀_{i∈I} 𝒟 (φ_{i}) & ℰ(⋀_{i∈I} φ_{i}) = & ⋀_{i∈I} ℰ(φ_{i}) \\ 𝒟 (∃ψ) = & ∃𝒟 (ψ) & ℰ(∃ψ) = & ∃ℰ(ψ) \\ 𝒟 (¬ψ) = & ¬δ ∧ ¬𝒟 (ψ) & ℰ(¬ψ) = & ¬ℰ(ψ) \\ 𝒟 (⋀_{i∈I} ψ_{i}) = & ⋀_{i∈I} 𝒟 (ψ_{i}) & ℰ(⋀_{i∈I} ψ_{i}) = & ⋀_{i∈I} ℰ(ψ_{i}) \\ 𝒟 (ψ U ψ′) = & 𝒟 (ψ) U 𝒟 (ψ′) & ℰ(ψ U ψ′) = & (ℰ(ψ) U δ_{ψ}′) ∨ (ℰ(ψ) U ℰ(ψ′)) \\ 𝒟 (∞) = & ¬Fδ & ℰ(δ) = & ¬⊤. \end{matrix}

Here δ_{ψ}′ = \{ \begin{matrix}δ if s_{δ} ⊧ ∃ψ′ \\ ¬⊤ otherwise \end{matrix} , and ψ U δ abbreviates ¬∞ ∧ Gψ.

Theorem 11. Let K be a Kripke structure and s a state in K. Then for any CTL_{∞}^{∗} state formula φ we have s ⊧ φ in K iff s ⊧ 𝒟 (φ) in D(K), and for any CTL_{δ}^{∗} state formula φ we have s ⊧ φ in D(K) iff s ⊧ ℰ(φ) in K.

Proof. For a state formula φ, let [[φ]]_{K} denote the set of states s in K with s ⊧ φ. Likewise, for a path formula ψ, [[ψ]]_{K} denotes the set of maximal paths π in K with π ⊧ φ. Note that there is a bijective correspondence between the maximal paths in K and those in D(K) not starting in s_{δ}. A straightforward structural induction shows that [[φ]]_{K} = [[𝒟 (φ)]]_{D(K)} for any CTL_{∞}^{∗} state formula φ and, up to the aforementioned bijective correspondence, [[ψ]]_{K} = [[𝒟 (ψ)]]_{D(K)} for any CTL_{∞}^{∗} path formula ψ.

For the second statement, let π_{δ} be the unique path in D(K) starting in s_{δ}. A straightforward structural induction shows that [[φ]]_{D(K)} − {s_{δ}} = [[ℰ(φ)]]_{K} for any CTL_{δ}^{∗} state formula φ and, up to the above bijective correspondence, [[ψ]]_{D(K)} − {π_{δ}} = [[ℰ(ψ)]]_{K} for any CTL_{δ}^{∗} path formula ψ. □

In CTL_{∞}^{∗} the path modality ∞ is equally expressive as the path modality ψ Uδ of Definition 10, saying of a path that it is finite and all its suffixes satisfy ψ. This is because π ⊧ ψ Uδ ⇔ π ⊧ ¬∞∧Gψ and π ⊧ ∞ ⇔ π ⊧ ¬Fδ ⇔ π ⊧ ¬⊤Uδ. In this light, the encoding 𝒟 of CTL_{∞}^{∗} into CTL_{δ}^{∗} merely adds a conjunct ¬δ here and there. These conjuncts are not optional; they enable, for instance, the correct translation of the CTL_{∞}^{∗} path formula Gp by the CTL_{δ}^{∗} formula ¬δ ∧ G(δ ∨ p).

Theorem 12. Also the logics CTL_{δ} and CTL_{∞} are equally expressive.

Proof. This follows because 𝒟 can be restricted to a mapping from CTL_{∞} to CTL_{δ} formula and ℰ to a mapping from CTL_{∞} to CTL_{δ} formula. In particular,

𝒟 (∃(φ U φ′)) = ∃(𝒟 (φ) U 𝒟 (φ′))  𝒟 (∃G^{∞}φ) = ∃G(¬δ ∧ 𝒟 (φ))

ℰ(∃(φ U φ′)) = \{ \begin{matrix}∃(ℰ(φ) U ℰ(φ′)) ∨ ∃(ℰ(φ) U (¬∃^{∞}G⊤ ∧ ∃Gℰ(φ))) & if s_{δ} ⊧ φ′ \\ ∃(ℰ(φ) U ℰ(φ′)) & otherwise \end{matrix}

and  ℰ(∃Gφ) = \{ \begin{matrix}∃G^{∞}ℰ(φ) & if s_{δ} ⊧ φ′ \\ ∃G ℰ(φ) & otherwise. \end{matrix}  □

9 Concluding remark: linear lemporal logic

Linear Temporal Logic [11] (LTL) is the sublogic of CTL^{∗} that allows propositional variables p ∈ AP but no other state formulas to be used as path formulas. Path formulas are applied to states by an implicit universal quantification: s ⊧ π iff s ⊧ ∀π. Kaivola & Valmari [9] study equivalences on LTSs with the property that under all plausible transformations of LTSs into Kripke structures two equivalent states (transformed into states of Kripke structures) satisfy the same formulas in either LTL_{−X} (LTL without the next state modality) or LTL^{∞} (LTL_{−X} augmented with an operator that is equally expressive as our modality ∞). They characterise the coarsest such congruences for a selection of standard process algebra operators—including the merge—as NDFD-equivalence (for LTL_{−X}) and CFFD-equivalence (for LTL^{∞}). There are two striking differences with the branching time case: Whereas \underline{↔}_{b}^{Δ}, the equivalence characterising validity in CTL_{∞}, is a congruence for the selected process algebra operators directly, in the case of LTL^{∞} the resulting equivalence becomes much finer as a result of congruence closure. Furthermore, the addition of ∞ to LTL_{−X} leads to distinctions that are not made by CFFD-equivalence. Kaivola & Valmari do not consider the question of raising the expressiveness of LTL_{−X} to the level where it characterises NDFD- or CFFD-equivalence directly.

References

1. L. Aceto, W.J. Fokkink & C. Verhoef (2001): Structural operational semantics. In J.A. Bergstra, A. Ponse & S.A. Smolka, editors: Handbook of Process Algebra, Elsevier, pp. 197-292.

2. M.C. Browne, E.M. Clarke & O. Grumberg (1988): Characterizing finite Kripke structures in propositional temporal logic. Theoretical Computer Science 59, pp. 115–131.

3. R. De Nicola & F.W. Vaandrager (1995): Three logics for branching bisimulation. Journal of the ACM 42(2), pp. 458–487.

4. E.A. Emerson & E.M. Clarke (1982): Using branching time temporal logic to synthesize synchronization skeletons. Science of Computer Programming 2(3), pp. 241–266.

5. E.A. Emerson & J.Y. Halpern (1986): ‘Sometimes’ and ‘Not Never’ revisited: on branching time versus linear time temporal logic. Journal of the ACM 33(1), pp. 151–178.

6. R.J. van Glabbeek (1993): The linear time - branching time spectrum II. In E. Best, editor: Proceedings of CONCUR’93, LNCS 715, Springer, pp. 66–81.

7. R.J. van Glabbeek (2005): A characterisation of weak bisimulation congruence. In A. Middeldorp, V. van Oostrom, F. van Raamsdonk & R. de Vrijer, editors: Processes, Terms and Cycles: Steps on the Road to Infinity: Essays Dedicated to Jan Willem Klop on the Occasion of His 60th Birthday, LNCS 3838, Springer, pp. 26–39.

8. R.J. van Glabbeek & W.P. Weijland (1996): Branching time and abstraction in bisimulation semantics. Journal of the ACM 43(3), pp. 555–600.

9. R. Kaivola & A. Valmari (1992): The weakest compositional semantic equivalence preserving Nexttime-less Linear Temporal Logic. In W.R. Cleaveland, editor: Proceedings of CONCUR’02, LNCS 630, pp. 207–221.

10. R. Milner (1989): Communication and Concurrency. Prentice Hall, Englewood Cliffs.

11. A. Pnueli (1977): The Temporal Logic of Programs. In: Proceedings of FOCS’77, IEEE Computer Society Press, pp. 46-57.