1997 Kluwer Academic Publishers, Boston. Manufactured in The Netherlands.
Symbolic Verication of Communication
Protocols with Innite State Spaces using QDDs
BERNARDBOIGELOT*ANDPATRICEGODEFROID**Abstract. We study the verication of properties of communication protocols modeled by a nite set of nite-state machines that communicate by exchanging messages viaunboundedFIFO queues. It is well-known that most interesting verication problems, such as deadlock detection, are undecidable for this class of systems. However, in practice, these verication problems may very well turn out to be decidable for a subclass containing most \real" protocols.
Motivated by this optimistic (and, we claim, realistic) observation, we present an algorithm that may construct aniteandexactrepresentation of the state space of a communication protocol, even if this state space isinnite. Our algorithm performs aloop-rst searchin the state space of the protocol being analyzed. A loop-rst search is a search technique that attempts to explore rst the results of successive executions of loops in the protocol description (code). A new data structure namedQueue-content Decision Diagram(QDD) is introduced for representing (possibly innite) sets of queue-contents. Operations for manipulating QDDs during a loop-rst search are presented.
A loop-rst search using QDDs has been implemented, and experiments on several communi-cation protocols with innite state spaces have been performed. For these examples, our tool completed its search, and produced a nite symbolic representation for these innite state spaces.
1. Introduction
State-space exploration is one of the most successful strategies for analyzing and verifying properties of nite-state concurrent reactive systems. It proceeds by ex-ploring a global state graph representing the combined behavior of all concurrent components in the system. This is done by recursively exploring all successor states of all states encountered during the exploration, starting from a given initial state, by executing all enabled transitions in each state. The state graph that is explored is called the state space of the system. Many dierent types of properties of a sys-tem can be checked by exploring its state space: deadlocks, dead code, violations of user-specied assertions, etc. Moreover, the range of properties that state-space exploration techniques can verify has been substantially broadened during the last decade thanks to the development of model-checking methods for various temporal logics (e.g., [9, 19, 22, 27]).
Verication by state-space exploration has been studied by many researchers (cf. [17, 23]). The simplicity of the strategy lends itself to easy, and thus ecient, implementations. Moreover, verication by state-space exploration is fully auto-matic: no intervention of the designer is required. The main limit of state-space
* \Aspirant" (Research Assistant) for the National Fund for Scientic Research (Belgium). The work of this author was done in part while visiting Bell Laboratories.
Correspondence to: Universite de Liege, Institut Monteore, B28, 4000 Liege Sart-Tilman, Bel-gium. Email:boigelot@monteore.ulg.ac.be.
** Lucent Technologies { Bell Laboratories, 1000 E. Warrenville Road, Naperville, IL 60566, U.S.A.Email: [email protected].
exploration verication techniques is the often excessive size of the state space. Obviously, this state-explosion problem is even more critical when the state space being explored is innite.
In contrast with the last observation, we show in this paper that verication by state-space exploration is also possible for systems with innite state spaces. Specically, we consider communication protocols modeled by a nite set of nite-state machines that communicate by exchanging messages via unbounded FIFO queues. We present a state-space exploration algorithm for constructing a nite and exactrepresentation of the state space of such a communication protocol, even if its state space is innite. From this symbolic representation, it is then straightforward to verify many properties of the protocol, such as the absence of deadlocks, whether or not the number of messages stored in a queue is bounded, and the reachability of local and global states.
Of course, given an arbitrary protocol, our algorithm may not terminate its search. Indeed, it is well-known that unbounded queues can be used to simulate the tape of a Turing machine, and hence that most interesting verication problems are undecidable for this class of systems [8]. However, in practice, these verication problems may very well turn out to be decidable for a subclass containing most \real" protocols. To support this claim, properties of several communication pro-tocols with innite state spaces have been veried successfully with the algorithm introduced in this paper.
In the next section, we formally dene communication protocols. Our algorithm performs a loop-rst search in the state space of the protocol being analyzed. A loop-rst search is a search technique that attempts to explore rst the results of successive executions of loops in the protocol description (code). This search technique is presented in Section 3. A new data structure, the Queue-content Decision Diagram (QDD), is introduced in Section 4 for representing (possibly innite) sets of queue-contents. Operations for manipulating QDDs during a loop-rst search are presented in Section 5. A loop-loop-rst search using QDDs has been implemented, and experiments on several communication protocols with innite state spaces are reported in Section 6. This paper ends with a comparison between our contributions and related work.
2. Communicating Finite-State Machines
Consider a protocol modeled by a nite setM of nite-state machines that
com-municate with each other by sending and receiving messages via a nite set Qof unbounded FIFO queues, modeling communication channels. Let Mi denote the
set of messages that can be stored in queue qi, 1i jQj. For notational
con-venience, let us assume that the sets Mi are pairwise disjoint. Let Ci denote the
nite set of states of machineMi, 1ijMj.
Formally, a protocolP is a tuple (C;c0;A;Q;M;T) where C=C1
C jMj
is a nite set of control states,c0
2C is an initial control state,A is a nite set of
actions,Qis a nite set of unbounded FIFO queues,M =[ jQj
i=1Mi is a nite set of
(c1;op;c2) wherec1and c2 are control states, andopis a label of one of the forms qi!w, where qi 2 Q and w 2 M i, qi?w, where qi 2 Qand w 2 M i, or a, where a2A.
A transition of the form (c1;qi!w;c2) represents a change of the control state
from c1 to c2 while appending the messages composingw to the end of queueqi.
A transition of the form (c1;qi?w;c2) represents a change of the control state from
c1 toc2 while removing the messages composingwfrom the head of queueqi.
A global state of a protocol is composed of a control state and a queue-content. A queue-content associates with each queue qi a sequence of messages fromMi.
Formally, a global state , or simply a state, of a protocol is an element of the setC1 C jMj M 1 M jQj. A global state = (c(1);c(2);:::;c( jMj);w(1);w(2);
:::;w(jQj)) assigns to each nite-state machineMi a \local" (control) statec(i)2
Ci, and associates with each queueqj a sequence of messagesw(j) 2 M
j which
represents the content of qj in the global state . The initial global state of the
system is 0 = (c0(1);c0(2);:::;c0(
jMj);";:::;"), i.e., we assume that all queues
are initially empty.
A global transition relation ! is a set of triples ( ;a;
0), where and 0 are
global states, and a2A[fg. Let
a ! 0 denote ( ;a; 0) 2 !. Relation! is dened as follows: if (c 1;qi!w;c2) 2T, then (c 1(1);c1(2);:::;c1( jMj);w 0(1);w0(2);:::;w0( jQj)) ! (c2(1);c2(2);:::;c2( jMj);w 00(1);w00(2);:::;w00( jQj)) wherew 00(i) =w0(i)wand w00(j) =w0(j); j 6
=i(the control state changes fromc1toc2andwis appended
to the end of queueqi);
if (c 1;qi?w;c2) 2T, then (c 1(1);c1(2);:::;c1( jMj);w 0(1);w0(2);:::;w0( jQj)) ! (c2(1);c2(2);:::;c2( jMj);w 00(1);w00(2);:::;w00( jQj)) wherew 0(i) =ww00(i) and w00(j) =w0(j); j 6
=i(the control state changes fromc1 toc2 andwis removed
from the head of queueqi);
if (c 1;a;c2) 2T, then (c 1(1);c1(2);:::;c1( jMj);w 0(1);w0(2);:::;w0( jQj)) a ! (c2(1);c2(2);:::;c2( jMj);w 00(1);w00(2);:::;w00( jQj)) withw 00(i) =w0(i), for all
1 i jQj (the control state changes from c
1 to c2 while the action a is
performed).
A global state 0is said to be reachable from another global state if there exists
a sequence of global transitions ( i 1;ai; i), 1
i n, such that = 0 a1 ! 1 n 1 an ! n =
0. The global state space of a system is the (possibly innite)
set of all states that are reachable from the initial global state 0.
Example: As an example of communication protocol, consider the well-known Alternating-Bit Protocol [6]. This protocol can be modeled by two nite-state machines Sender and Receiver that communicate via two unbounded FIFO queues StoR(used to transmit messages from the Sender to the Receiver) and RtoS (used to transmit acknowledgments from the Receiver to the Sender).
Precisely, the Alternating-Bit Protocol is modeled by the protocol (C;c0;A;Q;M;
2 3 4 5 6 7 8 9 10 1 1 2 3 4 5 6 7 8 RtoS?ack0 RtoS?ack1 StoR!msg0 timeout StoR!msg0 Snd StoR!msg1 Snd StoR!msg0 RtoS?ack1 StoR!msg1 RtoS?ack0 timeout StoR!msg1 StoR?msg0 StoR?msg1 RtoS!ack1 RtoS!ack0 Rcv Rcv StoR?msg1 RtoS!ack1 StoR?msg0 RtoS!ack0 SENDER RECEIVER
Figure 1. Alternating-Bit Protocol
and CReceiver = f1;2;3;4;5;6;7;8g; c
0 = (1;1); A =
fSnd;Rcv;timeoutg; Q = fStoR;RtoSg;M =MStoR[MRtoS, whereMStoR=fmsg0;msg1gandMRtoS= fack0;ack1g; andT contains the transitions ((s
1;r1);op;(s2;r2)) where eitherr1=
r2and (s1;op;s2) is a transition in the Sender machine of Figure 1, ors1=s2and
(r1;op;r2) is a transition in the Receiver machine of Figure 1. The actionSnd
mod-els a request to the Sender, coming from a higher-level application, to transmit data to the Receiver side. The actual data that are transmitted are not modeled, only message numbersmsg0 andmsg1 are transmitted over the queues. Similarly, the actionRcvmodels the transmission of data received by the Receiver to a higher-level application. The actions labeled by timeoutmodel the expiration of timeouts.
3. Loop-First Search
All state-space exploration techniques are based on a common principle: they spread the reachability information along the transitions of the system to be ana-lyzed. The exploration process starts with the initial global state of the system, and tries at every step to enlarge its current set of reachable states by propagating these states through transitions. The process terminates when a stable set is reached.
In order to use the above state-space exploration paradigm for verifying properties of systems with innite state spaces, two basic problems need to be solved: one needs a representation for innite sets of states, as well as a search technique that can explore an innite number of states in a nite amount of time.
In the context of the verication of communication protocols as dened in the previous section, our solution to the rst problem is to represent the control part explicitly and the queue-contents \symbolically". Specically, we will use special data structures for representing (possibly innite) sets of queue-contents associated with reachable control states.
To solve the second problem, we will use these data structures for simultaneously exploring (possibly innite) sets of global states rather than individual global states. This may make it possible to reach a stable representation of the set of reachable global states, even if this set is innite. In order to simultaneously generate sets of reachable states from a single reachable state, meta-transitions [7] can be used. Given a loop that appears in the protocol description and a control statecin that loop, a meta-transition is a transition that generates all global states that can be reached after repeated executions of the body of the loop. By denition, all these global states have the same control statec.
The classical enumerative state-space exploration algorithm can then be rewritten in such a way that it works with sets of global states, i.e., pairs of the formhcontrol
state, data structurei, rather than with individual states. Initially, the search
starts from an initial global state. At each step during the search, whenever meta-transitions are executable, they are explored rst, which is a heuristic aimed at generating many reachable states as quickly as possible. This is why we call such a search a loop-rst search. The search terminates if the representation of the set of reachable states stabilizes. This happens when, for every control state, every new deducible queue-content is included in the current set of queue-contents associated with that control state. At this moment, the nal set of pairshcontrol state, data
structureirepresents exactly the state space of the protocol being analyzed.
In order to apply the verication method described above, we need to dene a data structure for representing (possibly innite) sets of queue-contents, and algorithms for manipulating these data structures. Specically, whenever a transition or a meta-transition is executed from a pairhcontrol state, data structureiduring a
loop-rst search, the new pairhcontrol state, data structureiobtained after the execution
of this (meta-)transition has to be determined. Therefore, from any given such data structure, one needs to be able to compute a new data structure representing the eect of sending messages to a queue (qi!w) and receiving messages from a queue
(qi?w), as well as the result of executing frequent types of meta-transitions, such
as repeatedly sending messages on a queue ((qi!w)), repeatedly receiving messages
from a queue ((qi?w)), and repeatedly receiving the sequence of messagesw 1 from
a queueqi followed by sending another sequence of messagesw2on another queue
qj, i6=j, ((qi?w
1;qj!w2)
). Finally, basic operations on sets are also needed, such
as checking if a set of queue-contents is included in another set, and computing the union of two sets of queue-contents.
4. Queue-content Decision Diagrams
Queue-content Decision Diagrams (QDDs) are data structures that satisfy all the constraints listed in the previous section. A QDD is a special type of nite-state
automaton on nite words. A nite-state automaton on nite words is a tuple
A= (;S;;s0;F), where is an alphabet (nite set of symbols),S is a nite set
of states, S([f"g)Sis a transition relation ("denotes the empty word),
s0
2 S is the initial state, and F S is a set of accepting states. A transition
(s;a;s0) is said to be labeled by a. A nite sequence (word) w = a
1a2:::an of
symbols in is accepted by the automaton A if there exists a sequence of states
= s0:::sn such that
81 i n : (si
1;ai;si)
2 , and sn 2 F. The set of
words accepted byAis called the language accepted by A, and is denoted byL(A). Let us dene the projectionwjM
i of a wordwon a setMi as the subsequence ofw
obtained by removing all symbols in wthat are not inMi. An automaton is said
to be deterministic if it does not contain any transition labeled by the empty word, and if for each state, all the outgoing transitions are labeled by dierent symbols.
Precisely, QDDs are dened as follows.
Denition 1. A QDDAfor a protocolPis a deterministic nite-state automaton (M;S;;s0;F) on nite words such that
8w2L(A) :w=wjM 1w jM 2:::w jM n:
A QDD is associated with each control state reached during a loop-rst search, and represents a set of possible queue-contents for this control state. Each word
w accepted by a QDD denes one queue-content wjM
i for each queue qi in the
protocol.
By Denition 1, a total order<is implicitly dened on the set Qof all queues
qi in the protocol such that, for all QDDs for this protocol, transitions labeled
by messages inMi always appear before transitions labeled by messages in Mj if
i < j. Therefore, for all QDDs for a protocol, a given queue-content can only be represented by one unique word. In other words, Denition 1 implicitly denes a \canonical" representation for each possible queue-content. Note that this does not imply that QDDs are canonical representations for sets of queue-contents.
5. Operations on QDDs
Standard algorithms on nite-state automata on nite words can be used for check-ing if the language accepted by a QDD is included in the language accepted by another QDD, for computing the union of QDDs, etc. (e.g., see [18]). In what fol-lows,A1
[A
2 will denote an automaton that accepts the languageL(A1) [L(A
2),
while DETERMINIZE(A) will denote a deterministic automaton that accepts the language L(A). We will write \Add (s;w;s0) to " to mean that transitions
(si 1;ai;si), 1
in, such thatw=a
1a2:::an,s0=s,sn =s 0, ands
i;1i < n,
are new (fresh) states, are added to .
We now describe how to perform the other basic operations on QDDs listed in Section 3.
Let A be the QDD associated with a given control state c. Let L(A) denote the language accepted by A, and let Lop(A) denote the language that has to be
SEND(queue idi, wordw, QDD (M;S;;s0;F)) f
For all states s2S such that 9w 0 2([ i j=1M j) :s 0 w 0 )s,
do the following operations:
Add a new states 0 toS; For all transitionst= (s;m;s
00)
2 such thatm2M j;j > i:
Replacetby (s0;m;s00); For all transitionst= (s
00;m;s) 2 such thatm2M j;j > i: Replacetby (s00;m;s0); Add (s;w;s 0) to ; Ifs2F, adds
0 toF, and removesfromF;
Return DETERMINIZE((M;S;;s0;F)). g
RECEIVE(queue idi, wordw, QDD (M;S;;s0;F)) f
For all states s2S such that 9w 0 2([ i 1 j=1M j) :s 0 w 0 )s,
do the following operations:
Add a new states 0 toS; For all transitionst= (s;m;s
00)
2 such thatm2M j;j
i:
Replacetby (s0;m;s00); For all transitionst= (s
00;m;s)
2 such thatm2M j;j
i:
Replacetby (s00;m;s0); For all statess
00 2Ssuch thats 0 w )s 00: Add a transition (s;";s00) to ; Ifs2F, adds
0 toF, and removesfromF;
Return DETERMINIZE((M;S;;s0;F)). g Figure 2. q i! wandq i? w
associated with the control state c0 reached after the execution of a transition
(c;op;c0) from the control statec, withop
2fqi!w;qi?wg. We have the following: Lq i!w(A) = fw 00 j9w 0 2L(A) :w 00 jM i =w 0 jM iw ^8j6=i:w 00 jM j =w 0 jM j g; Lq i?w(A) = fw 00 j9w 0 2L(A) :w 0 jM i=ww 00 jM i ^8j6=i:w 00 jM j =w 0 jM j g:
Algorithms for computing a QDD A0 that accepts all possible queue-contents
A= (M;S;;s0;F) are given in Figure 2. The correctness of these algorithms is
established by the following two theorems.
Theorem 1 LetA be a QDD, let A0 denote the automaton returned by SEND(i,
w,A), and let L(A0) denote the language accepted by A0. Then A0 is a QDD such
that L(A0) =L
qi !w(A).
Proof:
See Appendix.Theorem 2 LetAbe a QDD, letA0denote the automaton returned by RECEIVE(i,
w,A), and let L(A0) denote the language accepted by A0. Then A0 is a QDD such
that L(A0) =L
qi?w(A).
Proof:
See Appendix.We now consider the meta-transitions discussed in Section 3. The operation (qi!w) denotes the union of all possible queue-contents obtained after sending k
sequences of messagesw 2M
i to the queue qi of the system, for all k 0. The
operation (qi?w) denotes the union of all possible queue-contents obtained after
receiving k sequences of messages w 2 M
i from the queue qi of the system, for
all k 0. The operation (qi?w
1;qj!w2)
denotes the union of all possible
queue-contents obtained after receivingksequences of messagesw1
2M
i from the queue
qiand sendingksequences of messagesw2
2M
j to the queueqj, for allk0, and
fori6=j.
Let A be the QDD associated with a given control state c. Let L(A) denote the language accepted by A, and let Lop(A) denote the language that has to be
associated with the control statec reached after the execution of a meta-transition (c;op;c) withop2f(qi!w)
;(q
i?w);(q
i?w1;qj!w2)
g. We have the following:
L (qi!w) (A) =fw 00 j9w 0 2 L(A);k 0 : w 00 jM i =w 0 jM iw k^8j 6=i :w 00 jM j = w0 jM j g; L (q i ?w) (A) =fw 00 j9w 0 2L(A);k 0 : w 0 jM i =w kw00 jM i ^8j 6=i :w 00 jM j = w0 jM j g; L (q i ?w 1 ;q j !w 2 ) (A) = fw 00 j9w 0 2 L(A);k 0 : w 0 jM i = w k 1w 00 jM i ^w 00 jM j = w0 jM jw k 2 ^8l62fi;jg:w 00 jM l=w 0 jM l g:
Algorithms for computing a QDD A0 that accepts all possible queue-contents
obtained after the execution of a meta-transition of the form (qi!w), (q
i?w), or
(qi?w1;qj!w2)
on a QDDA= (M;S;;s
0;F) are given in Figures 3 and 4. The
correctness of these algorithms is established by the following theorems.
Theorem 3 Let A be a QDD, let A0 denote the automaton returned by
SEND-STAR(i, w, A), and let L(A0) denote the language accepted by A0. Then A0 is a
QDD such thatL(A0) =L (q
i !w)
(A).
Proof:
See Appendix.SEND-STAR(queue idi, wordw, QDD (M;S;;s0;F)) f
For all states s2S such that 9w 0 2([ i j=1M j) :s 0 w 0 )s,
do the following operations:
Add two new statess
0 ands00 toS; For all transitionst= (s;m;s
000)
2 such thatm2M j;j > i:
Replacetby (s00;m;s000); For all transitionst= (s
000;m;s) 2 such thatm2M j;j > i: Replacetby (s000;m;s00); Add (s;";s 0), (s0;";s00) and (s0;w;s0) to ; Ifs2F, adds 00 toF; Return DETERMINIZE((M;S;;s0;F)). g RECEIVE-STAR(queue idi, wordw, QDD (M;S;;s0;F)) f
For all states s2S such that 9w 0 2([ i 1 j=1M j) :s 0 w 0 )s,
do the following operations:
Add a new states 0 toS; For all transitionst= (s;m;s
00)
2 such thatm2M j;j
i:
Replacetby (s0;m;s00); For all transitionst= (s
00;m;s)
2 such thatm2M j;j
i:
Replacetby (s00;m;s0); For all statess
00 2Ssuch that9w 0 2fwg :s0 w 0 )s 00: Add a transition (s;";s00) to ; Ifs2F, adds 0 toF; Return DETERMINIZE((M;S;;s0;F)). g Figure 3. (q i! w) and ( q i? w)
RECEIVE-SEND-STAR(queue id i, word w1, queue id j, word w2, QDD (M;S;
;s0;F)) f
Letnbe the greatest integer such that
9s 1;:::sn+1 2S:s 1 w 1 )s 2 w 1 ) w 1 )s n+1; with81k < ln+ 1 :s k 6 =sl;
LetA0 denote the QDD (M;S;;s0;F);
For allk, 1kn+ 1, computeA
k= SEND(j;w2, RECEIVE(i;w1;Ak 1));
IfL(An+1) = ;: Return DETERMINIZE([ n k =0A k); IfL(An+1) 6 =;: Letp= 1; WhileL(A n+1) 6 =L(RECEIVE(i;wp 1;A n+1)): p:=p+ 1;
For all k, 2 k p, compute A
n+k = SEND(j;w2, RECEIVE(i; w1;A n+k 1)); ComputeA n+p+1=SEND-STAR(j;w p 2;DETERMINIZE( [ n+p k =n+1A k)); Return DETERMINIZE([ n+p+1 k =0 A k). g Figure 4. (q i? w 1; q j! w 2)
Theorem 4 LetAbe a QDD, letA0 denote the automaton returned by
RECEIVE-STAR(i, w, A), and let L(A0) denote the language accepted by A0. Then A0 is a
QDD such thatL(A0) =L (q
i ?w)
(A).
Proof:
See Appendix.Lemma 1 LetnandAn+1be as dened in the algorithm RECEIVE-SEND-STAR(i;
w1;j;w2;A), withi
6
=j. If the language accepted by An+1 is not empty, then there
existspsuch that0< p(n+ 1)!, and L(An
+1) =L(RECEIVE(i;w
p
1;An +1)).
Proof:
See Appendix.Theorem 5 LetAbe a QDD, letA0 denote the automaton returned by
RECEIVE-SEND-STAR(i, w1, j, w2, A), , with i
6
= j, and let L(A0) denote the language
accepted byA0. Then A0 is a QDD such thatL(A0) =L (qi?w1;q
j !w2)
(A).
Proof:
See Appendix.It is worth noticing that, as a corollary of the last theorem, we have that the languageL(qi?w1;q
j !w2)
(A) is regular.
6. Experimental Results
Consider again the Alternating-Bit protocol of Example . Meta-transitions are added to the protocol description for loops that match either (qi!w), (q
i?w), or
(qi?w1;qj!w2)
. Precisely, the meta-transitions (3;(RtoS?ack1;StoR!msg0);3),
(3;(StoR!msg0);3), (8;(RtoS?ack0;StoR!msg1);8) and (8;(StoR!msg1);8) are
added to the set of transitions of Sender, and the meta-transitions (1;(StoR?msg1;
RtoS!ack1);1) and (5;(StoR?msg0;RtoS!ack0);5) are added to the set of
tran-sitions of Receiver.
We have implemented (in C) a \QDD-package" containing an implementation of the algorithms for manipulating QDDs described in the previous section, and we have combined it with a loop-rst search. Starting with the control state (1;1) and the QDD (M;fs 0 g;fg;s 0; fs 0
g), which corresponds to the queue-content"for both
queuesStoRandRtoS, the execution of the loop-rst search for the Alternating-Bit protocol terminates after 5.9 seconds of computation on a SPARC10 workstation. The number of (meta-)transitions executed is 331. The largest QDD constructed during the search contains 21 states, and 52 control states are reachable from the initial state.
Many properties can be checked on the symbolic representation of the state space of the protocol obtained at the end of the search. For instance, it is then straight-forward to prove that the protocol does not contain any deadlocks, that there are reachable control states where the number of messages in a queue is unbounded, that messages are always delivered in the correct order, etc.
Our tool has also been tested on several variants of the Alternating-Bit protocol, where the transitions labeled by \timeout" are removed from the protocol
descrip-tion, where the Sender/Receiver have various number of control states, etc. An interesting variant is the case where queues may lose messages (to model unreli-able transmission media). In order to handle this case, it is sucient to dene one additional algorithm SEND-LOSSY(i,w,A), that merely returnsA[SEND(i,w,
A). We also performed experiments on several simple sliding-window protocols [26], with various window sizes. For all these examples with innite state spaces (more than 20 in total), our tool was able to successfully terminate its search within a few minutes of computation. This shows that, at least for this particular though important class of examples, our verication method is very useful and robust.
7. Comparison with Other Work and Conclusions
Although most verication problems are undecidable for arbitrary protocols mod-eled by communicating nite-state machines, decision procedures have been ob-tained for the verication of specic properties for limited sub-classes [2, 3, 10, 11, 12, 13, 15, 16, 24, 25]. These sub-classes do not cover, e.g., the Alternating-Bit Protocol and the properties discussed in the previous section, which were easily veried using a loop-rst search and QDDs.
Clearly, a necessary, but not sucient, condition for the termination of our al-gorithm is that, for all reachable control states of the protocol, the language of queue-contents associated with that control state can be represented by a QDD. The class of protocols characterized by the above necessary condition is equivalent to the class of protocols for which, for each reachable control state of the protocol, the set of possible queue-contents can be described by a recognizable expression (i.e., a nite union of Cartesian products of regular expressions). Indeed, it can be shown that any recognizable language can be represented by a QDD, and that any set of queue-contents represented by a QDD is a recognizable language.
In [20], it is pointed out that several verication problems are decidable for the above class of protocols. However, no method is given for constructing a recogniz-able expression representing all possible queue-contents for each control state of the protocol. Actually, from [11], it is easy to show that an algorithm for constructing such recognizable expressions, for any protocol in the class dened above, cannot exist. In contrast, our contribution is to provide a practical algorithm which is able to compute such a representation for protocols in the above class, although not for all of them { this is impossible anyway.
In this paper, we have presented algorithms on QDDs for computing the eect of executing three frequent types of meta-transitions. These algorithms were su-cient for analyzing the protocols considered in the previous section. However, it is possible to design algorithms on QDDs for other types of meta-transitions as well. Interesting future work is to characterize precisely the set of meta-transitions that preserve recognizability and to provide a generic algorithm for computing the eect of the execution of any meta-transition in this class. These topics will be addressed in a forthcoming paper.
In [21], a verication method based on data- ow analysis is used to generate \ ow equations" from the description of a set of communicating nite-state machines. By
computing approximations of solutions for these equations, it is possible to show that the original system is free of certain types of errors. In contrast, our algorithm is able to produce an exact representation of the state space of the protocol being analyzed. This enables us not only to prove the absence of errors, but also to detect errors and to exhibit to the user sequences of transitions that lead to errors. Note that, obviously, approximations could also be used in our framework, e.g., for simplifying QDDs when they become too complex, or when the search does not seem to stop. For the examples we have considered so far, no approximations were necessary.
The idea of representing states partly explicitly (control part) and partly symbol-ically (data part) already appeared in [1] for the verication of real-time systems, where dense-time domains are represented by polyhedra. This idea also appeared in [7], where the values of integer variables are represented by periodic vector sets. These symbolic representations are quite dierent from QDDs.
For digital hardware verication [4], the most commonly used symbolic repre-sentation is certainly the Binary Decision Diagram (BDD) [5], which represents a boolean function (with a nite domain) as a directed acyclic graph. In [14], it is shown how QDDs can be combined with BDDs to improve the eciency of classical BDD-based symbolic model-checking methods for verifying properties of communication protocols with large nite state spaces.
Acknowledgments
We wish to thank Michael Merritt and Mark Staskauskas for helpful comments on a preliminary version of this paper.
References
1. R. Alur, C. Courcoubetis, and D. Dill. Model-checking in dense real-time.Information and Computation, 104(1):2{34, May 1993.
2. P. A. Abdulla and B. Jonsson. Verifying programs with unreliable channels. InProceedings of the 8th IEEE Symposium on Logic in Computer Science, 1993.
3. P. A. Abdulla and B. Jonsson. Undecidable verication problems for programs with unreliable channels. InProc. ICALP-94, volume 820 ofLecture Notes in Computer Science, pages 316{ 327. Springer-Verlag, 1994.
4. J.R. Burch, E.M. Clarke, K.L. McMillan, D.L. Dill, and L.J. Hwang. Symbolic model check-ing: 1020 states and beyond. InProceedings of the 5th Symposium on Logic in Computer
Science, pages 428{439, Philadelphia, June 1990.
5. R.E. Bryant. Symbolic boolean manipulation with ordered binary-decision diagrams.ACM Computing Surveys, 24(3):293{318, 1992.
6. K. Bartlett, R. Scantlebury, and P. Wilkinson. A note on reliable full-duplex transmissions over half-duplex lines.Communications of the ACM, 2(5):260{261, 1969.
7. B. Boigelot and P. Wolper. Symbolic verication with periodic sets. InProc. 6th Conference on Computer Aided Verication, volume 818 ofLecture Notes in Computer Science, pages 55{67, Stanford, June 1994. Springer-Verlag.
8. D. Brand and P. Zaropulo. On communicating nite-state machines. Journal of the ACM, 2(5):323{342, 1983.
9. E.M. Clarke, E.A. Emerson, and A.P. Sistla. Automatic verication of nite-state concurrent systems using temporal logic specications.ACM Transactions on Programming Languages and Systems, 8(2):244{263, January 1986.
10. A. Choquet and A. Finkel. Simulation of linear FIFO nets having a structured set of terminal markings. InProc. 8th European Workshop on Application and Theory of Petri Nets, pages 95{112, Saragoza, 1987.
11. G. Cece, A. Finkel, and S. Purushothaman. Unreliable channels are easier to verify than perfect channels.Information and Computation, 124(3):20{31, 1996.
12. A. Finkel. A new class of analyzable cfsms with unbounded FIFO channels. InProc. 8th IFIP WG 6.1 International Symposium on Protocol Specication, Testing, and Verication, pages 1{12, Atlantic City, 1988. North-Holland.
13. M. G. Gouda, E. M. Gurari, T. H. Lai, and L. E. Rosier. On deadlock detection in systems of communicating nite-state machines.Computers and Articial Intelligence, 6(3):209{228, 1987.
14. P. Godefroid and D. E. Long. Symbolic Protocol Verication with Queue BDDs. In Pro-ceedings of the 11th IEEE Symposium on Logic in Computer Science, New Brunswick, July 1996.
15. T. Jeron. Testing for unboundedness of FIFO channels. InProc. STACS-91: Symposium on Theoretical Aspects of Computer Science, volume 480 ofLecture Notes in Computer Science, pages 322{333, Hamburg, 1991. Springer-Verlag.
16. R. M. Karp and R. E. Miller. Parallel program schemata.Journal of Computer and System Sciences, 3(2):147{195, 1969.
17. M.T. Liu. Protocol engineering.Advances in Computing, 29:79{195, 1989.
18. H. R. Lewis and C. H. Papadimitriou. Elements of the Theory of Computation. Prentice Hall, 1981.
19. O. Lichtenstein and A. Pnueli. Checking that nite state concurrent programs satisfy their linear specication. InProceedings of the Twelfth ACM Symposium on Principles of Pro-gramming Languages, pages 97{107, New Orleans, January 1985.
20. J. K. Pachl. Protocol description and analysis based on a state transition model with channel expressions. InProc. 7th IFIP WG 6.1 International Symposium on Protocol Specication, Testing, and Verication. North-Holland, 1987.
21. W. Peng and S. Purushothaman. Data ow analysis of communicating nite state machines. ACM Transactions on Programming Languages and Systems, 13(3):399{442, 1991. 22. J.P. Quielle and J. Sifakis. Specication and verication of concurrent systems in CESAR. In
Proc. 5th Int'l Symp. on Programming, volume 137 ofLecture Notes in Computer Science, pages 337{351. Springer-Verlag, 1981.
23. H. Rudin. Network protocols and tools to help produce them.Annual Review of Computer Science, 2:291{316, 1987.
24. L. E. Royer and H. C. Yen. Boundedness, empty channel detection and synchronization for communicating nite automata. Theoretical Computer Science, 44:69{105, 1986.
25. A. P. Sistla and L. D. Zuck. Automatic temporal verication of buer systems. InProc. 3rd Workshop on Computer Aided Verication, volume 575 ofLecture Notes in Computer Science, pages 93{103, Aalborg, July 1991. Springer-Verlag.
26. A. Tanenbaum.Computer Neworks. Prentice Hall, 1989.
27. M.Y. Vardi and P. Wolper. An automata-theoretic approach to automatic program verica-tion. InProceedings of the First Symposium on Logic in Computer Science, pages 322{331, Cambridge, June 1986.
Appendix
Correctness Proofs
Theorem 3 LetA be a QDD, let A0 denote the automaton returned by SEND(i,
w,A), and let L(A0) denote the language accepted by A0. Then A0 is a QDD such
that L(A0) =L
qi !w(A).
Proof:
Let us prove rst that Lq i
!w(A)
L(A
0). Let u be a word in L(A). Hence,
there exists a path = s0
m0 ! s 1 m1 ! mn 1 ! sn in A accepting u. Since u = ujM 1 ujM
N, contains exactly one state sl such that
8k < l : mk 2 [ij
=1Mj and
8k l : mk 2 [Nj
=i+1Mj. Therefore, sl is a state \s" that
satises the condition in line 3 of the algorithm, and the algorithm replaces the transition (sl;ml;sl+1) (if any) by (s
0;m
l;sl+1), where the states
0is a new state
added by the algorithm. Moreover, the algorithm also adds (sl;w;s0) to the set
of transitions of A. Since all sequences of transitions labeled by a symbol in
[Nj
=i+1Mjare preserved inA
0 (a new states0is associated to every intermediate
state s that satises the condition in line 3, and all the incoming (outgoing) transitions to (resp. from)s labeled by a symbol in[Nj
=i+1Mj are mapped to
transitions of same label to (resp. from) s0), before being determinized, the
resulting automaton contains the path0 =s 0 m0 ! ml 1 ! sl w!s 0 m l !s 0 l+1 ml+1 ! mn 1 ! s 0
n. In the case whereml 1 is the last transition of,slis accepting in
A, and is replaced bys0in the set of accepting states ofA0. In any case, the path
0 is accepting, and the automatonA0 acceptsu jM 1 ujM iwu jM i+1 ujM N. Now, we show thatL(A
0) Lq
i
!w(A). Letube a word inL(A
0), and letA00 be
the automaton obtained before the determinization operation givingA0. Since
the automataA0 andA00accept the same language,u 2L(A
00) and there exists
a path of A00 acceptingu. Let us show that is of the form
1(s;w;s 0)
2,
where1is composed only of transitions labeled by a symbol in [ij
=1Mj while
2 is composed only of transitions labeled by a symbol in [Nj
=i+1Mj.
Since1 leads froms0tosand is composed of transitions labeled by a symbol
in[ij
=1Mj, statessatises the condition on line 3 of the algorithm, and hence
cannot be accepting in A00. Moreover, there exists a transition (s;w;s0) inA00
added by the algorithm (at line 10). Since the algorithm does not perform any modication on transitions labeled by a symbol in[ij
=1Mj, all the transitions of
1are transitions inA. Since all sequences of transitions labeled by a symbol in [Nj
=i+1Mjare preserved inA
0 (a new states0is associated to every intermediate
state s that satises the condition in line 3, and all the incoming (outgoing) transitions to (resp. from)s labeled by a symbol in[Nj
=i+1Mj are mapped to
transitions of same label to (resp. from)s0), there exists in Aa path0 2 froms
corresponding to the same sequence of transitions as in2. Since the last state
of2 is accepting inA
00, the last state of0
2 is accepting inA. Thus, the word
v such that8k6=i:vjM k =u jM k andv jM iw=u jM i, is accepted byA.
Theorem 4 LetAbe a QDD, letA0denote the automaton returned by RECEIVE(i,
w,A), and let L(A0) denote the language accepted by A0. Then A0 is a QDD such
that L(A0) =L
qi?w(A).
Proof:
Let us prove rst thatLq i?w(A)
L(A
0). Let u=u
1wu2 be a word in L(A),
withu1(resp. u2) only composed of symbols in [i 1 j=1Mj(resp. [Nj =iMj). There exists a path = s0 m0 ! s 1 m1 ! mn 1 ! sn in A accepting u. Since u = ujM 1 ujM
N, contains exactly one statesl such that
8k < l:mk 2[i 1
j=1Mj
and 8k l : mk 2 [Nj
=iMj. Therefore, sl is a state \s" that satises the
condition in line 3 of the algorithm, and the algorithm replaces the transition (sl;ml;sl+1) by (s
0;m
l;sl+1), where the state s
0 is a new state added by the
algorithm. Moreover, it follows from the denition ofuthat contains exactly one statesp such thatsl w)sp. The statesp satises the condition at line 10 of
the algorithm, hence the algorithm adds (s;";sp) to the set of transitions ofA.
Since all sequences of transitions labeled by a symbol in[Nj
=iMj are preserved
inA0(a new states0is associated to every intermediate statesthat satises the
condition in line 3, and all the incoming (outgoing) transitions to (resp. from)
s labeled by a symbol in [Nj
=iMj are mapped to transitions of same label to
(resp. from)s0), before being determinized, the resulting automaton contains
the path0 =s 0 m0 ! ml 1 ! sl "!sp mp ! s 0 p+1 mn 1 ! s 0
n. Since the path 0 is
accepting, the automatonA0 accepts the wordu 1u2. Now, we show thatL(A
0) Lq
i?w(A). Letube a word inL(A
0), and letA00 be
the automaton obtained before the determinization operation givingA0. Since
the automataA0 andA00accept the same language,u 2L(A
00) and there exists
a path of A00 accepting u. Let us show that is of the form
12, where
1 is composed only of transitions labeled by a symbol in [
i 1
j=1Mj while 2 is
composed only of transitions labeled by a symbol in[Nj =iMj.
Since1 leads froms0tosand is composed of transitions labeled by a symbol
in[i 1
j=1Mj, statessatises the condition on line 3 of the algorithm, and hence
cannot be accepting inA00. Moreover, the only outgoing transition fromsnot
labeled by a symbol in [i 1
j=1Mj can only be a transition (s;";s
00) added by
the algorithm (at line 11), with s )w s
00 in A. Since the algorithm does not
perform any modication on transitions labeled by a symbol in[i 1
j=1Mj, all the
transitions of1 are transitions inA. Since all sequences of transitions labeled
by a symbol in[Nj
=iMjare preserved inA
0(a new states0 is associated to every
intermediate statesthat satises the condition in line 3, and all the incoming (outgoing) transitions to (resp. from) s labeled by a symbol in [Nj
=iMj are
mapped to transitions of same label to (resp. from)s0), there exists inAa path
0 2froms
00corresponding to the same sequence of transitions as in
last state of2 is accepting inA
00, the last state of0
2 is accepting inA. Thus,
the wordv such that8k 6=i:vjM k =u jM k and v jM i =wu jM i, is accepted by A.
Theorem 5 Let A be a QDD, let A0 denote the automaton returned by
SEND-STAR(i, w, A), and let L(A0) denote the language accepted by A0. Then A0 is a
QDD such thatL(A0) =L (qi!w)
(A).
Proof:
Let us prove rst that L (q
i !w)
(A)L(A
0). Letube a word inL(A). Hence,
there exists a path = s0
m0 ! s 1 m1 ! mn 1 ! sn in A acceptingu. Since u= ujM 1 ujM
N, contains exactly one statesl such that
8k < l:mk 2[ij =1Mj
and 8k l : mk 2 [Nj
=i+1Mj. Therefore, sl is a state \s" that satises the
condition in line 3 of the algorithm, and the algorithm replaces the transition (sl;ml;sl+1) (if any) by by (s
00;m
l;sl+1), where the state s
00 is a new state
added by the algorithm. Moreover, the algorithm also creates another new state s0 and adds the transitions (s
l;";s0), (s0;";s00) and (s0;w;s0) to the set
of transitions of A. Since all sequences of transitions labeled by a symbol in
[Nj
=i+1Mjare preserved inA
0(a new states00is associated to every intermediate
state s that satises the condition in line 3, and all the incoming (outgoing) transitions to (resp. from) s labeled by a symbol in [Nj
=i+1Mj are mapped
to transitions of same label to (resp. from) s00), before being determinized,
the resulting automaton contains the path 0 = s 0 m0 ! ml 1 ! sl "! s 0 " ! s00 m l ! s 0 l+1 ml+1 ! mn 1 ! s 0
n. In the case whereml 1 is the last transition of
, sl is accepting in A, and is replaced by s00 in the set of accepting states of
A0. In any case, the path 0 is accepting. Let k
0 be an arbitrary integer.
Since the set of transitions of A0 contains the transition (s0;w;s0), the path
0 k = s0 m0 ! ml 1 ! sl "! s 0 w k ! s 0 " ! s 00 m l ! s 0 l+1 ml+1 ! mn 1 ! s 0 n is also an
accepting path ofA0. It follows that for anyk
0, the automatonA 0 accepts ujM 1 ujM iw kujM i+1 ujM N. Now, we show that L(A
0) L (q i !w) (A). Let ube a word in L(A 0), and let
A00 be the automaton obtained before the determinization operation givingA0.
Since the automata A0 and A00 accept the same language, u
2 L(A 00) and
there exists a path of A00 accepting u. Let us show that is of the form
1 or1(s;";s
0)(s0;w;s0)k(s0;";s00)
2, where1is composed only of transitions
labeled by a symbol in [ij
=1Mj,
2 is composed only of transitions labeled by
a symbol in[Nj
=i+1Mj, and k 0.
Since1 leads froms0tosand is composed of transitions labeled by a symbol
in[ij
=1Mj, statessatises the condition on line 3 of the algorithm. Moreover,
(at line 10). Since the algorithm does not perform any modication on transi-tions labeled by a symbol in [ij
=1Mj, all the transitions of
1 are transitions
in A. Moreover, if 1 is an accepting path in A
00, then it is also an accepting
path inA. Hence, if =1, thenu
2L(A). Let us assume now that 6= 1.
Since all sequences of transitions labeled by a symbol in[Nj
=i+1Mjare preserved
in A0 (a new state s00 is associated to every intermediate states that satises
the condition in line 3, and all the incoming (outgoing) transitions to (resp. from) s labeled by a symbol in [Nj
=i+1Mj are mapped to transitions of same
label to (resp. from) s00), there exists in A a path0
2 from scorresponding to
the same sequence of transitions as in2. Since the last state of2 is
accept-ing in A00, the last state of 0
2 is accepting inA. Thus, the wordv such that 8j6=i:vjM j =u jM j andv jM iw k=ujM i, is accepted byA.
Theorem 6 LetAbe a QDD, letA0 denote the automaton returned by
RECEIVE-STAR(i, w, A), and let L(A0) denote the language accepted by A0. Then A0 is a
QDD such thatL(A0) =L (qi?w)
(A).
Proof:
Let us prove rst that L (qi?w) (A) L(A 0). Let u = u 1w ku 2 be a word in
L(A), withu1(resp. u2) only composed of symbols in [i
1
j=1Mj (resp. [Nj
=iMj),
andk0. There exists a path =s 0 m0 ! s 1 m1 ! mn 1 ! sn in Aacceptingu. Sinceu=ujM 1 ujM
N,contains exactly one stateslsuch that
8k < l:mk2 [i
1
j=1Mjand
8kl:mk 2[Nj
=iMj. Therefore,slis a state \s" that satises the
condition in line 3 of the algorithm, and the algorithm replaces the transition (sl;ml;sl+1) by (s
0;m
l;sl+1), where the state s
0 is a new state added by the
algorithm. Moreover, it follows from the denition ofuthat contains exactly one statespsuch thatsl wk
)sp. The statesp satises the condition at line 10 of
the algorithm, hence the algorithm adds (s;";sp) to the set of transitions ofA.
Since all sequences of transitions labeled by a symbol in[Nj
=iMj are preserved
inA0(a new states0is associated to every intermediate statesthat satises the
condition in line 3, and all the incoming (outgoing) transitions to (resp. from)
s labeled by a symbol in [Nj
=iMj are mapped to transitions of same label to
(resp. from)s0), before being determinized, the resulting automaton contains
the path0 =s 0 m0 ! ml 1 ! sl "!sp mp ! s 0 p+1 mn 1 ! s 0
n. Since the path 0 is
accepting, the automatonA0 accepts the wordu 1u2. Now, we show thatL(A
0) Lq
i?w(A). Letube a word inL(A
0), and letA00 be
the automaton obtained before the determinization operation givingA0. Since
the automataA0 andA00accept the same language,u 2L(A
00) and there exists
a pathofA00acceptingu. Let us show thatis of the form
1or12, where
1 is composed only of transitions labeled by a symbol in [i
1
j=1Mj while 2 is
composed only of transitions labeled by a symbol in[Nj =iMj.
Since1leads froms0tosand is composed of transitions labeled by a symbol in [i
1
j=1Mj, statessatises the condition on line 3 of the algorithm. Moreover, the
only outgoing transition fromsnot labeled by a symbol in[i 1
j=1Mj can only be
a transition (s;";s00) added by the algorithm (at line 11), withsw k )s
00inA, and
k 0. Since the algorithm does not perform any modication on transitions
labeled by a symbol in[i 1
j=1Mj, all the transitions of
1 are transitions in A.
Moreover, if 1 is an accepting path in A
00, then it is also an accepting path
in A. Hence, if = 1, then u
2 L(A). Let us assume now that 6= 1.
Since all sequences of transitions labeled by a symbol in[Nj
=iMj are preserved
in A0 (a new state s0 is associated to every intermediate state s that satises
the condition in line 3, and all the incoming (outgoing) transitions to (resp. from)slabeled by a symbol in[Nj
=iMjare mapped to transitions of same label
to (resp. from) s0), there exists inA a path 0
2 from s
00 corresponding to the
same sequence of transitions as in 2. Since the last state of 2 is accepting
in A00, the last state of 0
2 is accepting in A. Thus, the word v such that 8j6=i:vjM j =u jM j andv jM i =w kujM i, is accepted byA.
Lemma 2 Letn and An+1 be as dened by the algorithm computing the value of
RECEIVE-SEND-STAR(i;w1;j;w2;A). If the language accepted by An+1 is not
empty, then there exists p >0 such that An+1 and RECEIVE(i;w
p
1;An
+1) accept
the same language.
Proof:
First, we prove that L(An +1)
L(RECEIVE(i;wp 1;An
+1)) for some p > 0.
Letwbe a word in L(An+1). For any such word, there existsw 0 2L(A) such that w0 jM i = w n+1 1 (w jM i), w jM j = (w 0 jM j)w n+1 2 , and 8k 62 fi;jg : wjM k = w0 jM k. Let s
0;s1;:::;sx be the path ofA acceptingw
0. It contains a subpath sy;sy+1;:::;sy+n+1 such thatsy w 1 )sy +1 w1 ) w1 )sy +n+1 ands0 w00 ) sy, with w00 =w0 jM 1 w 0 jM
i 1. By denition ofn, this subpath contains a loop, i.e.,
there existsz andlsuch thaty zy+n+ 1, 1nn+ 1, andsz
wl 1 )sz. We thus have8k 0 :w 0 jM 1 w 0 jM i 1w kl 1w 0 jM i w 0 jM N 2L(A). Choosing k= (n+1)!=l, we obtainw0 jM 1 w 0 jM i 1w (n+1)! 1 w 0 jM i w 0 jM N 2L(A), which implieswjM 1 wjM i 1w (n+1)! 1 w jM i wjM N 2L(An +1). By takingp= (n+1)!
and applying this result to all the wordswinL(An+1), it follows thatL(An+1)
L(RECEIVE(i;w1p;An +1)).
Now, we show that L(RECEIVE(i;w
p
1;An +1))
L(An
+1) for the same p =
(n+ 1)!. Let w 2 L(RECEIVE(i;w
p 1;An +1)). There exists w 0 2 L(A) such that w0 jM i = w p+n+1 1 w jM i, w jM j = w 0 jM jw n+1 2 , and 8k 62 fi;jg : wjM k = w0 jM k. Let s 0;s1;:::;sx be the path of A 0 acceptingw0. By denition of n,
this path contains a subpath sy;sy+1;:::;sz such that s0
w00
) sy, with w 00 =
w0 jM 1 w 0 jM
i 1, that begins withkoccurrences of a loop acceptingw
l
1, where
kandlare such thatk:lpandln+1. By removing exactlyp=loccurrences
of this loop from the path s0;s1;:::;sx, we obtain a path of A accepting the
wordw000 such thatw000 jM i =w n+1 1 w jM i,w jM j =w 000 jM jw n+1 2 , and 8k62fi;jg: wjM k =w 000 jM k. Therefore,w 2L(An +1).
Theorem 7 IfAis a QDD andA0is returned by RECEIVE-SEND-STAR(i;w 1;j;
w2;A), with i
6
=j, thenA0 is a QDD such that L(A0) = (q
i?w1;qj!w2)
(L(A)).
Proof:
Let n, p, fAkg be as dened by the algorithm computingRECEIVE-SEND-STAR. We have: (qi?w1;qj!w2) (L(A)) = 1 [ k=0 (qi?w1;qj!w2) k(L(A)) = [n k=0 (qi?w1;qj!w2) k(L(A)) [ 1 [ k=n+1 (qi?w1;qj!w2) k(L(A)) = [n k=0 L(Ak) [ 1 [ k=0 (qi?w1;qj!w2) k(L(An +1)): If L(An +1) = ;: We have (qi?w 1;qj!w2) (L(A)) = n [ k=0 L(Ak) =L(A0). If L(An +1) 6 =;: Asi 6=j, the operations qi?m
1 and qj!m2 commute. Hence,
we have: 1 [ k=0 (qi?w1;qj!w2) k(L(An +1)) = 1 [ i=0 p 1 [ j=0 (qi?w1;qj!w2) pi+j(L(A n+1)) = 1 [ i=0 p 1 [ j=0 (qj!w2) pi(qi?w 1;qj!w2) j(qi?w 1) pi(L(An +1)): By denition ofp, (qi?w1) pi(L(An +1)) =L(An+1). Thus, we have: 1 [ k=0 (qi?w1;qj!w2) k(L(An +1)) = 1 [ i=0 p 1 [ j=0 (qj!w2) pi(qi?w 1;qj!w2) j(L(An +1))
= 1 [ i=0 (qj!w2) pi 0 @ p 1 [ j=0 (qi?w1;qj!w2) j(L(An +1)) 1 A = (qj!wp2) 0 @ p 1 [ j=0 L(An+j+1) 1 A = L(An+p+1): Therefore, (qi?w1;qj!w2) (L(A)) = n [ k=0 L(Ak) [L(An +p+1). Since n+p [ k=n+1 L(Ak)L(An +p+1); we nally have (qi?w1;qj!w2) (L(A)) = n+p+1 [ k=0 L(Ak) = L(A0):