A Theory of Regular MSC Languages

Jesper G. Henriksen^{1}

BRICS, Computer Science Department, Aarhus University, Aarhus, Denmark^{2}

Madhavan Mukund ∗

Chennai Mathematical Institute, Chennai, India

K. Narayan Kumar

Chennai Mathematical Institute, Chennai, India

Milind Sohoni

Indian Institute of Technology Bombay, Mumbai, India

P. S. Thiagarajan^{3}

National University of Singapore, Singapore

Abstract

Message Sequence Charts (MSCs) are an attractive visual formalism widely used to capture system requirements during the early design stages in domains such as telecommunication software. It is fruitful to have mechanisms for specifying and reasoning about collections of MSCs so that errors can be detected even at the requirements level. We propose, accordingly, a notion of regularity for collections of MSCs and explore its basic properties. In particular, we provide an automata-theoretic characterization of regular MSC languages in terms of finite-state distributed automata called bounded message-passing automata. These automata consist of a set of sequential processes that communicate with each other by sending and receiving messages over bounded FIFO channels. We also provide a logical characterization in terms of a natural monadic second-order logic interpreted over MSCs.

A commonly used technique to generate a collection of MSCs is to use a Hierarchical Message Sequence Chart (HMSC). We show that the class of languages arising from the so-called bounded HMSCs constitute a proper subclass of the class of regular MSC languages. In fact, we characterize the bounded HMSC languages as the subclass of regular MSC languages that are finitely generated.

Key words: Message sequence charts, Message-passing systems, Regularity, Realizability, Synthesis, Monadic second-order logic

Preprint submitted to Information and Computation 14 November 2003

1 Introduction

Message sequence charts (MSCs) are an appealing visual formalism often used to capture system requirements in the early stages of design. They are particularly suited for describing scenarios for distributed telecommunication software [19,31]. They also appear in the literature as sequence diagrams, message flow diagrams and object interaction diagrams and are used in a number of software engineering notational frameworks such SDL [31] and UML [7,14]. In its basic form, an MSC depicts the exchange of messages between the processes of a distributed system along a single partially-ordered execution. A collection of MSCs is used to capture the scenarios that a designer might want the system to exhibit (or avoid).

Given the requirements in the form of a collection of MSCs, one can hope to do formal analysis and discover errors at the early stages of design. One question that naturally arises in this context is: What constitutes a reasonable collection of MSCs on which one can hope to do formal analysis? A related issue is how one should go about representing such collections.

In this paper, we propose regular collections of MSCs as the candidate for representing reasonable collections and present a variety of results in support of our proposal. We also present a number of representations of regular MSC collections and establish a strong connection to a standard way of representing MSC collections, namely, Hierarchical MSCs [25]. Preliminary versions of these results appeared in [17,18,26] where the notion of regular MSC languages and the related automata model were introduced.

Our notion of regularity has been guided by a number of concerns. The primary

∗ Corresponding Author. Address: Chennai Mathematical Institute, 92 G. N. Chetty Road, Chennai 600017, India. Fax: +91-44-28157671.

Email addresses: gulmann@brics.dk (Jesper G. Henriksen),

madhavan@cmi.ac.in (Madhavan Mukund), kumar@cmi.ac.in

(K. Narayan Kumar), sohoni@cse.iitb.ac.in (Milind Sohoni),

thiagu@comp.nus.edu.sg (P. S. Thiagarajan).

1 Present address: Airport Division, DSE A/S, Sverigesvej 19, DK-8700 Horsens, Denmark. E-mail: jgh@dse.dk 2 BRICS: Basic Research in Computer Science (www.brics.dk), funded by the Danish National Research Foundation. 3 This work was partially supported by the NUS-SOC-ARF grant R-252-000-103-112.

one has been finite-state realizability. In other words, a good starting point for capturing the notion of a reasonable collection of MSCs is to demand that the behaviors denoted by the collection should be, as a whole, realizable by some finite-state device. A closely related concern is to synthesize systematically an executable specification—say in the form of an automaton—from a set of requirements as a regular collection of MSCs.

A standard way to generate a set of MSCs is to use a Hierarchical (or Highlevel) Message Sequence Chart (HMSC) [25]. An HMSC is a finite directed graph in which each node is itself labeled by an HMSC. The HMSCs that appear as the labels of the vertices may not refer to each other. Message Sequence Graphs (MSGs) are HMSCs in which each node is labeled by just an MSC (and not an HMSC). An MSG defines a collection of MSCs by concatenating the MSCs labeling each path from an initial vertex to a terminal vertex. Though HMSCs provide more succinct specifications than MSGs, they are only as expressive as MSGs. Thus, one often studies HMSCs in terms of MSGs [2,28,30].

In [2], Alur and Yannakakis investigate the restricted class of bounded (or locally synchronized) HMSCs. They show that the collection of MSCs generated by a bounded HMSC can be represented as a regular string language. As a result, the behaviors captured by a bounded HMSCs can be, in principle, realized as a finite-state automaton. It is easy to see that not every HMSC-definable collection of MSCs is realizable in this sense.

The main goal of this paper is to pin down this notion of realizability in terms of a notion of regularity for collections of MSCs and explore its basic properties. One consequence of our study is that our definition of regularity provides a general and robust setting for studying collections of MSCs which admits a number of different, but equivalent, representations. An important consequence is that our notion leads to a state-based representation that is one step closer to an implementation than the description in terms of MSCs. Stated differently, our work also addresses the issue, raised in [10], of converting inter-process descriptions at the level of requirements, as specified by MSCs, into intra-process executable specifications in terms of a reasonable model of computation.

Yet another motivation for focusing on regularity is that the classical notion of a regular collection of objects has turned out to be very fruitful in a variety of settings including finite (and infinite) strings, trees and restricted partial orders known as Mazurkiewicz traces [11,35,36]. In all these settings there is a representation of regular collections in terms of finite-state devices. There is also an accompanying monadic second-order logic that usually induces temporal logics using which one can reason about such collections [35]. One can then develop automated model-checking procedures for verifying properties specified in these temporal logics. In this context, the associated finite-state devices representing the regular collections often play a very useful role [37]. We show here that our notion of regular MSC languages fits in nicely with a related notion of a finite-state device, as also a monadic second-order logic.

In our study, we fix a finite set of processes P and consider M, the universe of MSCs that the set P gives rise to. An MSC in M can be viewed as a labeled partial order in which the labels come from a finite alphabet Σ that is canonically fixed by P. Our proposal for L ⊆ M to be regular is that the collection of all linearizations of all members of L should together constitute a regular subset of Σ^{∗}. A crucial point is that, due to the communication mechanism of MSCs, the universe M itself is not a regular collection. This is in stark contrast to settings involving strings, trees or Mazurkiewicz traces. Futhermore, this distinction has a strong bearing on the automata-theoretic and logical formulations in our work. It turns out that regular MSC languages can be stratified using the concept of bounds. An MSC is said to be B-bounded if during any run of the MSC and at any stage in the run and for every pair of processes (p, q) there are at most B messages sent from p to q that have yet to be received by q. A language of MSCs is B-bounded if every member of the language is B-bounded. It turns out that every regular MSC language is B-bounded for some B. This leads to our automaton model called B-bounded messagepassing automata. The components of such an automaton correspond to the processes in P. The components communicate with each other over (potentially unbounded) FIFO channels. We say that a message-passing automaton is B-bounded if, during its operation, a channel never contains more than B messages. We establish a precise correspondence between B-bounded messagepassing automata and B-bounded regular MSC languages. In a similar vein, we formulate a natural monadic second-order logic MSO(P, B) interpreted over B-bounded MSCs. We then show that B-bounded regular MSC languages are exactly those that are definable in MSO(P, B).

We also characterize exactly the regular MSC languages that can be represented by MSGs. In general, the MSC language defined by an MSG is not regular. Conversely, it turns out that there are regular MSC languages that can not be represented by an MSG. We show that the crucial link here is that of an MSC language being finitely generated. We prove that a regular MSC language can be represented by an MSG iff the language is finitely generated. As a by-product of this result we also show that a regular MSC language can be represented by an MSG iff it can be represented by a locally synchronized MSG.

As for related work, a number of studies are available that are concerned with individual MSCs in terms of their semantics and properties [1,21]. As pointed out earlier, a nice way to generate a collection of MSCs is to use an MSG. A variety of algorithms have been developed for MSGs in the literature—for instance, pattern matching [22,28,30] and detection of process divergence and non-local choice [5]. A systematic account of the various model-checking problems associated with MSGs and their complexities is given in [2]. The problem of model-checking MSGs with respect to formulas in Monadic Second-Order logic (MSO) is shown to be decidable in [23]. Note that the class of regular MSC languages and the class of MSG definable languages are incomparable. This decidability result has been extended to a generalization of MSGs called CMSGs (standing for Compositional MSGs) in [24]. The class of languages definable by CMSGs includes the class defined by MSGs as well as the class of regular MSC languages. The model-checking problem with respect to MSO is shown to be decidable for some infinite-state subclasses of HMSCs in [13]. For such subclasses the authors also show that equivalent communicating finitestate automata can be synthesised.

Recently, a new notion called weak realizability has been introduced in [3,4]. In this work, the target automata are message-passing automata (as we use them in this paper) with local rather than global accepting states. In the setting of Mazurkiewicz traces it is known that distributed automata with global acceptance conditions are strictly stronger than those with local acceptance conditions [38]. Trace languages accepted by automata with local accepting states are called product languages and are well-understood [33]. It would be interesting to extend the work of [3,4] to develop a corresponding theory of product MSC languages.

In this paper we confine our attention to finite MSCs and further we assume that each channel exhibits FIFO behaviour. As the recent results of [20,6] bear out, our results and techniques serve as a good launching pad for a similar account concerning infinite MSCs as well as to settings where messages may be delivered out of order.

The paper is structured as follows. In the next section we introduce MSCs and regular MSC languages. In Section 3 we establish our automata-theoretic characterization and, in Section 4, the logical characterization. While doing so, we borrow a couple of proof techniques from the theory of Mazurkiewicz traces [11]. However, we need to modify these techniques in a non-trivial way (especially in the setting of automata) due to the asymmetric flow of information via messages in the MSC setting, as opposed to the symmetric information flow via handshake communication in the trace setting.

We define Message Sequence Graphs in Section 5. We survey the existing body of theory for this class of labeled graphs and bring out the notion of locally synchronized MSGs. In Section 6 we define finitely generated languages and provide an effective procedure to decide whether a regular MSC language is finitely generated. Following this, we establish our characterization result for regular MSC languages that are MSG-representable.

2 Regular MSC Languages

Our study of regular MSC languages will focus on the most basic kind of MSCs—those that model communication through message-passing via reliable FIFOs. We ignore the actual content of the messages exchanged by the processes as well as internal events. Our aim is to clearly bring out the basic issues in the theory with as little clutter as possible. The theory that we develop will go through—with considerable notational overhead—in the presence of additional features such as handshake communication, non-FIFO channels, hierarchically structured states etc.

Let P = {p, q, r, …} be a finite set of processes (agents) that communicate with each other through messages via reliable FIFO channels. For each p ∈ P we define Σ_{p} =^{def} {p!q | p ≠ q} ∪ {p?q | p ≠ q} to be the set of communication actions in which p participates. The action p!q is to be read as p sends to q and the action p?q is to be read as p receives from q. As mentioned above, at our level of abstraction, we shall not be concerned with the actual messages that are sent and received and we will also not deal with the internal actions of the agents. We set Σ_{P} = ⋃_{p∈P} Σ_{p} and let a, b range over Σ_{P}. We also denote the set of channels by Ch = {(p, q) | p ≠ q} and let c, d range over Ch. Whenever the set of processes P is clear from the context, we will often write Σ instead of Σ_{P} etc.

Labelled posets A Σ-labelled poset is a structure M = (E, ≤, λ) where (E, ≤) is a poset and λ : E → Σ is a labelling function. For e ∈ E we define

↓e =^{def} {e′ | e′ ≤ e}. For p ∈ P and a ∈ Σ, we set E_{p} =^{def} {e | λ(e) ∈ Σ_{p}} and

E_{a} =^{def} {e | λ(e) = a}, respectively. For each (p, q) ∈ Ch, we define the relation <_{pq} as follows:

e <_{pq} e′ ⟺ λ(e) = p!q, λ(e′) = q?p and |↓e ∩ E_{p!q}| = |↓e′ ∩ E_{q?p}|

Since messages are assumed to be read in FIFO fashion, e <_{pq} e′ implies that the message read by q at the receive event e′ is the one sent by p at the send event e. Finally, for each p ∈ P, we define the relation ≤_{pp} =^{def} (E_{p} × E_{p}) ∩ ≤, with <_{pp} standing for the largest irreflexive subset of ≤_{pp}.

Definition 2.1 An MSC (over P) is a finite Σ-labelled poset M = (E, ≤, λ) that satisfies the following conditions^{4} :

(1) Each relation ≤_{pp} is a linear order.

4 Our definition captures the standard partial-order semantics associated with MSCs in, for instance, [1,31].

[figure: (p); (q); (r); •; e_{1}; •; e_{2}; •; e′_{2}; •; e_{3}; •; e′_{1}; •; e′_{3}]

Fig. 1. An MSC over {p, q, r}.

(2) If p ≠ q then |E_{p!q}| = |E_{q?p}|.

(3) The partial order ≤ is the reflexive, transitive closure of the relation ⋃_{p,q∈P} <_{pq}.

□

In diagrams, the events of an MSC are presented in visual order. The events of each process are arranged in a vertical line and the members of the relation <_{pq} are displayed as horizontal or downward-sloping directed edges from the vertical line corresponding to p to the vertical line corresponding to q. We illustrate the idea with an example, depicted in Figure 1. Here P = {p, q, r}. For x ∈ P, the events in E_{x} are arranged along the line labelled (x) with earlier (relative to ≤) events appearing above later events. For any two processes p, q, the <_{pq}-edges are depicted by horizontal edges—for instance e_{3} <_{rq} e′_{2}. The labelling function λ is easy to extract from the diagram—for example, λ(e′_{3}) = r!p and λ(e_{2}) = q?p.

MSC languages Henceforth, we will identify an MSC with its isomorphism class. We let M_{P} be the set of MSCs over P. An MSC language is a subset L ⊆ M_{P}. As before, we shall often omit P and denote M_{P} by M.

We shall define regular MSC languages in terms of their linearizations. For an MSC M = (E, ≤, λ), we let lin(M) =^{def} {λ(π) | π is a linearization of (E, ≤)}. By abuse of notation, we have used λ to also denote the natural extension of λ to E^{∗}. For an MSC language L ⊆ M, we set lin(L) = ⋃{lin(M) | M ∈ L}. In this sense, the string p!q r!q q?p q?r r!p p?r is one linearization of the MSC in Figure 1.

In the literature (e.g. [1,29,30]) one sometimes considers a more generous notion of linearization where two adjacent receive actions in a process corresponding to messages from different senders are deemed causally independent. For instance, p!q r!q q?r q?p r!p p?r would also be a valid linearization of the MSC in Figure 1. This is called the causal order of the MSC (as opposed to the visual order). Our results go through with suitable modifications even in the presence of this more generous notion of linearization.

Proper and complete words The notions of proper and complete words will be very useful for relating MSCs to their linearizations. For a word w and a letter a, we let #_{a}(w) denote the number of times a appears in w. We say that σ ∈ Σ^{∗} is proper if for every prefix τ of σ and every pair p, q of processes #_{p!q}(τ) ≥ #_{q?p}(τ). We say that σ is complete if σ is proper and #_{p!q}(σ) = #_{q?p}(σ) for every pair p, q of processes.

An independence relation on complete words Next we define a contextsensitive independence relation I ⊆ Σ^{∗} × (Σ × Σ) as follows. (σ, a, b) ∈ I iff the following conditions are satisfied :

• σab is proper

• a ∈ Σ_{p} and b ∈ Σ_{q} for distinct processes p and q

• a = p!q and b = q?p implies #_{a}(σ) > #_{b}(σ).

We note that if (σ, a, b) ∈ I then (σ, b, a) ∈ I.

We now set Σ^{∘} = {σ | σ ∈ Σ^{∗} and σ is complete}. Next we define ∼ ⊆ Σ^{∘} ×Σ^{∘} to be the least equivalence relation such that if σ = σ_{1}abσ_{2}, σ′ = σ_{1}baσ_{2} and (σ_{1}, a, b) ∈ I then σ ∼ σ′. For a complete word σ, we let [σ]_{∼} denote the equivalence class of σ with respect to ∼. It is important to note that ∼ is defined over Σ^{∘} and not Σ^{∗}. It is easy to verify that for each M ∈ M, lin(M) is a subset of Σ^{∘} and is in fact a ∼-equivalence class over Σ^{∘}.

String MSC languages

We define L ⊆ Σ^{∗} to be a string MSC language if there exists an MSC language L ⊆ M such that L = lin(L). It is easy to see that L ⊆ Σ^{∗} is a string MSC language iff every string in L is complete and L is ∼-closed ; that is, if σ ∈ L and σ ∼ σ′ then σ′ ∈ L.

Just as a Mazurkiewicz trace can be identified with its linearizations [11], we can identify each MSC with its linearizations. To formalize this, we construct representation maps sm : Σ^{∘}/∼ → M and ms : M → Σ^{∘}/∼ and argue that these maps are “inverses” of each other.

From linearizations to MSCs … Let σ ∈ Σ^{∘}. Then sm(σ) = (E_{σ}, ≤, λ) where

• E_{σ} = {τa | τa ∈ prf(σ)}, where prf(σ) is the set of prefixes of σ. In other words, E_{σ} = prf(σ) − {ε}.

• ≤ = (R_{P} ∪ R_{Ch})^{∗} where R_{P} = ⋃_{p∈P} R_{p} and R_{Ch} = ⋃_{p,q∈P} R_{pq}. The constituent relations are defined as follows. For each p ∈ P, (τa, τ′b) ∈ R_{p} iff a, b ∈ Σ_{p} and τa ∈ prf(τ′b). Further, for each p, q ∈ P, (τa, τ′b) ∈ R_{pq} iff a = p!q and b = q?p for some p, q ∈ P and in addition, #_{a}(τa) = #_{b}(τ′b).

• For τa ∈ E, λ(τa) = a.

It is easy to see that sm(σ) is an MSC with <_{pp}= R_{p} and <_{pq}= R_{pq}. One can show that σ ∼ σ′ implies sm(σ) = sm(σ′). We can thus extend sm to a map sm′ : Σ^{∘}/∼ → M given by sm′([σ]_{∼}) = sm(σ). Henceforth, we shall write sm to denote both sm and sm′.

… and back Conversely, we define the map ms : M → Σ^{∘}/∼ by ms(M) = lin(M). It is easy to show that ms is well-defined. We can also show that for every σ ∈ Σ^{∘}, ms(sm(σ)) = [σ]_{∼} and for every M ∈ M, sm(ms(M)) = M. Thus Σ^{∘}/∼ and M are two equivalent ways of representing the same class of objects. Hence, abusing terminology, we will often write “MSC language” to mean “string MSC language”. From the context, it should be clear whether we are working with labelled partial orders from M or complete strings over Σ^{∗}. A good rule of thumb is that L will denote the former and L will denote the latter.

We can now finally define our notion of a regular collection of MSCs.

Definition 2.2 L ⊆ M is a regular MSC language iff lin(L) is a regular subset of Σ^{∗}. □

Note that, unlike many standard settings (strings, trees or Mazurkiewicz traces), the universe M is itself not regular according to our definition because Σ^{∘} is not a regular subset of Σ^{∗}. This fact has a strong bearing on the automata-theoretic and logical formulations of regular MSC languages as will become apparent in the later sections.

We now observe that there is an effective (and finitary) presentation of regular MSC languages.

Proposition 2.3 It is decidable whether a regular subset L ⊆ Σ^{∗} is a regular MSC language.

Proof:

Let A = (S, Σ, s_{in}, δ, F) be the minimal DFA representing L. We say that a state s of A is live if there is a path from s to a final state. It is not difficult to see that L is a regular MSC language iff we can associate with each live state s ∈ S, a channel-capacity function K_{s} : Ch → ℕ that satisfies the following conditions.

(1) If s ∈ {s_{in}} ∪ F then K_{s}(c) = 0 for every c ∈ Ch.

(2) If s, s′ are live states and δ(s, p!q) = s′ then K_{s′}((p, q)) = K_{s}((p, q))+1 and K_{s′}(c) = K_{s}(c) for every c ≠ (p, q).

(3) If s, s′ are live states and δ(s, q?p) = s′ then K_{s}((p, q)) > 0, K_{s′}((p, q)) = K_{s}((p, q))−1 and K_{s′}(c) = K_{s}(c) for every c ≠ (p, q).

(4) Suppose δ(s, a) = s_{1} and δ(s_{1}, b) = s_{2} with a ∈ Σ_{p} and b ∈ Σ_{q}, p ≠ q. If it is not the case that a = p!q and b = q?p, or it is the case that K_{s}((p, q)) > 0, there exists s′_{1} such that δ(s, b) = s′_{1} and δ(s′_{1}, a) = s_{2}.

□

Clearly the conditions enumerated in the proof can be checked in time linear in the size of the next state function δ.

We also point out that Item (4) in the proof above has useful consequences. By abuse of notation, let δ(s_{in}, u) denote the (unique) state reached by A on reading an input word u. Suppose u is a proper word and a, b are communication actions such that (u, a, b) belongs to the context-sensitive independence relation defined earlier. Then, due to Item (4), δ(s_{in}, uab) = δ(s_{in}, uba). From this, we can conclude that if v, w are complete words such that v ∼ w, then δ(s_{in}, v) = δ(s_{in}, w).

We conclude this section by introducing the notion of B-bounded MSC languages. Let B ∈ ℕ be a natural number. We say that a proper word σ is weakly B-bounded if for each prefix τ of σ and for each channel (p, q) ∈ Ch, #_{p!q}(τ) − #_{q?p}(τ) ≤ B. We say that L ⊆ Σ^{∘} is weakly B-bounded if every word σ ∈ L is weakly B-bounded.

Next we say the proper word σ is B-bounded if every w′ with w ∼ w′ is weakly B-bounded.

Turning now to MSCs, we shall say that the MSC M is B-bounded if every string in lin(M) is weakly B-bounded. Since lin(M) is an ∼-equivalence class, this is the same as saying that every string in lin(M) is in fact B-bounded. Finally, a collection of MSCs is B-bounded if every member of the collection is B-bounded.

Proposition 2.4 Let L be a regular MSC language. There is a bound B ∈ ℕ such that L is B-bounded.

Proof Sketch: From the proof of Proposition 2.3, it follows that every regular MSC language L is weakly B_{L}-bounded where the bound B_{L} is the largest value attained by the capacity functions attached to the live states in the minimal DFA for L. Since MSC languages are ∼-closed, it then follows that L is in fact B_{L}-bounded. □

3 An Automata-Theoretic Characterization

In what follows we assume the terminology and notation developed in the previous section. Recall that the set of processes P determines the communication alphabet Σ and that for p ∈ P, Σ_{p} denotes the actions that process p participates in.

Definition 3.1 A message-passing automaton over Σ is a structure A = ({A_{p}}_{p∈P}, Δ, s_{in}, F) where:

• Δ is a finite alphabet of messages.

• Each component A_{p} is of the form (S_{p}, ⟶_{p}) where · S_{p} is a finite set of p-local states. · ⟶_{p} ⊆ S_{p} × Σ_{p} × Δ × S_{p} is the p-local transition relation.

• s_{in} ∈ ∏_{p∈P} S_{p} is the global initial state.

• F ⊆ ∏_{p∈P} S_{p} is the set of global final states.

□

The local transition relation ⟶_{p} specifies how the process p sends and receives messages. The transition (s, p!q, m, s′) specifies that when p is in the state s, it can send the message m to q (by executing the communication action p!q) and go to the state s′. The message m is, as a result, appended to the queue of messages in the channel (p, q). Similarly, the transition (s, p?q, m, s′) signifies that at the state s, the process p can receive the message m from q by executing the action p?q and go to the state s′. The message m is removed from the head of the queue of messages in the channel (q, p).

We say that A is deterministic if the local transition relation ⟶_{p} for each component A_{p} satisfies the following conditions:

• (s, p!q, m_{1}, s′_{1}) ∈ ⟶_{p} and (s, p!q, m_{2}, s′_{2}) ∈ ⟶_{p} imply m_{1} = m_{2} and s′_{1} = s′_{2}.

• (s, p?q, m, s′_{1}) ∈ ⟶_{p} and (s, p?q, m, s′_{2}) ∈ ⟶_{p} imply s′_{1} = s′_{2}.

In other words, determinacy requires that the nature of the message sent from p to q depends only on the local state of the sender p. Note, however, that from the same state, p may have the possibility of sending messages to more than one process. When receiving a message, the new state of the receiving process is fixed uniquely by its current local state and the content of the message.

Once again, a process may be willing to receive messages from more than one process in a given state.

The set of global states of A is given by ∏_{p∈P} S_{p}. For a global state s, we let s_{p} denote the pth component of s. A configuration is a pair (s, χ) where s is a global state and χ : Ch → Δ^{∗} is the channel state that specifies the queue of messages currently residing in each channel c. The initial configuration of A is (s_{in}, χ_{ε}) where χ_{ε}(c) is the empty string ε for every channel c. The set of final configurations of A is F × {χ_{ε}}.

We now define the set of reachable configurations Conf_{A} and the global transition relation ⟹ ⊆ Conf_{A} × Σ × Conf_{A} inductively as follows:

• (s_{in}, χ_{ε}) ∈ Conf_{A}.

• Suppose (s, χ) ∈ Conf_{A}, (s′, χ′) is a configuration and (s_{p}, p!q, m, s′_{p}) ∈ ⟶_{p} such that the following conditions are satisfied: · r ≠ p implies s_{r} = s′_{r} for each r ∈ P. · χ′((p, q)) = χ((p, q)) · m and for c ≠ (p, q), χ′(c) = χ(c).

Then (s, χ) ⟹^{p!q} (s′, χ′) and (s′, χ′) ∈ Conf_{A}.

• Suppose (s, χ) ∈ Conf_{A}, (s′, χ′) is a configuration and (s_{p}, p?q, m, s′_{p}) ∈ ⟶_{p} such that the following conditions are satisfied: · r ≠ p implies s_{r} = s′_{r} for each r ∈ P. · χ((q, p)) = m · χ′((q, p)) and for c ≠ (q, p), χ′(c) = χ(c).

Then (s, χ) ⟹^{p?q} (s′, χ′) and (s′, χ′) ∈ Conf_{A}.

Let σ ∈ Σ^{∗}. A run of A over σ is a map ρ : prf(σ) → Conf_{A} such that ρ(ε) = (s_{in}, χ_{ε}) and for each τa ∈ prf(σ), ρ(τ) ⟹^{a} ρ(τa). The run ρ is accepting if ρ(σ) is a final configuration. Note that a deterministic automaton has at most one run on any σ ∈ Σ^{∗}.

We define L(A) =^{def} {σ | A has an accepting run over σ}. It is easy to see that every member of L(A) is complete and L(A) is ∼-closed in the sense that if σ ∈ L(A) and σ ∼ σ′ then σ′ ∈ L(A). Consequently, L(A) can be viewed as an MSC language.

Unfortunately, L(A) need not be regular. Consider, for instance, a messagepassing automaton for the canonical producer-consumer system in which the producer p sends an arbitrary number of messages to the consumer q. Since we can reorder all the p!q actions to be performed before all the q?p actions, the queue in channel (p, q) can grow arbitrarily long. Hence, the set of reachable configurations of this system is not bounded and the corresponding language is not regular.

For B ∈ ℕ, we say that a configuration (s, χ) of the message-passing automaton A is B-bounded if for every channel c ∈ Ch, it is the case that |χ(c)| ≤ B.

[figure: (p) :; s_{1}; p!q; ⟹; (q) :; t_{1}; q!p; q?p; ⟹; s_{2}; p!q; t_{2}; q?p; t_{3}; s_{3}; p?q]

Fig. 2. A 3-bounded message-passing automaton.

[figure: (p); (q); •; p!q; •; q!p; i; •; p!q; •; q?p; i; •; p?q; •; q!p; •; p!q; •; q?p; •; p?q; •; q?p; { ; |; } ; |]

Fig. 3. The M_{i}’s accepted by the automaton in Figure 2.

We say that A is a B-bounded automaton if every reachable configuration (s, χ) ∈ Conf_{A} is B-bounded. It is not difficult to show that given a messagepassing automaton A and a bound B ∈ ℕ, one can decide whether or not A is B-bounded. Figure 2 depicts an example of a 3-bounded message-passing automaton with two components, p and q. The initial state is (s_{1}, t_{1}) and there is only one final state, (s_{2}, t_{3}). (The message alphabet is a singleton and hence omitted.) The automaton accepts the infinite set of MSCs L = {M_{i}}_{i∈ℕ}, where M_{2} is displayed in Figure 3.

This automaton accepts an infinite set of MSCs, none of which can be expressed as the concatenation of two or more non-trivial MSCs. As a result, this MSC language cannot be represented using MSGs, as formulated in [2]. We will return to this point in Section 6.

The following result follows from the definitions. It constitutes the easy half of the characterization we wish to obtain.

Proposition 3.2 Let A be a B-bounded message-passing automaton over Σ. Then L(A) is a B-bounded regular MSC language.

[figure: (p); (q); (r); •; e_{1}; •; e_{2}; •; e_{3}; •; e_{4}; •; e_{5}; •; e_{6}; •; e_{7}; •; e_{9}; •; e_{8}; •; e_{10}; •; e_{11}; •; e_{12}] Fig. 4.

The second half of our characterization says that every B-bounded regular MSC language can be recognized by a B-bounded message-passing automaton. This is much harder to establish.

Let L ⊆ Σ^{∗} be a regular MSC language. As observed at the end of Section 2, the minimum DFA A_{L} for L yields a bound B such that L is B-bounded.

Our strategy to prove this result is as follows. For a regular MSC language L, we consider the minimum DFA A_{L} for L. We construct a message-passing automaton A that simulates the behaviour of A_{L} on each complete word σ ∈ Σ^{∗}. The catch is that no single component of A is guaranteed to see all of σ. The partial information about σ that is available at each process can be formalized using ideals.

Ideals (prefixes) Let σ ∈ Σ^{∗} be proper. A set of events I ⊆ E_{σ} is called an (order) ideal if I is closed with respect to ≤—that is, e ∈ I and f ≤ e implies f ∈ I as well.

Ideals constitute consistent prefixes of σ—notice that any linearization of an ideal forms a proper communication sequence.

p-views For an ideal I, the ≤-maximum p-event in I is denoted max_{p}(I), provided #_{I}(Σ_{p}) > 0. The p-view of I, ∂_{p}(I), is the ideal ↓max_{p}(I). Thus, ∂_{p}(I) consists of all events in I that p can “see”. (By convention, if max_{p}(I) is undefined—that is, if there is no p-event in I—the p-view ∂_{p}(I) is empty.)

For P ⊆ P, we use ∂_{P} (I) to denote ⋃_{p∈P} ∂_{p}(I).

Consider the MSC in Figure 4. The set of events {e_{1}, e_{2}, e_{3}, e_{4}, e_{5}, e_{6}, e_{9}} form an ideal while the events {e_{1}, e_{2}, e_{3}, e_{4}, e_{5}, e_{7}} do not.

Let I be the ideal {e_{1}, e_{2}, e_{3}, e_{4}, e_{5}, e_{6}, e_{7}, e_{8}, e_{9}, e_{10}}. The p-view of I is ↓e_{8} = {e_{1}, e_{2}, e_{3}, e_{4}, e_{5}, e_{6}, e_{7}, e_{8}}. The q-view of I is ↓e_{9} = {e_{1}, e_{2}, e_{3}, e_{4}, e_{5}, e_{6}, e_{9}}. The joint {p, q}-view of I is {e_{1}, e_{2}, e_{3}, e_{4}, e_{5}, e_{6}, e_{7}, e_{8}, e_{9}}.

As we mentioned earlier, our strategy is to construct a message-passing automaton A that simulates the behaviour of the minimum DFA for L, A_{L} = (S, Σ, s_{in}, δ, F), on each complete communication sequence σ. In other words, after reading σ, the components in A must be able to decide whether δ(s_{in}, σ) ∈ F. However, after reading σ each component A_{p} in A only “knows about” those events from E_{σ} that lie in the p-view ∂_{p}(E_{σ}). We have to devise a scheme to recover the state δ(s_{in}, σ) from the partial information available with each process after reading σ.

Another complication is that processes can only maintain a bounded amount of information as part of their state. We need a way of representing arbitrary words in a bounded, finite way. This can be done by recording for each word σ, its “effect” as dictated by the minimum automaton A_{L}. We associate with each word σ a function f_{σ} : S → S, where S is the set of states of A_{L}, such that f_{σ}(s) = δ(s, σ). The following observations follow from the fact that A_{L} is a DFA recognizing L.

Proposition 3.3 Let σ, ρ ∈ Σ^{∗}. Then:

(1) δ(s_{in}, σ) = f_{σ}(s_{in}).

(2) f_{σρ} = f_{ρ} ∘ f_{σ}, where ∘ denotes function composition.

Clearly the function f_{σ} : S → S corresponding to a word σ has a bounded representation. For an input σ, if the components in A could jointly compute the function f_{σ} they would be able to determine whether δ(s_{in}, σ) ∈ F —by part (i) of the preceding proposition, δ(s_{in}, σ) = f_{σ}(s_{in}). As the following result demonstrates, for any input σ, it suffices to compute f_{ρ} for some linearization ρ of the MSC sm(σ).

Proposition 3.4 For complete sequences σ, ρ ∈ Σ^{∗}, if σ ∼ ρ then f_{σ} = f_{ρ}.

Proof: Follows from the structural properties of A_{L} described in Section 2. □

Before proceeding, we need a convention for representing the subsequence of communication actions generated by a subset of the events in an MSC.

Partial computations Let σ = a_{1}a_{2} … a_{n} be proper and let X ⊆ E_{σ} be given by {a_{1} … a_{i_{1}}, a_{1} … a_{i_{2}}, …, a_{1} … a_{i_{k}}}, where i_{1} < i_{2} < ⋯ < i_{k}. When we call X a partial computation, we mean that X should be identified with the induced labelled partial order (E_{X}, ≤, λ) obtained by restricting E_{σ} to X. We denote by σ[X] the set of linearizations of (E_{X}, ≤, λ).

Observe that the linearizations of a partial computation are not, in general, proper words. Thus, if v and w are two linearizations of the same partial computation, it is quite likely that f_{v} and f_{w} are not the same function.

The following fact, analogous to standard results in Mazurkiewicz trace theory, will be used several times in our construction. We omit the proof.

Lemma 3.5 Let σ be proper and let I, J ⊆ E_{σ} be ideals such that I ⊆ J. Then σ[J] ⊇ σ[I]σ[J \ I].

Corollary 3.6 Let σ be a word and I_{1} ⊆ I_{2} ⊆ ⋯ ⊆ I_{k} ⊆ E_{σ} be a sequence of nested ideals. Then σ[I_{k}] ⊇ σ[I_{1}]σ[I_{2} \ I_{1}] ⋯ σ[I_{k} \ I_{k−1}].

3.1 Residues and decomposition

Returning to our problem of simulating the DFA A_{L} by a message-passing automaton, let P consist of m processes {p_{1}, p_{2}, …, p_{m}}. Consider a complete word σ. We wish to compute f_{ρ} for some ρ ∼ σ. Suppose we construct a chain of subsets of processes ∅ = Q_{0} ⊂ Q_{1} ⊂ Q_{2} ⊂ ⋯ ⊂ Q_{m} = P such that for j ∈ {1, 2, …, m}, Q_{j} = Q_{j−1} ∪ {p_{j}}. From Corollary 3.6, we then have

\begin{aligned}[σ]_{∼} & = & σ[∂_{Q_{m}}(E_{σ})] \\ & ⊇ & σ[∂_{Q_{0}}(E_{σ})]σ[∂_{Q_{1}}(E_{σ}) \ ∂_{Q_{0}}(E_{σ})] ⋯ σ[∂_{Q_{m}}(E_{σ}) \ ∂_{Q_{m−1}}(E_{σ})] \end{aligned}

Observe that ∂_{Q_{j}}(E_{σ}) \ ∂_{Q_{j−1}}(E_{σ}) is the same as ∂_{p_{j}}(E_{σ}) \ ∂_{Q_{j−1}}(E_{σ}). Thus, we can rewrite the expression above as

\begin{matrix}[σ]_{∼} & = & σ[∂_{Q_{m}}(E_{σ})] \\ & ⊇ & σ[∅]σ[∂_{p_{1}}(E_{σ}) \ ∂_{Q_{0}}(E_{σ})] ⋯ σ[∂_{p_{m}}(E_{σ}) \ ∂_{Q_{m−1}}(E_{σ})] \end{matrix} (♢)

Let us examine (♢) more closely. For each i ∈ [1..m], let w_{i} be a linearization of the partial computation ∂_{p_{i}}(E_{σ}) \ ∂_{Q_{i−1}}(E_{σ}). The expression (♢) then tells us that σ ∼ w_{1}w_{2} … w_{m}.

Recall that different linearizations of a partial computation may give rise to different transition functions. However, (♢) tells us that we need not keep track of all linearizations of the partial computations ∂_{p_{i}}(E_{σ}) \ ∂_{Q_{i−1}}(E_{σ}).

Suppose that each process p_{i}, i ∈ [1..m], locally computes the function f_{w_{i}} corresponding to any one linearization w_{i} of the partial computation {∂_{p_{i}}(E_{σ}) \ ∂_{Q_{i−1}}(E_{σ})}. Then, from the global state at the end of the run, we can reconstruct f_{σ} by composing f_{w_{m}} ∘ f_{w_{m−1}} ∘ ⋯ ∘ f_{w_{1}} to get f_{w_{1}w_{2}...w_{m}} = f_{σ}. We can thus mark a global state as accepting if the composite function f_{σ} that it generates is such that f_{σ}(s_{in}) ∈ F.

In order to achieve this, each process p_{j} must inductively maintain information about the partial computation ∂_{p_{j}}(E_{σ}) \ ∂_{Q_{j−1}}(E_{σ}). This partial computation represents the portion of σ that p_{j} has seen but the processes in Q_{j−1} have not seen. This is a special case of what we call a residue.

Residues Let σ be proper, I ⊆ E_{σ} an ideal and p ∈ P a process. R(σ, p, I) denotes the set ∂_{p}(E_{σ}) \ I and is called the residue of σ at p with respect to I. Observe that any residue of the form R(σ, p, I) can equivalently be written R(σ, p, ∂_{p}(E_{σ}) ∩ I). Notice that a residue can be thought of as the induced labelled partial order defined by the events that it contains.

A residue of R(σ, p, I) is a process residue if R(σ, p, I) = R(σ, p, ∂_{P} (E_{σ})) for some P ⊆ P. We say that R(σ, p, ∂_{P} (E_{σ})) is the P -residue of σ at p.

Note that ∂_{p_{j}}(E_{σ}) \ ∂_{Q_{j−1}}(E_{σ}) is a process residue. The expression (♢) seems to suggest that each process should try and maintain information about linearizations of process residues locally. Unfortunately, a process residue at p may change due to an action of another process. For instance, if the word σ is extended by an action a = q?p, it is clear that R(σ, p, ∂_{q}(E_{σ})) will not be the same as R(σa, p, ∂_{q}(E_{σa})) since q will get to know about more events from ∂_{p}(σ) after receiving the message via the action a. On the other hand, since p does not move on an action of the form q?p, p has no chance to update its q-residue when the action q?p occurs.

Returning to the MSC in Figure 4, consider the proper word σ = p!q p!r r?p r!q q?r q!p p?q p!q q?p corresponding to the (partial) linearization e_{1}e_{2}e_{3}e_{4}e_{5}e_{6}e_{7}e_{8}e_{9}. Let I denote the ideal corresponding to σ. Let J be the ideal {e_{1}, e_{2}, e_{3}, e_{4}, e_{5}}. The residue R(σ, p, J) = {e_{6}, e_{7}, e_{8}}. This is not a process residue. The qresidue of σ at p, R(σ, q, ∂_{q}(I)), is given by {e_{7}, e_{8}}. The r-residue of σ at p, R(σ, p, ∂_{r}(I)), is given by {e_{5}, e_{6}, e_{7}, e_{8}}. However if we extend σ to σ′ = σ r?p generating the ideal I′ = I ∪ {e_{10}}, we find that R(σ′, p, ∂_{r}(I′)) = ∅.

To get around this problem, each process will have to maintain residues in terms of local information that changes only when it moves. This information is called the primary information of a process. Maintaining and updating primary information requires a bounded time-stamping protocol, described in [27]. We now summarize the essential aspects of this protocol and then describe how to use it to fix the problem of maintaining process residues locally.

3.2 Bounded time-stamps

Recall that for a complete word σ, sm(σ) = (E_{σ}, ≤, λ) is the associated partial order defined on page 8. The map σ can be extended in a natural way to words that are proper but not complete. For such a proper word σ, the structure (E_{σ}, ≤, λ) corresponds to an “incomplete” MSC in which some messages that have been sent have not yet been received. In fact, the resulting structure will be an ideal. In this sense, the correspondence between MSCs and complete words expressed by the maps sm and ms extends to a correspondence between ideals and proper words.

For the rest of this section, for any proper word σ, we implicitly use E_{σ} to denote the set of events associated with sm(σ).

Latest information Let I ⊆ E_{σ} be an ideal and p, q ∈ P. Then latest(I) denotes the set of events {max_{p}(I) | p ∈ P}. For p ∈ P, we let latest_{p}(I) denote the set latest(∂_{p}(I)). A typical event in latest_{p}(I) is of the form max_{q}(∂_{p}(I)) and denotes the ≤-maximum q-event in ∂_{p}(I). This is the latest q-event in I that p knows about. For convenience, we denote this event latest_{p←q}(I). (If there is no q-event in ∂_{p}(I), the quantity latest_{p←q}(I) is undefined.)

It is clear that for q ≠ p, latest_{p←q}(I) will always correspond to a send action from Σ_{q}. However latest_{p←q}(I) need not be of the form q!p; the latest information that p has about q in I may have been obtained indirectly.

Message acknowledgments Let I ⊆ E_{σ} be an ideal and e ∈ I an event of the form p!q. Then, e is said to have been acknowledged in I if the corresponding receive event f such that e <_{pq} f belongs to ∂_{p}(I). Otherwise, e is said to be unacknowledged in I.

Notice that it is not enough for a message to have been received in I to deem it to be acknowledged. We demand that the event corresponding to the receipt of the message be “visible” to the sending process.

For an ideal I and a pair of processes p, q, let unack_{p→q}(I) be the set of unacknowledged p!q events in I. The following proposition characterizes Bboundedness via the number of unacknowledged messages:

Consider the MSC in Figure 4. Let I be the ideal {e_{1}, e_{2}, e_{3}, e_{4}, e_{5}, e_{6}, e_{7}, e_{8}, e_{9}, e_{10}}. Then, latest_{p←q}(I) = e_{6}. Notice that latest_{q←p}(I) = e_{2}. This information about p comes to q via r and is more current than the direct message from p to q sent at e_{1} that arrives at e_{9}.

In I, the message sent by p at e_{2} is acknowledged (at e_{7}) while the message sent by p at e_{1} is belongs to unack_{p→q}(I), though it has been received by q at e_{9} within I.

Proposition 3.7 Let σ ∈ Σ^{∗} be proper and let sm(σ) = (E_{σ}, ≤, λ). Then σ is B-bounded, for B ∈ ℕ, if and only if, for every pair of processes p, q and for every ideal I ⊆ E_{σ}, unack_{p→q}(I) contains at most B events.

During the course of a B-bounded computation, none of the message buffers ever contains more than B undelivered messages, regardless of how the events are sequentialized. Thus, if each component A_{p} of a message-passing automaton is able to keep track of the sets {unack_{p→q}(E_{σ})}_{q∈P} for each word σ, this information can be used to inhibit sending messages along channels that are potentially saturated and thus enforce B-boundedness. This would provide a mechanism for constraining an arbitrary message-passing automaton to be B-bounded.

Primary information Let I ⊆ E_{σ} be an ideal. The primary information of I, primary(I), consists of the following events in I:

• The set latest(I) = {max_{p}(I) | p ∈ P}.

• The collection of sets unack(I) = {unack_{p→q}(I) | p, q ∈ P}.

For p ∈ P, we denote primary(∂_{p}(I)) by primary_{p}(I). Thus, primary_{p}(I) reflects the primary information of p in I. Observe that for B-bounded computations, the number of events in primary(I) is bounded.

In [27], a protocol is presented for processes to keep track of their primary information during the course of an arbitrary computation. This protocol involves appending a bounded amount of information to each message in the underlying computation, provided the computation is B-bounded. To ensure that the message overhead is bounded, the processes use a distributed time-stamping mechanism that consistently assigns “names” to events using a bounded set of labels.

Consistent time-stamping Let Γ be a finite set of labels. For a proper communication sequence σ, we say that τ : E_{σ} → Γ is a consistent timestamping of E_{σ} by Γ if for each pair of (not necessarily distinct) processes p, q and for each ideal I the following holds: if e_{p} ∈ primary_{p}(I), e_{q} ∈ primary_{q}(I) and τ(e_{p}) = τ(e_{q}) then e_{p} = e_{q}.

In the MSC shown in Figure 4, let I denote the entire collection of events {e_{1}, e_{2}, …, e_{12}}. Here, primary_{p}(I) = {e_{8}, e_{6}, e_{4}}, primary_{q}(I) = {e_{8}, e_{12}, e_{11}} and primary_{r}(I) = {e_{8}, e_{6}, e_{11}}. Thus, a consistent time-stamping is one that uses distinct labels for the events {e_{6}, e_{8}, e_{11}} that span the primary information of more than one process in I. Normally, a consistent time-stamping would actually use distinct labels for all events that constitute primary information, namely {e_{4}, e_{6}, e_{8}, e_{11}, e_{12}}. Since {e_{1}, e_{2}} are both send events that do not appear in the primary information of any process, a consistent timestamping may assign both these events the same label as each other or, indeed, the same label as a third event.

In the protocol of [27], whenever a process p sends a message to q, it first assigns a time-stamp to the new message from a finite set of labels. Process p then appends its primary information to the message being sent. Notice that the current send event will form part of the primary information since it is the latest p-event in ∂_{p}(E_{σ}). When q receives the message, it can consistently update its primary information to reflect the new information received from p.

The two tricky points in the protocol are for p to decide when it is safe to reuse a time-stamp, and for q to decide whether the information received from p is really new. In order to solve these problems, the protocol of [27] requires processes to also maintain additional time-stamps, corresponding to secondary information. Though we do not need the details of how the protocol works, we will need to refer to secondary information in the proof of our theorem.

Secondary information Let I be an ideal. The secondary information of I is the collection of sets primary(↓e) for each event e in primary(I). This collection of sets is denoted secondary(I). As usual, for p ∈ P, secondary_{p}(I) denotes the set secondary(∂_{p}(I)).

In the MSC shown in Figure 4, let I denote the entire collection of events {e_{1}, e_{2}, …, e_{12}}. Since primary_{p}(I) = {e_{8}, e_{6}, e_{4}}, secondary_{p}(I) = primary(↓e_{8})∪ primary(↓e_{6}) ∪ primary(↓e_{4}) = {e_{8}, e_{6}, e_{4}} ∪ {e_{2}, e_{6}, e_{4}} ∪ {e_{2}, e_{4}}.

In our framework, the protocol of [27] can now be described as follows.

Theorem 3.8 For any B ∈ ℕ, we can fix a set Γ of labels of size O(B ×|P|^{2}) and construct a deterministic B-bounded message-passing automaton A^{B} = ({A_{p}^{B}}_{p∈P}, Δ^{B}, s_{in}^{B}, F^{B}) such that for every B-bounded proper communication sequence σ, A^{B} inductively generates a consistent time-stamping τ : E_{σ} → Γ. Moreover, for each component A_{p}^{B} of A^{B}, the local state of A_{p}^{B} at the end of σ records the information primary_{p}(E_{σ}) and secondary_{p}(E_{σ}) in terms of the time-stamps assigned by τ.

Actually, we need a more general version of this result, corresponding to maintaining consistent timestamps upto an arbitrary depth.

k-ary information Let I be an ideal. The k-ary information of I, k-ary(I) is inductively defined as follows:

• 1-ary(I) = primary(I).

• For k > 1, k-ary(I) is the collection of sets primary(↓e) for each event e in (k−1)-ary(I).

As usual, for p ∈ P, k-ary_{p}(I) denotes the set k-ary(∂_{p}(I)).

We can now extend the notion of a consistent time-stamping to arbitrary levels.

k-consistent time-stamping Let Γ be a finite set of labels and k ∈ ℕ. For a proper communication sequence σ, we say that τ : E_{σ} → Γ is a k-consistent time-stamping of E_{σ} by Γ if for each pair of (not necessarily distinct) processes p, q and for each ideal I the following holds: if e_{p} ∈ k-ary_{p}(I), e_{q} ∈ k-ary_{q}(I) and τ(e_{p}) = τ(e_{q}) then e_{p} = e_{q}.

In the MSC shown in Figure 4, let I denote the entire collection of events {e_{1}, e_{2}, …, e_{12}}. The event e_{2} is not a primary event but does lie within secondary_{p}(I). Thus, a 2-consistent time-stamping would have to assign a distinct label to e_{2}, whereas a 1-consistent time-stamping can safely reuse the label assigned to e_{2} within I.

The generalized version of Theorem 3.8 that we need is the following.

Theorem 3.9 For any B, k ∈ ℕ, we can fix a set Γ of labels of size O(B × |P|^{k+1}) and construct a deterministic B-bounded message-passing automaton A^{B} = ({A_{p}^{B}}_{p∈P}, Δ^{B}, s_{in}^{B}, F^{B}) such that for every B-bounded proper communication sequence σ, A^{B} inductively generates a k-consistent time-stamping τ : E_{σ} → Γ. Moreover, for each component A_{p}^{B} of A^{B}, the local state of A_{p}^{B} at the end of σ records the information k-ary_{p}(E_{σ}) in terms of the time-stamps assigned by τ.

3.3 Process and primary residues

With this background on primary information, we return to our problem of keeping track of residues. Recall that for a proper word σ, an ideal I ⊆ E_{σ} and a process p, the residue R(σ, p, I) denotes the set ∂_{p}(E_{σ}) \ I. A residue R(σ, p, I) is a process residue for P ⊆ P if I = ∂_{P} (E_{σ}). The goal is to maintain information about process residues locally at each process p, but the problem is that these residues may change even when p does not move, thereby making it impossible for p to directly represent this information.

However, it turns out that each process can maintain a set of residues based on its primary information such that these primary residues subsume the process residues. The key technical fact that makes this possible is the following.

Lemma 3.10 For any non-empty ideal I, and p, q ∈ P, the maximal events in ∂_{p}(I) ∩ ∂_{q}(I) lie in primary_{p}(I) ∩ primary_{q}(I).

Proof: We show that for each maximal event e in ∂_{p}(I) ∩ ∂_{q}(I), either e ∈ latest(∂_{p}(I)) ∩ unack(∂_{q}(I)) or e ∈ unack(∂_{p}(I)) ∩ latest(∂_{q}(I)).

First suppose that ∂_{p}(I)\∂_{q}(I) and ∂_{q}(I)\∂_{p}(I) are both nonempty. Let e be a maximal event in ∂_{p}(I) ∩ ∂_{q}(I). Suppose e is an r-event, for some r ∈ P. Since ∂_{p}(I) \ ∂_{q}(I) and ∂_{q}(I) \ ∂_{p}(I) are both nonempty, it follows that r ∉ {p, q}. The event e must have ≤-successors in both ∂_{p}(I) and ∂_{q}(I). However, observe that any event f can have at most two immediate ≤-successors—one “internal” successor within the process and, if f is a send event, one “external” successor corresponding to the matching receive event.

Thus, the maximal event e must be a send event, with a <_{rr} successor e_{r} and a <_{rs} successor e_{s}, corresponding to some s ∈ P. Assume that e_{r} ∈ ∂_{q}(I) \ ∂_{p}(I) and e_{s} ∈ ∂_{p}(I) \ ∂_{q}(I). Since the r-successor of e is outside ∂_{p}(I), e = max_{r}(∂_{p}(I)). So e belongs to latest(∂_{p}(I)). On the other hand, e is an unacknowledged r!s-event in ∂_{q}(I). Thus, e ∈ unack_{r→s}(∂_{q}(I)), which is part of unack(∂_{q}(I)).

Symmetrically, if e_{r} ∈ ∂_{p}(I) \ ∂_{q}(I) and e_{s} ∈ ∂_{q}(I) \ ∂_{p}(I), we find that e belongs to unack(∂_{p}(I)) ∩ latest(∂_{q}(I)).

We still have to consider the case when ∂_{p}(I) ⊆ ∂_{q}(I) or ∂_{q}(I) ⊆ ∂_{p}(I). Suppose that ∂_{p}(I) ⊆ ∂_{q}(I), so that ∂_{p}(I)∩∂_{q}(I) = ∂_{p}(I). Let e = max_{p}(∂_{q}(I)). Clearly, ∂_{p}(I) = ↓e and the only maximal event in ∂_{p}(I) is the p-event e. Since e has a successor in ∂_{q}(I), e must be a send event and is hence in unack(∂_{p}(I)). Thus, e ∈ unack(∂_{p}(I)) ∩ latest(∂_{q}(I)). Symmetrically, if ∂_{q}(I) ⊆ ∂_{p}(I), the unique maximal event e in ∂_{q}(I) belongs to latest(∂_{p}(I)) ∩ unack(∂_{q}(I)). □

Let us call R(σ, p, I) a primary residue if I is of the form ↓X for some subset X ⊆ primary_{p}(E_{σ}). Clearly, for p, q ∈ P, R(σ, p, ∂_{q}(E_{σ})), can be rewritten as R(σ, p, ∂_{p}(E_{σ}) ∩ ∂_{q}(E_{σ})). From Lemma 3.10 it follows that the q-residue R(σ, p, ∂_{q}(E_{σ})) is a primary residue R(σ, p, ↓X) for some X ⊆ primary(∂_{p}(E_{σ})). Further, from the Lemma we know that the set X can be effectively computed from the primary information of p and q. In fact, it turns out that all process residues can be effectively described in terms of primary residues.

We begin with a simple observation, whose proof we omit.

Proposition 3.11 Let σ ∈ Σ^{∗} be proper and p ∈ P. For ideals I, J ⊆ E_{σ}, let R(σ, p, I) and R(σ, p, J) be primary residues such that R(σ, p, I) = R(σ, p, ↓X_{I}) and R(σ, p, J) = R(σ, p, ↓X_{J}) for X_{I}, X_{J} ⊆ primary_{p}(E_{σ}). Then R(σ, p, I∪J) is also a primary residue and R(σ, p, I∪J) = R(σ, p, ↓(X_{I} ∪ X_{J})).

Our claim that all process residues can be effectively described in terms of primary residues can then be formulated as follows.

Lemma 3.12 Let σ ∈ Σ^{∗} be proper, p ∈ P and Q ⊆ P. Then R(σ, p, ∂_{Q}(E_{σ})) is a primary residue R(σ, p, ↓X) for p. Further, the set X ⊆ primary_{p}(E_{σ}) can be effectively computed from the information in ⋃_{q∈{p}∪Q} primary_{q}(E_{σ}).

Proof: Let Q = {q_{1}, q_{2}, …, q_{k}}. We can rewrite R(σ, p, ∂_{Q}(E_{σ})) as R(σ, p, ⋃_{i∈[1..k]} ∂_{q_{i}}(E_{σ})). From Lemma 3.10 it follows that for each i ∈ {1, 2, …, k}, p can compute a set X_{i} ⊆ primary_{p}(E_{σ}) from the information in primary_{p}(E_{σ})∪ primary_{q_{i}}(E_{σ}) such that R(σ, p, ∂_{q_{i}}(E_{σ})) = R(σ, p, ↓X_{i}). From Proposition 3.11, it then follows that R(σ, p, ∂_{Q}(E_{σ})) = R(σ, p, ⋃_{i∈{1,2,...,k}} ∂_{q_{i}}(E_{σ})) = R(σ, p, ↓X) where X = ⋃_{i∈{1,2,...,k}} X_{i}. □

3.4 Updating residues

Our strategy for constructing a message passing automaton for the regular MSC language L is to inductively have each process p maintain for each primary residue of the current input σ, the function f_{w} for some linearization w of the residue. Then, using the expression (♢), the processes can jointly compute f_{σ} for the entire input σ.

Initially, at the empty word σ = ε, every primary residue from {R(σ, p, ↓X)}_{p∈P,X⊆primary(∂_{p}(E_{σ}))} is just the empty word ε. So, all primary residues are represented by the identity function Id : {s ↦ s}.

Let σ ∈ Σ^{∗} be a proper word and let a ∈ Σ. Assume inductively that at the end of σ, for each p ∈ P and for every primary residue R(σ, p, ↓X) corresponding to X ⊆ primary(∂_{p}(E_{σ})), p has inductively computed f_{w} for some linearization w of R(σ, p, ↓X). We show how to update these functions for each process p after extending the computation from σ to σa.

Suppose a is of the form p!q and X ⊆ primary_{p}(E_{σa}). Let e_{a} denote the event corresponding to the new action a. If e_{a} ∈ X, then R(σa, p, ↓X) = ε, so we represent the residue by the identity function Id. On the other hand, if e_{a} ∉ X, then X ⊆ primary_{p}(E_{σ}), so we already have a function f_{w} corresponding to some linearization w of the residue R(σ, p, X). Since, every event in R(σ, p, X) is causally below the final a-event in sm(σa), wa is a linearization of R(σa, p, ↓X). Thus, we can extend f_{w} to f_{wa} = f_{a} ∘ f_{w}.

For r ≠ p, the primary residues are unchanged when going from σ to σa. We can thus extend the function f_{w} corresponding to the residue R(σa, p, ↓X) to f_{wa} = f_{a} ∘ f_{w}.

The case where a is of the form p?q is more interesting. As before, the primary residues are unchanged for r ≠ p. We show how to calculate all the new primary residues for p using the information obtained from q. This will use the following result.

Lemma 3.13 Let σ ∈ Σ^{∗} be proper. Let p, q ∈ P and e ∈ E_{σ} such that e ∈ primary_{q}(E_{σ}) but e ∉ ∂_{p}(E_{σ}). Then R(σ, p, ↓e) is a primary residue R(σ, p, ↓X) for p. Further, the set X ⊆ primary_{p}(E_{σ}) can be effectively computed from the information in primary_{p}(E_{σ}) and secondary_{q}(E_{σ}).

Proof: Let e be an r-event, r ∈ P and let J = ∂_{p}(E_{σ}) ∪ ↓e. By construction, max_{p}(J) = max_{p}(E_{σ}). On the other hand, max_{r}(J) = e, since e is an r-event and we assumed that e ∉ ∂_{p}(E_{σ}).

By Lemma 3.10, the maximal events in ∂_{p}(J) ∩ ∂_{r}(J) lie in primary_{p}(J) ∩ primary_{r}(J). Since max_{p}(J) = max_{p}(E_{σ}), primary_{p}(J) = primary_{p}(E_{σ}). On the other hand, primary_{r}(J) = primary(↓e), which is a subset of secondary_{q}(E_{σ}), since e ∈ primary_{q}(E_{σ}).

Thus, the set of maximal events in ∂_{p}(J)∩∂_{r}(J), which is the same as ∂_{p}(E_{σ})∩ ↓e, is contained in primary_{p}(E_{σ}) ∩ primary(↓e). These events are available in primary_{p}(E_{σ}) ∪ secondary_{q}(E_{σ}). □

Suppose that X = {x_{1}, x_{2}, …, x_{k}} ⊆ primary_{p}(E_{ua}).

We first argue that for each x_{i} ∈ X, R(σ, p, ↓x_{i}) is a primary residue R(σ, p, ↓Y_{i}), where Y_{i} ⊆ primary_{p}(E_{σ}). If x_{i} ∈ primary_{p}(E_{σ}), then R(σ, p, ↓x_{i}) is already a primary residue, so we can set Y_{i} = {x_{i}}. If, however, x_{i} ∉ primary_{p}(E_{σ}), then x_{i} must have been contributed from primary_{q}(σ) through the message received at the action a. We have x_{i} ∈ primary_{q}(E_{σ}) but x_{i} ∉ ∂_{p}(E_{σ}). Thus, appealing to Lemma 3.13, we can identify Y_{i} ⊆ primary_{p}(E_{σ}) such that R(σ, p, ↓{x_{i}}) = R(σ, p, ↓Y_{i}).

Since X = ⋃_{i∈{1,2,...,k}} x_{i}, we can appeal to Proposition 3.11 to argue that R(σ, p, ↓X) is the primary residue R(σ, p, ↓Y) where Y = ⋃_{i∈{1,2,...,k}} Y_{i}. We can then set

R(σa, p, ↓X) = R(σ, p, ↓Y) ∪ R(σ, q, ∂_{p}(E_{σ}) ∪ ↓X_{q}) ∪ {e_{a}}

where X_{q} is X ∩ primary_{q}(E_{σ}). Inductively, p maintains f_{w} for some linearization w of R(σ, p, ↓Y) and q communicates f_{w′} for some linearization w′ of R(σ, q, ∂_{p}(E_{σ}) ∪ ↓X_{q}) in the current message to p. By construction, no event in R(σ, p, ↓Y) can be above any event in R(σ, q, ∂_{p}(E_{σ}) ∪ ↓X_{q}) and both these sets of events lie below e_{a}. Thus, w∘w′∘a is a valid linearization of R(σa, p, ↓X) and p can compute the function f_{ww′a} = f_{a} ∘ f_{w′} ∘ f_{w} from the information available to it after σ.

Thus, when each action is performed, the process performing the action can effectively update the functions corresponding to the linearizations of its primary residues using the primary and secondary information available to it.

3.5 A deterministic message-passing automaton for L

Let L be a regular MSC language and let B be the bound derived form the minimum DFA A_{L} for L as described earlier. We now construct a B-bounded message-passing automaton A = ({A_{p}}_{p∈P}, Δ, s_{in}, F) for L.

Recall that A^{B} = ({A_{p}^{B}}_{p∈P}, Δ^{B}, s_{in}^{B}, F^{B}) is the time-stamping automaton for B-bounded computations, where the state of each component records the primary and secondary information of the component in terms of a consistent set of time-stamps.

• The message alphabet of A is the alphabet Δ^{B} used by the time-stamping automaton A^{B}.

• In A, a typical state of a component A_{p} is a pair (s_{B}, s_{R}) where s_{B} is a state drawn from A_{p}^{B} and s_{R} is the collection {f_{w_{X}} : S → S}_{X⊆primary_{p}(E_{σ})} of functions corresponding to one linearization w_{X} for each primary residue X of A_{p} at the end of a word σ.

• The local transition relation ⟶_{p} of each component A_{p} is as follows: · For a of the form p!q, the tuple ((s_{B}, s_{R}), a, m, (s′_{B}, s′_{R})) ∈ ⟶_{p} provided (s_{B}, a, m, s′_{B}) ∈ ⟶_{p}^{B} and the functions in s′_{R} are derived from the functions in s_{R} using the time-stamping information in s_{B}, as described in Section 3.4.

Moreover, according to the primary information in s_{B}, it should be the case that |unack_{p→q}(E_{σ})| < B for the word σ read so far. · For a of the form p?q, the tuple ((s_{B}, s_{R}), a, m, (s′_{B}, s′_{R})) ∈ ⟶_{p} provided (s_{B}, a, m, s′_{B}) ∈ ⟶_{p}^{B} and the functions in s′_{R} are derived from the functions in s_{R} using the time-stamping information in s_{B} and the message m, as described in Section 3.4.

• In the initial state of A, the local state of each component A_{p} is of the form (s_{B,in}^{p}, s_{R,in}^{p}) where s_{B,in}^{p} is the initial state of A_{p}^{B} and s_{R,in}^{p} records each function to be the identity function Id.

• The global state {(s_{B}^{p}, s_{R}^{p})}_{p∈P} belongs to the set F of final states if the functions stored in the global state record that δ(s_{in}, σ) ∈ F for the word σ read so far. (This is achieved by evaluating the expression (♢) in Section 3.1.)

From the analysis of the previous section, it is clear that A accepts precisely the language L. The last clause in the transition relation ⟶_{p} for send actions ensures that A will not admit a run in which unack_{p→q}(E_{σ}) grows beyond B events for any input σ and any pair of processes p, q. This ensures that every reachable configuration of A is B-bounded. Finally, we observe that A is deterministic because the time-stamping automaton A^{B} is deterministic and the update procedure for residues described in Section 3.4 is also deterministic. Thus, we have established the following:

Lemma 3.14 Let L ⊆ Σ^{∗} be a B-bounded regular MSC language. Then there exists a B-bounded message-passing automaton A over Σ such that L(A) = L.

The main result of this section, stated in the following theorem, is an easy consequence of the preceding Lemma combined with Proposition 3.2.

Theorem 3.15 Let L ⊆ Σ^{∗}. Then L is a regular MSC language if and only if there exists a bounded message-passing automaton A over Σ such that L(A) = L.

We conclude by providing an upper bound for the size of A,

Proposition 3.16 Let n be the number of processes in the system, m be the number of states of the minimum DFA A_{L} for L and B the bound computed from the channel-capacity functions of A_{L}. Then, the number of local states of each component A_{p} is at most 2^{(2^{O(Bn^{2})}m log m)}.

Proof: Each process p has to maintain one function from S → S for each subset of its primary events. The number of distinct primary events is bounded by O(Bn^{2})—for any ideal I, there are at most O(n) events in latest_{p}(I) and O(Bn^{2}) events in unack_{p}(I). Thus, p has to maintain at most 2^{O(Bn^{2})} functions from S → S. Since each function from S → S can be written down using m log m bits, the entire state of p can be described using 2^{O(Bn^{2})}m log m bits, whence the result follows. □

4 A Logical Characterization

We formulate a monadic second-order logic that characterizes regular Bbounded MSC languages for each fixed B ∈ ℕ. Thus, our logic will be parameterized by a pair (P, B). For convenience, we fix B ∈ ℕ through the rest of the section. As usual, we assume a supply of individual variables x, y, …, a supply of set variables X, Y, …, and a family of unary predicate symbols {Q_{a}}_{a∈Σ}. The syntax of the logic is then given by:

MSO(P, B) ::= Q_{a}(x) | x ∈ X | x ≤ y | ¬φ | φ_{1} ∨ φ_{2} | (∃x)φ | (∃X)φ.

Thus, the syntax does not reflect any information about the bound B or the structural features of an MSC. These aspects will be dealt with in the semantics. Let M(P, B) be the set of B-bounded MSCs over P. The formulas of our logic are interpreted over the members of M(P, B). Let M = (E, ≤, λ) be an MSC in M(P, B) and I be an interpretation that assigns to each individual variable x a member I(x) in E and to each set variable X a subset I(X) of E. Then M ⊧_{I} φ denotes that M satisfies φ under I. This notion is defined in the expected manner—for instance, M ⊧_{I} Q_{a}(x) if λ(I(x)) = a, M ⊧_{I} x ≤ y if I(x) ≤ I(y) etc. For convenience, we have used ≤ to denote both the predicate symbol in the logic and the corresponding causality relation in the model M.

As usual, φ is a sentence if there are no free occurrences of individual or set variables in φ. With each sentence φ we can associate an MSC language L_{φ} =^{def} {M ∈ M(P, B) | M ⊧ φ}. We say that L ⊆ M(P, B) is MSO(P, B)- definable if there exists a sentence φ such that L_{φ} = L. For convenience, we often use “definable” to mean “MSO(P, B)-definable”. We wish to argue that L ⊆ M(P, B) is definable iff it is a B-bounded regular MSC language. It turns out that the techniques used for proving a similar result in the theory of traces [12] can be suitably modified to derive our result.

Lemma 4.1 Let φ be a sentence in MSO(P, B). Then L_{φ} is a B-bounded regular MSC language.

Proof Sketch: The fact that L_{φ} is B-bounded follows from the semantics and hence we just need to establish regularity. Consider MSO(Σ), the monadic second-order theory of finite strings in Σ^{∗}. This logic has the same syntax as MSO(P, B) except that, to avoid confusion, we will use the predicate symbol ⪯ instead of ≤ and interpret ⪯ as the usual ordering relation over the positions of a structure in Σ^{∗}. Let L = lin(L_{φ}). We exhibit a sentence φ̂ in MSO(Σ) such that L = {σ | σ ⊧ φ̂}. The required conclusion will then follow from Büchi’s theorem [8]. Let {K_{0}, K_{1}, …, K_{n}} be the set {K ∈ ℕ^{Ch} | ∀c ∈ Ch. K(c) ≤ B}. Without loss of generality, assume that K_{0}(c) = 0 for every c ∈ Ch. For K ∈ ℕ^{Ch} and c ∈ Ch, let K^{++c} to be the member of ℕ^{Ch} where K^{++c}(c) = K(c)+1 and K^{++c}(d) = K(d) for all d ≠ c. Similarly, for K ∈ ℕ^{Ch} and c ∈ Ch such that K(c) > 0, K^{−−c} is given by K^{−−c}(c) = K(c) − 1 and K^{−−c}(d) = K(d) for all d ≠ c.

The required sentence φ̂ will be of the form:

(∃X_{K_{0}})(∃X_{K_{1}}) ⋯ (∃X_{K_{n}})(COMP ∧ B-BOUNDED ∧ ||φ||)

where COMP, B-BOUNDED, and ||φ|| are defined as follows. We provide these definitions in textual form to enhance readability. They can be easily converted to formulas in MSO(Σ).

First we define COMP to be the conjunction of the following formulas.

(1) Every position x belongs to exactly one of the sets in {X_{K_{0}}, …, X_{K_{n}}}.

(2) If x is the first position then x ∈ X_{K_{0}}.

(3) If x is the last position then Q_{q?p}(x) for some c = (p, q). Moreover x belongs to X_{K_{m}} such that K_{m}(c) = 1 and K_{m}(d) = 0 for d ≠ c.

(4) If y is the successor of x, Q_{p!q}(x), x ∈ X_{K_{i}} and y ∈ X_{K_{j}}, then K_{j} = K_{i}^{++c}, where c = (p, q).

(5) If y is the successor of x, Q_{q?p}(x), x ∈ X_{K_{i}} and y ∈ X_{K_{j}}, then K_{i}(c) > 0 and K_{j} = K_{i}^{−−c}, where c = (p, q).

The formula ||φ|| is given inductively as follows:

• ||Q_{a}(x)|| =^{def} Q_{a}(x).

• ||x ∈ X|| =^{def} x ∈ X.

• ||¬φ′|| =^{def} ¬||φ′||.

• ||φ_{1} ∨ φ_{2}|| =^{def} ||φ_{1}|| ∨ ||φ_{2}||.

• ||(∃x)φ′|| =^{def} (∃x)||φ′||.

• ||(∃X)φ′|| =^{def} (∃X)||φ′||.

• Finally, ||x ≤ y|| =^{def} x ⊑ y where we shall first define ⊑ in terms of ⊏· and then define ⊏·. This translation is based on the fact that in an MSC M = (E, ≤, λ), ≤ = (⋃_{p,q∈P} <_{pq} ∪ ⋃_{p∈P} ≤_{pp})^{∗}.

The formula x ⊑ y asserts existence of non-empty subsets {p_{1}, p_{2}, …, p_{m}} of processes and {x_{1}, y_{1}, x_{2}, y_{2}, …, x_{m}, y_{m}} of positions such that x = x_{1} and y_{m} = y. Further, x_{i} ⪯ y_{i} and x_{i} and y_{i} are both in Σ_{p_{i}} for 1 ≤ i ≤ m. In addition, y_{i} ⊏· x_{i+1} for 1 ≤ i < m.

The predicate x ⊏· y is given by: x ≺ y and there is a channel c = (p, q) such that Q_{p!q}(x) and Q_{q?p}(y). Further, if x ∈ X_{K_{m}} then there are exactly K_{m}(c) occurrences of the symbol q?p between the positions x and y (and not including y).

The formula B-BOUNDED asserts that the word under consideration is Bbounded. Proposition 3.7 implies that a word w violates B-boundedness if and only if there is a q?p-event that is causally independent of (i.e. incomparable under ⊑ from) at least (B + 1) p!q-events. This can be easily stated in MSO.

It is now straightforward to show that φ̂ has the required property.

□

Lemma 4.2 Let L ⊆ M(P, B) be a regular MSC language. Then L is definable in MSO(P, B).

Let L = lin(L). Then L is a regular (string) MSC language over Σ. Hence by Büchi’s theorem [8] there exists a sentence φ in MSO(Σ) such that L = {σ | σ ⊧ φ}. An important property of φ is that one linearization of an MSC satisfies φ iff all linearizations of the MSC satisfy φ. We then define the sentence φ̂ = ||φ|| in MSO(P, B) inductively such that the language of MSCs defined by φ̂ is precisely L. The key idea here is to define a canonical linearization of MSCs and show that the underlying linear order is expressible in MSO(P, B). As a result, we can look for a formula φ̂ that will say “along the canonical linearization of an MSC, the sentence φ is satisfied”. We present below the main ideas and constructions involved in arriving at φ̂.

Throughout what follows, we fix a strict linear order ≺ ⊆ Σ × Σ. Consider an MSC M = (E, ≤, λ). For e ∈ E, let ↑e = {e′ | e ≤ e′}. For events e, e′ ∈ E, we define e co e′ if e ≰ e′ and e′ ≰ e. For X ⊆ E, let λ(X) = {λ(e) | e ∈ X}. Next, suppose that ∅ ≠ Σ′ ⊆ Σ. Then min(Σ′) is the least element of Σ′ under ≺. Finally, suppose e, e′ ∈ E with e co e′. Then Σ_{ee′} = λ(↑e \ ↑e′).

Let M = (E, ≤, λ) be an MSC. Then the ordering relation ≺ induces the ordering relation ≺_{M} ⊆ E × E given by e ≺_{M} e′ if e < e′ or (e co e′ and min(Σ_{ee′}) ≺ min(Σ_{e′e})).

Claim 4.3 Let M = (E, ≤, λ) be an MSC. Then (E, ≺_{M}) is a strict linear order and ≺_{M} is a linearization of ≤.

Proof: Same as the proof of [34, Lemma 15], which asserts an identical result in the setting of (infinite) Mazurkiewicz traces. □

We next exhibit a formula in MSO(P, B) (for any B ∈ ℕ) that captures the relation ≺_{M} for each B-bounded MSC M. First we define the formula min(z_{1}, z_{2}, a) where z_{1} and z_{2} are individual variables and a ∈ Σ via:

min(z_{1}, z_{2}, a) = (∃z)[\begin{matrix}z_{1} ≤ z ∧ ¬(z_{2} ≤ z) ∧ Q_{a}(z)∧ \\ (∀z′) ((z_{1} ≤ z′ ∧ ¬(z_{2} ≤ z′)) ⇒ Q_{a}(z′) ∨ ⋁_{a≺a′} Q_{a′}(z′))] \end{matrix}

The formula Lex(x, y) is now given by:

Lex(x, y) = (x < y) ∨ (co(x, y) ∧ ⋁_{a≺b} min(x, y, a) ∧ min(y, x, b))

where co(x, y) is an abbreviation for ¬(x ≤ y) ∧ ¬(y ≤ x).

Turning now to the proof of Lemma 4.2, let L = lin(L). Then L is a regular (string) MSC language over Σ. Hence by Büchi’s theorem [8] there exists a sentence φ in MSO(Σ) such that L = {σ | σ ⊧ φ}. We now define the formula φ̂ = ||φ|| in MSO(P, B) inductively as follows:

||Q_{a}(x)|| = Q_{a}(x) and ||x ⪯ y|| = (x ≤ y ∧ y ≤ x) ∨ Lex(x, y)

The remaining clauses are the natural ones. It is now straightforward to verify that L_{φ} = L. The key step in the proof is to show the following: Suppose M ∈ M(P, B) and σ is the linearization of M dictated by ≺_{M}. Then M is a model of φ̂ iff σ is a model of φ. This follows easily by structural induction on φ. The required conclusion can now be derived by exploiting the fact that L is ∼-closed.

Since MSO(Σ) is decidable, it follows that MSO(P, B) is decidable as well. We can now summarize the results characterizing regularity as follows.

Theorem 4.4 Let L ⊆ Σ^{∗}, where Σ is the communication alphabet associated with a set P of processes. Then, the following are equivalent.

(i) L is a regular MSC language. (ii) L is a B-bounded regular MSC language, for some B ∈ ℕ. (iii) There exists a bounded message-passing automaton A such that L(A) =

L. (iv) L is MSO(P, B)-definable, for some B ∈ ℕ.

5 Message Sequence Graphs

The standard method to describe multiple communication scenarios is to generate collections of MSCs by means of Hierarchical Message Sequence Charts (HMSCs). As described in the introduction, to analyze HMSCs, it suffices to

[figure: (p); (q); (r); (s); •; •; •; •; •; •; •; •; M_{1}; M_{2}]

[figure: M_{1}; ⟹; M_{2}]

Fig. 5. An example MSG.

flatten them out to obtain Message Sequence Graphs (MSGs). As a consequence, henceforth we concentrate on MSGs rather than HMSCs.

An MSG allows the protocol designer to write a finite specification that combines MSCs using basic operations such as branching choice, composition and iteration. Such MSGs are finite directed graphs with designated initial and terminal vertices. Each vertex in an MSG is labelled by an MSC. The edges represent the natural operation of MSC concatenation. The collection of MSCs represented by an MSG consists of all those MSCs obtained by tracing a path in the MSG from an initial vertex to a terminal vertex and concatenating the MSCs that are encountered along the path.

Formally, the (asynchronous) concatenation of MSCs is defined as follows. Let M_{1} = (E_{1}, ≤_{1}, λ_{1}) and M_{2} = (E_{2}, ≤_{2}, λ_{2}) be a pair of MSCs such that E_{1} and E_{2} are disjoint. The (asynchronous) concatenation of M_{1} and M_{2} yields the MSC M_{1} ∘ M_{2} = (E, ≤, λ) where E = E_{1} ∪ E_{2}, λ(e) = λ_{i}(e) if e ∈ E_{i}, i ∈ {1, 2}, and ≤ = (⋃_{p,q∈P} <_{pq})^{∗}, where <_{pp}=<_{pp}^{1} ∪ <_{pp}^{2} ∪{(e_{1}, e_{2}) | e_{1} ∈ E_{1}, e_{2} ∈ E_{2}, λ(e_{1}) ∈ Σ_{p}, λ(e_{2}) ∈ Σ_{p}} and for (p, q) ∈ Ch, <_{pq}=<_{pq}^{1} ∪ <_{pq}^{2}.

We can now formally define MSGs. A Message Sequence Graph (MSG) is a structure G = (Q, ⟶, Q_{in}, F, Φ), where:

• Q is a finite and nonempty set of states.

• ⟶ ⊆ Q × Q.

• Q_{in} ⊆ Q is a set of initial states.

• F ⊆ Q is a set of final states.

• Φ : Q → M is a (state-)labelling function.

A path π through an MSG G is a sequence q_{0}⟶q_{1}⟶ ⋯ ⟶q_{n} such that (q_{i−1}, q_{i}) ∈ ⟶ for i ∈ {1, 2, …, n}. The MSC generated by π is M(π) =^{def} M_{0} ∘ M_{1} ∘ M_{2} ∘ ⋯ ∘ M_{n}, where M_{i} = Φ(q_{i}). A path π = q_{0}⟶q_{1}⟶ ⋯ ⟶q_{n} is a run if q_{0} ∈ Q_{in} and q_{n} ∈ F. The language of MSCs accepted by G is L(G) = {M(π) ∈ M | π is a run through G}.

\xymatrix{p \ar[r] & q & p \ar[r] & q \ar[l] \\ r \ar[u] \ar[ur] &  & r \ar[r] & s \ar[l]}

Fig. 6. CG_{M} of Figure 1 (left) and CG_{M_{1}∘M_{2}} of Figure 5 (right).

An example of an MSG is depicted in Figure 5. It is not hard to see that the language L defined is not regular. To see this, we note that L projected to {p!q, r!s}^{∗} is {σ ∈ {p!q, r!s}^{∗} | |σ|_{p!q} = |σ|_{r!s} ≥ 1}, which is not a regular string language. (Recall that regular languages are closed under projections.)

Following [2] we now define the notion of a locally synchronized MSG.

Communication graph For an MSC M = (E, ≤, λ), let CG_{M}, the communication graph of M, be the directed graph (P, ↦) where:

• P is the set of processes of the system.

• (p, q) ∈ ↦ iff there exists an e ∈ E with λ(e) = p!q.

M is said to be com-connected if CG_{M} consists of one nontrivial strongly connected component and isolated vertices. An MSC language L ⊆ M is com-connected in case each MSC M ∈ L is com-connected.

Locally synchronized MSGs The MSG G is locally synchronized ^{5} if for every loop π = q⟶q_{1}⟶ ⋯ ⟶q_{n}⟶q, the MSC M(π) is com-connected. In our terminology, we will say that an MSC language L is a locally synchronized MSG-language if there exists a locally synchronized MSG G with L = L(G). Figure 6 illustrates the communication graphs of the example MSCs encountered thus far. It is easy to see that neither M nor M_{1} ∘M_{2} are com-connected.

Clearly, the MSG of Figure 5 is not locally synchronized. This is no coincidence, as it will turn out that every locally synchronized MSG-language is a regular MSC language.

6 Finitely Generated Regular MSC Languages

As pointed in the introduction, a standard way of representing a collection of MSCS is to use an HMSC or—equivalently from a formal standpoint—as an MSG. Our goal here is to pin down the power of this representation relative to

5 This notion is called “bounded” in [2]. The terminology “locally synchronized” is taken from [29].

the class of regular MSC languages. Stated differently we wish to characterize the class of regular MSC languages that can be represented by MSGs.

A key feature of MSG languages is that for each such language there is a fixed finite set X of MSCs such that each MSC in the language can be expressed as a concatenation of MSCs (with multiple copies) taken from X. Such languages are said to be finitely generated. In this section we investigate the important connection between MSGs and finitely generated regular MSC languages. More precisely, we characterize the locally synchronized MSGlanguages as precisely the class of MSC languages that are both regular and finitely generated.

Let L_{1}, L_{2} ⊆ M be two sets of MSCs. As usual, L_{1} ∘ L_{2} denotes the pointwise concatenation of L_{1} and L_{2}, as defined out in the previous section. For X ⊆ M, we define X^{0} = {ε}, where ε denotes the empty MSC, and for i ≥ 0, X^{i+1} = X ∘ X^{i}. The asynchronous iteration of X is then defined by X^{⊛} = ⋃_{i≥0} X^{i}. Now, let L ⊆ M. We say that L is finitely generated if there is a finite set of MSCs X ⊆ M such that L ⊆ X^{⊛}.

We first observe that not every regular MSC language is finitely generated. As an example, the automaton in Figure 2 accepts a regular language that is not finitely generated. By inspection of Figure 3 one readily verifies that none of the MSCs in this language can be expressed as the concatenation of two or more nontrivial MSCs. Hence, this language is not finitely generated.

Our interest in finitely generated languages stems from the fact that these arise naturally from standard high-level descriptions of MSC languages such as message sequence graphs. However, as we saw earlier, Figure 5 provides an example showing that, conversely, not all finitely generated languages are regular.

The first question we address is that of deciding whether a regular MSC language is finitely generated. To do this, we need to introduce atoms. Let M, M′ ∈ M be nonempty MSCs. Then M′ is a component of M in case there exist M_{1}, M_{2} ∈ M, possibly empty, such that M = M_{1}∘M′∘M_{2}. Let Comp(M) denote the set of components of M and let Comp(L) = ⋃{Comp(M) | M ∈ L}.

We say that M is an atom if the only component of M is M itself. Thus, an atom is a nonempty message sequence chart that cannot be decomposed into non-trivial subcomponents. For an MSC M, we let Atoms(M) denote the set {M′ | M′ is an atom and M′ is a component of M}. For an MSC language L ⊆ M, Atoms(L) = ⋃{Atoms(M) | M ∈ L}. It is clear that the question of deciding whether L is finitely generated is equivalent to that of checking whether Atoms(L) is finite.

Theorem 6.1 Let L be a regular MSC language. It is decidable whether L is finitely generated.

Proof Sketch: Let A = (S, Σ, s_{in}, δ, F) be the minimum DFA for L. From A, we construct a finite family of finite-state automata that together accept the linearizations of the MSCs in Atoms(L). It will then follow that L is finitely generated if and only if each of these automata accepts a finite language. We sketch the details below.

We know that for each live state s ∈ S, we can assign a capacity function K_{s} : Ch → ℕ that counts the number of messages present in each channel when the state s is reached. We say that s is a zero-capacity state if K_{s}(c) = 0 for each channel c.

Claim 6.2 Let M be an MSC in Comp(L) (in particular, in Atoms(L)) and w be a linearization of M. Then, there are zero-capacity live states s, s′ in A such that s ⟶^{w} s′.

If M is in Comp(L), then there are MSC’s M_{1}, M_{2} such that M_{1}MM_{2} ∈ L. Thus, if w_{1}, w_{2} are some linearizations of M_{1} and M_{2}, then w_{1}ww_{2} is accepted by A. Thus, there is an accepting run s_{in} ⟶^{w_{1}} s ⟶^{w} s′ ⟶^{w_{2}} t. w_{1}, w_{2} and w are complete words as they arise as linearizations of MSCs. Further, s_{in} is a zero-capacity state and thus s and s′ must be zero-capacity states. This proves Claim 6.2.

Claim 6.3 Let M be an MSC in Comp(L). M is an atom if and only if for each linearization w of M and each pair (s, s′) of zero-capacity live states in A, if s ⟶^{w} s′ then no intermediate state visited in this run has zero-capacity.

Let M an atom and w be a linearization of M. Suppose w = w_{1}w_{2} for nonempty words w_{1} and w_{2} and s ⟶^{w_{1}} s_{1} ⟶^{w_{2}} s′, where s_{1} is a zero-capacity state. w_{1} and w_{2} are nonempty complete words. Recall that every complete word is the linearization of some MSC. Let M_{1} and M_{2} be the MSCs corresponding to w_{1} and w_{2}. Then, M = M_{1} ∘ M_{2} ∘ M_{3}, where M_{3} is the empty MSC, contradicting the assumption that M is an atom. Thus, the run can have no intermediate zero-capacity state.

Suppose M is not an atom. Then M = M_{1} ∘ M_{2} ∘ M_{3} where at least two of M_{1}, M_{2}, M_{3} are nonempty. Let w_{1}, w_{2} and w_{3} be linearizations of M_{1}, M_{2} and M_{3}. All three are complete words. Thus, there are states s_{1}, s_{2} such that s ⟶^{w_{1}} s_{1} ⟶^{w_{2}} s_{2} ⟶^{w_{3}} s′. Since at least one of these words is nonempty, one of the states s_{1} or s_{2} is a zero-capacity intermediate state. This completes the proof of Claim 6.3.

Suppose s ⟶^{w} s′ and w ∼ w′ . Then it is easy to see that s ⟶^{w′} s′ as well. With each pair (s, s′) of live zero-capacity states we associate a language L_{At}(s, s′). A word w belongs to L_{At}(s, s′) if and only if w is complete, s ⟶^{w} s′ and for each w′ ∼ w the run s ⟶^{w′} s′ has no zero-capacity intermediate states. From Claims 6.2 and 6.3 above, each of these languages consists of all the linearizations of some subset of Atoms(L) and the linearizations of each element of Atoms(L) is contained in some L_{At}(s, s′). Thus, it suffices to check for the finiteness of each of these languages.

Let L_{s,s′} be the language of strings accepted by A when we set the initial state to be s and the set of final states to be {s′}. Clearly L_{At}(s, s′) ⊆ L_{s,s′}. We now show how to construct an automaton for L_{At}(s, s′).

We begin with A and prune the automaton as follows:

• Remove all incoming edges at s and all outgoing edges at s′.

• If t ∉ \{s, s′\} and K_{t} = \overline{0}, remove t and all its incoming and outgoing edges.

• Recursively remove all states that become unreachable as a result of the preceding operation.

Let B be the resulting automaton. B accepts any complete word w on which the run from s to s′ does not visit an intermediate zero-capacity state. Clearly, L_{At}(s, s′) ⊆ L(B). However, L(B) may also contain linearizations of nonatomic MSCs that happen to have no nontrivial complete prefix. For all such words, we know from Claim 6.3 that there is at least one equivalent linearization on which the run passes through a zero-capacity state and which would hence be eliminated from L(B). Thus, L_{At}(s, s′) is the ∼-closed subset of L(B) and we need to prune B further to obtain the automaton for L_{At}(s, s′).

Recall that the original DFA A was structurally closed with respect to the independence relation on communication actions in the following sense. Suppose δ(s_{1}, a) = s_{2} and δ(s_{2}, b) = s_{3} with a, b independent at s_{1}. Then, there exists s′_{2} such that δ(s_{1}, b) = s′_{2} and δ(s′_{2}, a) = s_{3}.

To identify the closed subset of L(B), we look for local violations of this “diamond” property and carefully prune transitions. We first blow up the state space into triples of the form (s_{1}, s_{2}, s_{3}) for each s_{1}, s_{2} and s_{3} such that there exist a and a′ with δ(s_{1}, a) = s_{2} and δ(s_{2}, a′) = s_{3}. Let S′ denote this set of triples. We obtain a nondeterministic transition relation δ′ = {((s_{1}, s_{2}, s_{3}), a, (t_{1}, t_{2}, t_{3})) | s_{2} = t_{1}, s_{3} = t_{2}, δ(s_{2}, a) = s_{3}}. Set S_{in} = {(s_{1}, s_{2}, s_{3}) ∈ S′ | s_{2} = s_{in}} and F′ = {(s_{1}, s_{f}, s_{2}) ∈ S′ | s_{f} ∈ F }. Let B′ = (S′, Σ, δ′, S_{in}, F′).

Consider any state s_{1} in B such that a and b are independent at s_{1}, δ(s_{1}, a) = s_{2}, δ(s_{2}, b) = s_{3} but there is no s′_{2} such that δ(s_{1}, b) = s′_{2} and δ(s′_{2}, a) = s_{3}. For each such s_{1}, we remove all transitions of the form ((t, s_{0}, s_{1}), a, (s_{0}, s_{1}, t′)) and ((t, s_{2}, s_{3}), b, (s_{2}, s_{3}, t′)) from B′. We then recursively remove all states that become unreachable after this pruning.

Eventually, we arrive at an automaton C such that L(C) = L_{At}(s, s′). Since C is a finite-state automaton, we can easily check whether L(C) is finite. This process is repeated for each pair of live zero-capacity states. □

We will now bring out the intimate connection between message sequence graphs and finitely generated regular MSC languages. As pointed out earlier, Alur and Yannakakis noted that every locally synchronized MSG-language is regular [2, Thm. 7]. One way to establish this result is — following [9]

— to show that the asynchronous iteration of a com-connected regular MSC language is regular. The proof in [9] is based on grammars. A more direct, automata-theoretic proof of the same result is described in Appendix A. Thus, every locally synchronized MSG accepts a finitely generated regular MSC language.

All languages arising from MSGs are finitely generated, so the language accepted by the message-passing automaton on Figure 2 shows that not all regular MSC languages can be described by MSGs. It turns out that locally synchronized MSGs generate precisely those MSC languages that are both regular and finitely generated.

Theorem 6.4 Let L be an MSC language. Then L is a finitely generated regular MSC language if and only if L is a locally synchronized MSG-language.

Proof Sketch: From the remarks above, it suffices to show that any finitely generated regular MSC language can be accepted by some locally synchronized MSG.

Suppose L is a regular MSC language accepted by the minimal DFA A = (S, Σ, s_{in}, δ, F). Let Atoms(L) = {a_{1}, a_{2}, …, a_{m}}. For each atom a_{i}, fix a linearization u_{i} ∈ lin(a_{i}). Define an auxiliary DFA B = (S\overline{0}, Atoms(L), s_{in}, δ̂, F̂) as follows:

• S\overline{0} is the set of states of A that have zero-capacity functions.

• F̂ = F.

• δ̂(s, a_{i}) = s′ iff δ(s, u_{i}) = s′ in A. (Note that u, u′ ∈ lin(a_{i}) implies δ(s, u) = δ(s, u′), so s′ is fixed independent of the choice of u_{i} ∈ lin(a_{i}).)

Thus, B accepts the (regular) language of atoms corresponding to L(A). We can define a natural independence relation I_{A} on atoms as follows: atoms a_{i} and a_{j} are independent if and only if the set of active processes in a_{i} is disjoint from the set of active processes in a_{j}. (The process p is active in the MSC (E, ≤, λ) if E_{p} is non-empty.)

It follows that L(B) is a regular Mazurkiewicz trace language over the trace alphabet (Atoms(L), I_{A}). As usual, for w ∈ Atoms(L)^{∗}, we let [w] denote the equivalence class of w with respect to I_{A}.

We now fix a strict linear order ≺ on Atoms(L). This induces a (lexicographic) total order on words over Atoms(L). Let LEX ⊆ Atoms(L)^{∗} be given by: w ∈ LEX iff w is the lexicographically least element in [w].

For a trace language L over (Atoms(L), I_{A}), let lex(L) denote the set L∩LEX .

Fact 6.5 ([11], Sect. 6.3.1)

(1) If L is a regular trace language over (Atoms(L), I_{A}), then lex(L) is a regular language over Atoms(L). Moreover, L = {[w] | w ∈ lex(L)}.

(2) If w_{1}ww_{2} ∈ LEX , then w ∈ LEX .

(3) If w is not a connected^{6} trace, then ww ∉ LEX .

From (1) we know that lex(L(B)) is a regular language over Atoms(L). Let C = (S′, Atoms(L), s′_{in}, δ′, F′) be the DFA over Atoms(L) obtained by eliminating the (unique) dead state, if any, from the minimal DFA for lex(L(B)). It is easy to see that an MSC M belongs to L if and only if it can be decomposed into a sequence of atoms accepted by C. Using this fact, we can derive an MSG G from C such that L(G) = L. We define G = (Q, ⟶, Q_{in}, F, Φ) as follows:

• Q = S′ × (Atoms(L) ∪ {ε}).

• Q_{in} = {(s′_{in}, ε)}.

• (s, b)⟶(s′, b′) iff δ′(s, b′) = s′.

• F′ = F × Atoms(L).

• Φ(s, b) = b.

Clearly G is an MSG and the MSC language that it defines is L. We need to show that G is locally synchronized. To this end, let π = (s, b)⟶ (s_{1}, b_{1})⟶ ⋯ ⟶(s_{n}, b_{n})⟶(s, b) be a loop in G. We need to establish that the MSC M(π) = b_{1} ∘ ⋯ ∘ b_{n} ∘ b defined by this loop is com-connected. Let w = b_{1}b_{2} … b_{n}b.

Consider the corresponding loop s ⟶^{b_{1}} s_{1} ⟶^{b_{2}} ⋯ ⟶^{b_{n}} s_{n} ⟶^{b} s in C. Since every state in C is live, there must be words w_{1}, w_{2} over Atoms(L) such that w_{1}w^{k}w_{2} ∈ lex(L(B)) for every k ≥ 0.

From (2) of Fact 6.5, w^{k} ∈ LEX . This means, by (3) of Fact 6.5, that

6 A trace is said to be connected if, when viewed as a labeled partial order, its Hasse diagram consists of a single connected component. See [11] for a more formal definition.

w describes a connected trace over (Atoms(L), I_{A}). Further, the underlying undirected graph of the communication graph of any atom always consists of a single nontrivial connected component. From these, it is not difficult to see that the underlying undirected graph of the communication graph CG_{M(π)} = (P, ↦) consists of a single connected component C ⊆ P and isolated processes. We have to argue that the component C is, in fact, strongly connected. We show that if C is not strongly connected, then the regular MSC language L is not B-bounded for any B ∈ ℕ, thus contradicting Proposition 2.4.

Suppose that the underlying graph of C is connected but C not strongly connected. Then, there exist two processes p, q ∈ C such that p ↦ q, but there is no path from q back to p in CG_{M(π)}. For k ≥ 0, let M(π)^{k} = (E, ≤, λ) be the MSC corresponding to the k-fold iteration \underbrace{M(π) ∘ M(π) ∘ ⋯ ∘ M(π)}_{k times}.

Since p ↦ q in CG_{M(π)}, it follows that there are events labeled p!q and q?p in M(π). Moreover, since there is no path from q back to p in CG_{M(π)}, we can conclude that in M(π)^{k}, for each event e with λ(e) = p!q, there is no event labeled q?p in ↓e. This means that M(π)^{k} admits a linearization v′_{k} with a prefix τ′_{k} that includes all the events labeled p!q and excludes all the events labeled q?p, so that #_{p!q}(τ) − #_{q?p}(τ) ≥ k.

By Proposition 2.4, since L is a regular MSC language, there is a bound B ∈ ℕ such that every word in L is B-bounded—that is, for each v ∈ L, for each prefix τ of v and for each channel (p, q) ∈ Ch, #_{p!q}(τ) − #_{q?p}(τ) ≤ B. Recall that w_{1}w^{k}w_{2} ∈ lex(L(B)) for every k ≥ 0. Fix linearizations v_{1} and v_{2} of the atom sequences w_{1} and w_{2}, respectively. Then, for every k ≥ 0, u_{k} = v_{1}v′_{k}v_{2} ∈ L where v′_{k} is the linearization of M(π)^{k} defined earlier. Setting k to be B+1, we find that u_{k} admits a prefix τ_{k} = v_{1}τ′_{k} such that #_{p!q}(τ_{k}) − #_{q?p}(τ_{k}) ≥ B+1, which contradicts the B-boundedness of L.

Hence, it must be the case that C is a strongly connected component, which establishes that the MSG G we have constructed is locally synchronized.

□

It is easy to see that local synchronicity is not a necessary condition for regularity. Consider the MSG in Figure 7, which is not locally synchronized. It accepts the regular MSC language M_{1} ∘ (M_{1} + M_{2})^{⊛}.

Thus, it would be useful to provide a characterization of the class of MSGs representing regular MSC languages. Unfortunately, the following result shows that there is no (recursive) characterization of this class.

Theorem 6.6 The problem of deciding whether a given MSG represents a

[figure: M_{1}; ⟹; M_{2}; (p); (q); (r); (s); •; •; •; •; •; •; •; •; M_{1}; M_{2}]

Fig. 7. An non-locally synchronized MSG whose language is regular.

[figure: (p_{i_{1}}); (p_{i_{1}}^{a}); (p_{i_{2}}); (p_{i_{2}}^{a}); …; (p_{i_{k−1}}); (p_{i_{k−1}}^{a}); (p_{i_{k}}); (p_{i_{k}}^{a}); •; •; •; •; •; •; •; •; •; •; •; •; •; •; •; •; •; •; •; •; •; •; •; •; •; •; •; •; …]

Fig. 8. The MSC M_{a} encoding the letter a ∈ A.

regular MSC language is undecidable.

Proof Sketch: It is known that the problem of determining whether the trace-closure of a regular language L ⊆ A^{∗} with respect to a trace alphabet (A, I) is also regular is undecidable [32]. We reduce this problem to the problem of checking whether the MSC language defined by an MSG is regular.

Let Ã = (A_{1}, …, A_{n}) be a distributed alphabet implementing the trace alphabet (A, I) [11]. We will fix a set of processes P and the associated communication alphabet Σ and encode each letter a by an MSC M_{a} over P.

For each component A_{i} of Ã, we create 1+|A_{i}| processes that we will denote by p_{i}, p_{i}^{a_{1}}, p_{i}^{a_{2}}, …, p_{i}^{a_{k}}, where A_{i} = {a_{1}, a_{2}, …, a_{k}}. Suppose now that the letter a appears in the components A_{i_{1}}, A_{i_{2}}, …, A_{i_{k}} of the distributed alphabet Ã with 1 ≤ i_{1} < i_{2} < ⋯ < i_{k} ≤ n. The MSC M_{a} representing a is then given in Figure 8. It is easy to see that the communication graph CG_{M_{a}} is strongly connected. Moreover, if (a, b) ∈ I, then the sets of active processes of M_{a} and M_{b} are disjoint. The encoding ensures that we can construct a finite-state automaton to parse any word over Σ and determine whether it arises as the linearization of an MSC of the form M_{a_{1}} ∘ M_{a_{2}} ∘ ⋯ ∘ M_{a_{k}}. If so, the parser can uniquely reconstruct the corresponding word a_{1}a_{2} … a_{k} over A.

Let A be the minimal DFA corresponding to a regular language L over A. We construct an MSG G from A as described in the proof of Theorem 6.4. Given the properties of our encoding, we can then establish that the MSC language L(G) is regular if and only if the trace-closure of L is regular, thus completing the reduction. □

7 Conclusion

We have identified here the notion of a regular MSC language and have developed the basic theory of these languages by providing automata-theoretic and logical chracterizations. We have also characterized precisely the subclass of regular MSC languages definable using the mechanism of HMSCs. Our range of results shows that the notion of regularity that we have identified here is a fruitful one. Further, while it bears a pleasant similarity to the theory of regular Mazurkiewicz trace languages, its theory requires new insights and techniques due to the implicit presence of potentially unbounded FIFOs.

Our treatment of MSC languages and the related work cited so far have implicitly assumed a linear time framework. The notion of an implementation (say an MPA) satisfying a requirement specification (say, a bounded HMSC) is also an existential one; for every MSC in the requirement there exists an MSC in the implementation and conversely. The formalism of Live Sequence Charts proposed by Damm and Harel [10] suggests, however, that one could obtain a more powerful specification language based on MSCs by switching to a branching-time framework. The recent work of Harel and his collaborators [15,16] suggests that this way of using MSCs might bear a more direct and fruitful relationship with implementations than mechanisms such as HMSCs or sequence diagrams in the UML framework. In light of this, it will be interesting to formulate a suitable branching-time version of the theory reported in this paper.

References

[1] Alur, R., Holzmann, G. J., Peled, D.: An analyzer for message sequence charts. Software Concepts and Tools 17(2) (1996) 70–77

[2] Alur, R., Yannakakis, M.: Model checking of message sequence charts. Proceedings of the 10th International Conference on Concurrency Theory (CONCUR’99), Lecture Notes in Computer Science 1664, Springer-Verlag (1999) 114–129

[3] Alur, R., Etessami, K., Yannakakis, M.: Inference of message sequence graphs. Proceedings of the 22nd International Conference on on Software Engineering (ICSE 2000), Association for Computing Machinery (2000) 304–313.

[4] Alur, R., Etessami, K., Yannakakis, M.: Realizability and Verification of MSC Graphs. Proceedings Automata, Languages and Programming, 28th International Colloquium (ICALP 2001), Lecture Notes in Computer Science 2076, Springer-Verlag (2001) 797–808.

[5] Ben-Abdallah, H., Leue, S.: Syntactic detection of process divergence and non-local choice in message sequence charts. Proceedings of the 3rd Workshop on Tools and Algorithms for the Construction and Analysis of Systems (TACAS’97), Lecture Notes in Computer Science 1217, Springer-Verlag (1997) 259–274

[6] Bollig, B., Leucker, M., Noll, T.: Generalised regular MSC languages. Proceedings of the 5th International Conference on Foundations of Software Science and Computation Structures (FOSSACS’02), Lecture Notes in Computer Science 2303, Springer-Verlag (2002) 52–66

[7] Booch, G., Jacobson, I., Rumbaugh, J.: Unified Modeling Language User Guide. Addison-Wesley (1997)

[8] Büchi, J. R.: Weak second-order arithmetic and finite automata. Z. Math. Logik Grundl. Math. 6 (1960) 66–92

[9] Clerbout, M., Latteux, M.: Semi-commutations. Information and Computation 73(1) (1987) 59–74

[10] Damm, W., Harel, D.: LSCs: Breathing life into message sequence charts. Formal Methods in System Design 19(1) (2001) 45–80.

[11] Diekert, V., Rozenberg, G. (Eds.): The Book of Traces. World Scientific (1995)

[12] Ebinger, W., Muscholl, A.: Logical definability on infinite traces. Theoretical Computer Science 154(1) (1996) 67–84

[13] Genest, B., Muscholl, A., Seidl, H., Zeitoun, M.: Infinite-state high-level MSCs: Model-checking and realizability. Proceedings of the 29th International Colloquium on Automata, Languages and Programming (ICALP’02), Lecture Notes in Computer Science 2380, Springer-Verlag (2002) 657–668 [14] Harel, D., Gery, E.: Executable object modeling with statecharts. IEEE

Computer, July 1997 (1997) 31–42

[15] Harel, D., Marelly, R.: Specifying and executing behavioral requirements: The play-in/play-out approach. Software and System Modeling (SoSyM) (to appear)

[16] Harel, D., Kugler, H., Marelly, R., Pnueli, A.: Smart Play-out of Behavioral Requirements. Proceedings Formal Methods in Computer-Aided Design, 4th International Conference (FMCAD 2002), Lecture Notes in Computer Science 2517 Springer-Verlag (2002) 378–398

[17] Henriksen, J.G., Mukund, M., Narayan Kumar, K., Thiagarajan, P.S.: On message sequence graphs and finitely generated regular MSC languages. Proceedings of the International Colloquium on Automata, Languages and Programming 2000 (ICALP’00), Lecture Notes in Computer Science 1854, Springer-Verlag (2000) 675–686

[18] Henriksen, J.G., Mukund, M., Narayan Kumar, K., Thiagarajan, P.S.: Regular collections of message sequence charts. Proceedings of the Conference on the Mathematical Foundations of Computer Science 2000 (MFCS’00), Lecture Notes in Computer Science 1893, Springer-Verlag (2000) 405–414

[19] ITU-TS Recommendation Z.120: Message Sequence Chart (MSC). ITU-TS, Geneva (1997)

[20] Kuske, D.: A further step towards a theory of regular MSC languages. Proceedings of the Symposium on the Theoretical Aspects of Computer Science, Lecture Notes in Computer Science 2285, Springer-Verlag (2002) 489–500

[21] Ladkin, P. B., Leue, S.: Interpreting message flow graphs. Formal Aspects of Computing 7(5) (1995) 473–509

[22] Levin, V., Peled, D.: Verification of message sequence charts via template matching. Proceedings of the 7th International Conference on Theory and Practice of Software Development (TAPSOFT’97), Lecture Notes in Computer Science 1214, Springer-Verlag (1997) 652–666

[23] Madhusudan, P.: Reasoning about sequential and branching behaviours of message sequence graphs. Proceedings of the 27th International Colloquium on Automata, Languages and Programming (ICALP’00), Lecture Notes in Computer Science 2076, Springer-Verlag (2001) 396–407

[24] Madhusudan, P., Meenakshi, B.: Beyond message sequence graphs. Proceedings of the 21st Conference on the Foundations of Software Technology and Theoretical Computer Science (FSTTCS’01), Lecture Notes in Computer Science 2245, Springer-Verlag (2001) 256–267

[25] Mauw, S., Reniers, M. A.: High-level message sequence charts, Proceedings of the 8th SDL Forum, SDL’97: Time for Testing — SDL, MSC and Trends, Elsevier (1997) 291–306 [26] Mukund, M., Narayan Kumar, K., Sohoni, M.: Synthesizing distributed finite-

state systems from MSCs. Proceedings of the 11th International Conference on Concurrency Theory (CONCUR 2000), Lecture Notes in Computer Science 1877, Springer-Verlag (2000) 521–535

[27] Mukund, M., Narayan Kumar, K., Sohoni, M.: Bounded time-stamping in message-passing systems. Theoretical Computer Science, 290(1) (2003) 221– 239

[28] Muscholl, A.: Matching specifications for message sequence charts. Proceedings of the 2nd International Conference on Foundations of Software Science and Computation Structures (FOSSACS’99), Lecture Notes in Computer Science 1578, Springer-Verlag (1999) 273–287

[29] Muscholl, A., Peled, D.: Message sequence graphs and decision problems on Mazurkiewicz traces. Proceedings of the 24th International Symposium on Mathematical Foundations of Computer Science (MFCS’99), Lecture Notes in Computer Science 1672, Springer-Verlag (1999) 81–91

[30] Muscholl, A., Peled, D., Su, Z.: Deciding properties for message sequence charts. Proceedings of the 1st International Conference on Foundations of Software Science and Computation Structures (FOSSACS’98), Lecture Notes in Computer Science 1378, Springer-Verlag (1998) 226–242

[31] Rudolph, E., Graubmann, P., Grabowski, J.: Tutorial on message sequence charts. In Computer Networks and ISDN Systems — SDL and MSC 28 (1996).

[32] Sakarovitch, J.: The “last” decision problem for rational trace languages. Proceedings of the 1st Latin American Symposium on Theoretical Informatics (LATIN’92), Lecture Notes in Computer Science 583, Springer-Verlag (1992) 460–473

[33] Thiagarajan, P. S.: A trace consistent subset of PTL. Proceedings of 6th International Conference on Concurrency Theory (CONCUR’95), Lecture Notes in Computer Science 962, Springer-Verlag (1995) 438-452

[34] Thiagarajan, P. S., Walukiewicz, I.: An expressively complete linear time temporal logic for Mazurkiewicz traces. Information and Computation, Vol. 179, No. 2 (2002) 230-249.

[35] Thomas, W.: Automata on infinite objects. In van Leeuwen, J. (Ed.): Handbook of Theoretical Computer Science, Volume B: Formal Models and Semantics, Elsevier Science Publishers (1990) 133–191

[36] Thomas, W.: Languages, automata, and logic. In Rozenberg, G., Salomaa, A. (Eds.): Handbook of Formal Language Theory, Volume III, Springer-Verlag (1997) 389–455

[37] Vardi, M. Y., Wolper, P.: An automata-theoretic approach to automatic program verification. Proceedings of the 1st Annual IEEE Symposium on Logic in Computer Science (LICS’86), IEEE Computer Society Press (1986) 332–345 [38] Zielonka, W.: Notes on finite asynchronous automata. R.A.I.R.O. Informatique

Théorique et Applications 21 (1987) 99–135

A Asynchronous Iteration

In this section, we give an automata-theoretic proof that the asynchronous iteration of a com-connected regular MSC language remains regular. A proof of this result in terms of grammars appears in [9].

We begin with a simple characterization of asynchronous iteration that follows from the definition in Section 6.

Proposition A.1 Let L ⊆ M be an MSC language. The MSC M = (E, ≤, λ) belongs to L^{⊛}, the asynchronous iteration of L, iff there is a sequence of complete ideals ∅ = I_{0} ⊂ I_{1} ⊂ ⋯ ⊂ I_{n} = E such that for each j ∈ {1, 2, …, n}, the partial order I_{j} \ I_{j−1} is isomorphic to some M′ ∈ L.

The ideals I_{0}I_{1} … I_{n} define an L-factorization of M—that is, a factorization of M into MSCs from L.

A.1 An infinite-state automaton for L^{⊛}

Let L be a regular MSC language. From the automata-theoretic characterization of Section 3, it follows that there is a B-bounded message-passing automaton A such that L(A) = L. To construct a (sequential) automaton for L^{⊛}, our strategy will be to guess a factorization of the input and simulate A to verify that each factor belongs to L. We first construct an infinite-state automaton for L^{⊛} for an arbitrary regular MSC language L and then describe the conditions under which we can restrict the automaton for L^{⊛} to be a finite-state device.

The new automaton A^{⊛} that we construct uses natural numbers to label the factors. Since not every process participates in every factor, A^{⊛} records the sequence of factors that each process p ∈ P participates in and ensures that the sequence in which the factors are processed is consistent across the system. In addition, A^{⊛} simulates a copy of A on each factor. Initially, each factor is labelled by the initial configuration of A. The simulation succeeds if the global state associated with each factor is a final configuration of A.

More formally, A^{⊛} = (S′, s′_{in}, ⟶′, F′) where each state in S′ is a pair (μ, ν) with μ : P → ℕ^{∗} and ν : ℕ → Conf_{A} such that μ satisfies the following condition:

• For any pair of processes p and q (not necessarily distinct) and any pair of distinct labels ℓ and ℓ′, if ℓ appears before ℓ′ in μ(p), then ℓ′ does not appear before ℓ in μ(q).

The function μ records the order in which each process observes the L-factors of the input word. The function ν keeps track of the current configuration of A on each factor.

The initial state s′_{in} of A^{⊛} is the pair (μ_{in}, ν_{in}) where μ_{in}(p) = ε for each process p and ν_{in}(ℓ) = (s_{in}, χ_{ε}) for each ℓ ∈ ℕ (where ε is the empty word and (s_{in}, χ_{ε}) is the initial configuration of A).

A state (μ, ν) of A^{⊛} is in F′ whenever:

• If ℓ appears in μ(p) for some process p, ν(ℓ) is a final configuration of A.

• If ℓ does not appear in μ(p) for any process p, ν(ℓ) = (s_{in}, χ_{ε}).

Consider states (μ, ν) and (μ′, ν′) and a letter a such that a ∈ Σ_{p}. Then, (μ, ν) ⟶^{a}′ (μ′, ν′) provided:

• For q ≠ p, μ′(q) = μ(q).

• Either μ′(p) = μ(p) or μ′(p) = μ(p) · ℓ for some ℓ ∈ ℕ.

• Let the last label in μ′(p) be ℓ. Then, ν(ℓ) ⟹^{a} ν′(ℓ) and for ℓ′ ≠ ℓ, ν′(ℓ′) = ν(ℓ′) (where ⟹ ⊆ Conf_{A} × Σ × Conf_{A} is the global transition relation of A).

The following is easy to verify from the definition of A^{⊛}.

Theorem A.2 Let A be a message-passing automaton for a regular MSC language L. Then, the automaton A^{⊛} accepts the language L^{⊛}.

To describe when we can restrict A^{⊛} to a finite-state device, we extend the definition of A^{⊛} so that each state has one more component. A state of A^{⊛} is now a triple of functions (μ, ν, τ), where μ : P → ℕ^{∗} and ν : ℕ → Conf_{A} are as before. The new component τ : ℕ → 2^{P} specifies the type of each label.

As before, μ records the sequence in which each process observes L-factors while ν keeps track of the current configuration of each factor. The new component τ records the set of processes that participate in each factor.

The states of A^{⊛} are those triples (μ, ν, τ) that satisfy the following conditions:

• For any pair of processes p and q (not necessarily distinct) and any pair of distinct labels ℓ and ℓ′, if ℓ appears before ℓ′ in μ(p), then ℓ′ does not appear before ℓ in μ(q).

• If τ(ℓ) ≠ ∅ then ℓ appears in μ(p) for some p ∈ P. Moreover, if ℓ appears in μ(p) then p ∈ τ(ℓ).

The initial state s′_{in} of the extended version of A^{⊛} is the triple (μ_{in}, ν_{in}, τ_{in}) where μ_{in}(p) = ε for each process p, ν_{in}(ℓ) = (s_{in}, χ_{ε}) for each ℓ ∈ ℕ and τ_{in}(ℓ) = ∅ for each ℓ ∈ ℕ.

A state (μ, ν, τ) of A^{⊛} is in F′ whenever:

• If ℓ appears in μ(p) for some process p, ν(ℓ) is a final configuration of A.

• If ℓ does not appear in μ(p) for any process p, ν(ℓ) = (s_{in}, χ_{ε}).

• If τ(ℓ) = P then ℓ appears in μ(p) for each p ∈ P.

Consider states (μ, ν, τ) and (μ′, ν′, τ′) and a letter a such that a ∈ Σ_{p}. Then,

(μ, ν, τ) ⟶^{a}′ (μ′, ν′, τ′) provided:

• For q ≠ p, μ′(q) = μ(q).

• Either μ′(p) = μ(p) or μ′(p) = μ(p) · ℓ for some ℓ ∈ ℕ.

• Let the last label in μ′(p) be ℓ. Then, ν(ℓ) ⟹^{a} ν′(ℓ) and for all ℓ′ ≠ ℓ, ν′(ℓ) = ν(ℓ).

• Let the last label in μ′(p) be ℓ. Then τ′(ℓ) ⊃ {p} and for ℓ′ ≠ ℓ, τ′(ℓ′) = τ(ℓ′). Moreover, if ℓ already appears in μ(q) for some q ∈ P, then τ′(ℓ) = τ(ℓ). (This captures the fact that when ℓ is first used, τ(ℓ) records a nondeterministic guess for the processes that will participate in the factor labelled ℓ and this guess cannot be changed.)

Once again, we can establish that L(A^{⊛}) = L(A)^{⊛}.

A.2 If L is com-connected, L^{⊛} is regular

Recall the definition of a com-connected MSC language from Section 5. The main result we want to prove is the following.

Theorem A.3 Let L be a regular and com-connected MSC language. Then, L^{⊛} is regular.

In the previous section, we saw how to construct an infinite-state automaton A^{⊛} for L^{⊛} from a message-passing automaton A for L. To prove Theorem A.3, we shall argue that if L is com-connected, A^{⊛} can in fact be cut down to a finite-state automaton.

Definition A.4 Let G = (V, E) be a directed graph. For X ⊆ V, define nbd(X), the neighbourhood of X, to be X ∪ {v′ | ∃v ∈ X : (v′, v) ∈ E}.

□

Proposition A.5 Let G = (V, E) be a directed graph such that all nonisolated vertices form a single strongly connected component. Let C ⊆ V be the vertices in this strongly connected component. Then, for any proper subset C′ ⊊ C, nbd(C′) has at least one vertex in C \ C′.

Proof: Suppose that C′ ⊊ C but there is no vertex v ∈ (C \ C′) ∩ nbd(C′). This means there is no path from any vertex in C \ C′ to any vertex in C′. This contradicts the assumption that C is a strongly connected component of

G.  □  □

Definition A.6 Consider a state (μ, ν, τ) of the extended automaton A^{⊛} described in the previous section. The label ℓ is said to be dead in (μ, ν, τ) if for every p ∈ τ(ℓ), μ(p) = w · ℓ · w′, where w′ is a nonempty string over ℕ. A label that is not dead is said to be live. □

Lemma A.7 Let A be a message-passing automaton for a com-connected MSC language L. In any state (μ, ν, τ) of A^{⊛} only a bounded number of labels are not dead.

Proof: Let (μ, ν, τ) be a state of A^{⊛} and let p ∈ P. Suppose that μ(p) is of the form u_{0}ℓ_{0}u_{1}ℓ_{1} … ℓ_{k}u_{k}ℓ_{k+1}u_{k+1}, where each u_{i}, i ∈ {0, 1, …, k+1}, is a string over ℕ, τ(ℓ_{0}) = τ(ℓ_{1}) = ⋯ = τ(ℓ_{k+1}) = P and |P | = k. Then, ℓ_{0} must be dead.

Recall that for each ℓ, τ(ℓ) records the set of processes that participate in the factor M_{ℓ} labelled ℓ. Since L is com-connected, τ(ℓ) defines a strongly connected set of processes in CG(M_{ℓ}).

Consider the graph G_{M_{ℓ_{k}}}. Let P_{k} = nbd(p) in this graph. For each process q ∈ P_{k}, there is an edge from q to p in G_{M_{ℓ_{k}}}. Thus, there is at least one action p?q in the factor M_{ℓ_{k}}. Since p has progressed from the factor M_{ℓ_{k}} to the factor M_{ℓ_{k+1}}, the corresponding q-action q!p in M_{ℓ_{k}} must also have occurred already. Thus, q has also observed the factor ℓ_{k} and ℓ_{k} must appear in μ(q) as well.

Let P_{k−1} = nbd(P_{k}) in G_{M_{ℓ_{k}}}. By a similar argument, ℓ_{k−1} must appear in μ(q) for each q ∈ P_{k−1}.

In this vein, we can construct P_{k−2}, P_{k−3}, … such that for each j ∈ {k, k−1, …, 1}, P_{j−1} = nbd(P_{j}) in G_{M_{ℓ_{j}}} and argue that ℓ_{j−1} must appear in μ(q) for each q ∈ P_{j−1}. By Proposition A.5, P_{j−1} \ P_{j} ≠ ∅ and P_{k} ⊂ P_{k−1} ⊂ ⋯ ⊆ P. Recall that |P_{k}| ≥ 2, since p ∈ P_{k} as well as the witness q such that q?p ∈ M_{ℓ_{k}}. Since |P | = k, we must thus have P_{2} = P. In other words, ℓ_{1} appears in μ(q) for each q ∈ P_{2} = P. From Definition A.6, it follows that ℓ_{0} is

dead in (μ, ν, τ).  □  □

Let (μ, ν, τ) be a state of A^{⊛}. For any process p and any P ⊆ P, there are at most |P | live labels in μ(p) of type P. Thus, the number of live labels in μ(p) is bounded by |P| · 2^{|P|} and the number of live labels overall in (μ, ν, τ) is bounded by |P|^{2} · 2^{|P|}.

A finite-state version of A^{⊛} From this, we can derive a finite-state version of A^{⊛} when the language accepted by A is com-connected. Instead of using the infinite set of labels ℕ to name factors, we fix a finite set of labels Γ such that |Γ| > |P|^{2} · 2^{|P|}. Thus, a state of A^{⊛} now consists of functions (μ, ν, τ) where μ : P → Γ^{∗}, ν : Γ → Conf_{A} and τ : Γ → 2^{P}.

A state of A^{⊛} is a triple (μ, ν, τ) that satisfies the following conditions:

• For any pair of processes p and q (not necessarily distinct) and any pair of distinct labels ℓ and ℓ′, if ℓ appears before ℓ′ in μ(p), then ℓ′ does not appear before ℓ in μ(q).

• If τ(ℓ) ≠ ∅ then ℓ appears in μ(p) for some p ∈ P. Moreover, if ℓ appears in μ(p) then p ∈ τ(ℓ).

• For each p ∈ P, μ(p) contains at most |P | labels of type P for each P ⊆ P.

The last condition ensures that A^{⊛} is finite-state.

In the initial state (μ_{in}, ν_{in}, τ_{in}), μ_{in}(p) = ε for each p ∈ P, ν_{in}(ℓ) = (s_{in}, χ_{ε}) for each ℓ ∈ Γ and τ(ℓ) = ∅ for each ℓ ∈ Γ.

Let (μ, ν, τ) and (μ′, ν′, τ′) be two states of A^{⊛} and let a ∈ Σ_{p}. Then (μ, ν, τ) ⟶^{a} ′ (μ′, ν′, τ′) provided we can construct an intermediate triple of functions (μ′′, ν′′, τ′′) such that:

• For q ≠ p, μ′′(q) = μ(q).

• Either μ′′(p) = μ(p) or μ′′(p) = μ(p) · ℓ for some ℓ ∈ Γ such that ℓ does not already appear in μ(p).

• Let the last label in μ′′(p) be ℓ. Then, ν(ℓ) ⟹^{a} ν′′(ℓ) and for ℓ′ ≠ ℓ, ν′′(ℓ′) = ν(ℓ′).

• Let the last label in μ′′(p) be ℓ. Then τ′′(ℓ) ⊃ {p} and for ℓ′ ≠ ℓ, τ′′(ℓ′) = τ(ℓ′). Moreover, if ℓ already appears in μ(q) for some q ∈ P, then τ′(ℓ) = τ(ℓ).

For p ∈ P and P ⊆ P, suppose that μ(p) is of the form u_{0}ℓ_{0}u_{1}ℓ_{1} … ℓ_{k}u_{k}ℓ_{k+1}u_{k+1}, where each u_{i}, i ∈ {0, 1, …, k+1}, is a string over Γ, τ(ℓ_{0}) = τ(ℓ_{1}) = ⋯ = τ(ℓ_{k+1}) = P and |P | = k.

Then, it is the case that ℓ_{0} is dead in (μ′′, ν′′, τ′′) and ν′′(ℓ_{0}) is a final configuration of A. (Observe that since exactly one process moves on each input, at most one dead label is generated with each move).

• (μ′, ν′, τ′) is obtained from (μ′′, ν′′, τ′′) by deleting the dead label ℓ_{0}, if any, from μ(q) for each q ∈ τ′′(ℓ_{0}) and then resetting τ′(ℓ_{0}) = ∅ and ν′(ℓ_{0}) = (s_{in}, χ_{ε}). If there are no dead labels in (μ′′, ν′′, τ′′), then (μ′, ν′, τ′) is the same as (μ′′, ν′′, τ′′).

A state (μ, ν, τ) of A^{⊛} is in F′ provided:

• If ℓ appears in μ(p) for some process p, ν(ℓ) is a final configuration of A.

• If ℓ does not appear in μ(p) for any process p, ν(ℓ) = (s_{in}, χ_{ε}).

• If τ(ℓ) = P then ℓ appears in μ(p) for each p ∈ P.

From Lemma A.7, it is easy to argue that if L is com-connected, then the finitestate version of A^{⊛} accepts L^{⊛}. This completes the proof of Theorem A.3.