Theoretical
Elsevier
Computer
Science
365
134 (1994) 365-385
Some decision problems for parallel
communicating grammar systems
Ferucio Laurentiu
Cecilia Magdalena
Tiplea, Cristian Ene,
Ionescu and Octavian
Procopiuc zyxwvutsrqponmlkjihgfedcbaZ
Department of Computer Science, “Al.I. Cuza” University , RO - 6600 Iasi, Romania
Communicated
by A. Salomaa
Received March 1993
Revised October 1993
Abstract
Tiplea, F.L., C. Ene, C.M. Ionescu and 0. Procopiuc,
Some decision problems for parallel
municating
grammar systems, Theoretical Computer Science 134 (1994) 365-385.
com-
In this paper we investigate several decision problems for parallel communicating
grammar systems:
the enabling, circularity,
centralizing,
conflict-freeness,
boundedness,
membership,
equivalence,
inclusion, emptiness and finiteness problems. The first five problems are shown to be decidable for
context-free
PCS’s but undecidable
for the context-sensitive
case. The last five problems are only
studied for the context-sensitive
case and they are shown to be undecidable.
1. Introduction
The modelling of parallel processing remains one of the major challenges of the
Computer Science, both in theory and in practice. Many attempts have been made to
find a suitable model and many of them are based on automata and formal language
theory. For example, the Petri nets [19], the discrete event systems [lS], the cellular
automata [7], the systolic trellis automata [2] are models based on automata theory,
while the L-systems [20], the Russian and Indian parallel grammars [3], the cooperating grammar systems [lo], the cooperating/distributed
grammar systems Cl], the
parallel communicating
grammar systems [ 151 are grammatical
models. These models have been successfully used in a variety of domains, such as manufacturing,
database systems, robotics, vehicular traffic, air traffic control, logistic (conveyance
and storage
of goods, organisation
and delivery
of services), computer
and
Correspondence to: F.L. Tiplea,
Department
of Computer
Science, “AH. Cuza” University,
Romania.
0304-3975/94/$07.00
0 1994-Elsevier
SSDI 0304-3975(93)E0210-U
Science B.V. All rights reserved
RO-6600
Iasi,
366
F. Laurentiu
et al.
communication
network, parallel architectures,
developmental
systems, neuronal
systems, artificial intelligence, to name a few.
The increasing complexity of man-made systems, made possible by the widespread
application
of computer technology, has taken such systems to a level of complexity
where more detailed formal methods become necessary for their analysis and design. zyxwvutsrqponml
Parallel communicating grammar systems (PCS, for short) are a new model of the
parallel
processing [IS] and they are aimed to combine the notions of parallelism and
into a suitable model for theoretical investigations.
These systems have
evolved from the following considerations:
communication
l
knowledge processing systems are characterized
by an intimate cooperation
between logic and functional programming,
which requires an adequate communication discipline;
l
processing requirements
for knowledge based problem solving are of a different
nature, making heterogeneous
parallel systems more appropriate;
l
although interprocess communication
could be decided at process level, overall supervision is necessary for efficient task distribution, resource allocation and management.
A PCS of degree n consists of n separated usual grammars working in parallel; each
of them starts from its own axiom and, in well defined circumstances,
communicates
with each other. The moment of communication
depends on the query symbols
appearing in the current sentential forms generated by the grammars. Query symbols
are special nonterminals,
indexed from 1 to 12,to refer to the grammars. Such a symbol
may belong to the nonterminal
vocabulary
of any grammar, except the one whose
index it bears (a grammar cannot ask from itself). The appearance of a query symbol
in any of the sentential forms imposes a communication,
as the query symbols are
nonterminals
that cannot be rewritten. A communication
consists of the replacing of
all query symbols with the current strings of the grammars they refer to. However,
a restriction is imposed: no replacing takes place for the sentential forms containing
query symbols referring to strings containing
further query symbols. Circular communications
are not admitted.
The theory of PCS’s is very young, therefore many questions are still unsettled in
this area. Some results such as generative capacity, syntactic complexity, closure with
respect to various operations, decision problems, have been studied in [6,12-l 7,231.
The paper deals with decision problems concerning
PCS’s For the context-free
case, we introduce a finite coverability structure (Section 4) which permits us to prove
the decidability
of some decision problems for such PCS’s. For context-sensitive
PCS’s we use a decision problem for monotonic
grammars
and the simulation
of
O-type grammars (Section 5) in order to establish undecidability
results.
2. zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
Preliminaries
We assume the reader is familiar
with basic concepts
example, from [21]); we only specify some notations
in formal language
and the definitions
theory (for
concerning
PC%.
Some decision problems
for parallel
communicating
367
grammar systems
For an alphabet V, we denote by V* the free monoid generated by
operation of concatenation
and the null element 2. Let weV* and U s
denotes the length of w and #(U, w) denotes the length of the string
erasing from w all symbols not in U. When U = {a} we simply write #(a,
#((4
4.
We denote
by CS, CSn, RE the classes of context-sensitive
grammars
I’ under the
V. Then 1WJ
obtained by
w) instead of
(i.e., whose
rules are monotonic),
arbitrary context-sensitive
grammars (i.e., the grammars
contain the rule S--+2, S being the axiom), and O-type grammars, respectively.
may
A PCS of degree n, n2 1, is a system
Y=(G r,...,G,)
where Gi=( VN,i, l’r,i, Si, Pi), 1 <id n, are Chomsky grammars such that Vr,i s I’r, 1
for all 2 < i < n, and there is a set K E {Qi, . , Q,,} of special symbols (query symbols),
KGUl=,VN,i.
zyxwvutsrqponmlkjihgfedcbaZYXWVUT
Xi,yi~ Vz*,ifor all
The n-tuple (x1, ...,x,) directly derives in the n-tuple (yi, . . . , y,),
zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGF
if one of the next two cases holds:
denoted (xi ,..., x,)*(yl ,... , y,),
(i) #(K, xi) = 0 for all 1~ i< n, and xijyi in the grammer Gi, or xiE I’,*,i, Xi = yi,
l<i<n,
ldidn;
(ii) if #(K, xi) > 0 for some i, 1~ i < n, then for each such i we write
with zjEI’z,i and # (K,zj)=O
for all 1 <j<t+
1.
If #(K, xi,)=O, 1 <j<t,
then yi=z1xi,zzxi, ...z,xi,z,+1 and yi,=Sij for all 1 <j<t;
when for some j, 1 <j < t, # (K, Xi,) > 0 then yi = Xi. For all i, 1 < i < n for which yi was
not defined above, we put yi = Xi.
In words, a derivation step consists either of a rewriting step (i) or of a communication step (ii). The communication
has priority over rewriting.
The above definitions refer to returning synchronized PCS’s (returning, because after
communicating
each component
whose string has been sent to another component
returns
to axiom, and synchronized,
because
each grammar
uses exactly one rule in
a rewriting step, the only components
which may “wait” being the terminal ones).
When in point (ii) of the previous definition we erase the words “and yi,=Si, for all
1 <j < t” we obtain a nonreturning PCS (after communicating,
the grammar Gi, does
not return to Si,, but continues to process the current string), and when in point (i) of
the previous definition
we erase the words “XiE VT*,;‘, then we obtain an unsynchronized PCS (the grammar may wait without restrictions). Moreover, if Kn VN, i = 0,
2 d i < n, then the system is called centralized (only Gr, the master grammar, is allowed
to introduce query symbols); a system without this restriction is called noncentralized.
3. Some useful notations and conventions on PCS’s
To express the properties of the PCS’s in an adequately
notations and conventions
that follow.
formal
way, we use the
368
F. Laurentiu et al.
Let y=(G1, . . . , G,) be a PCS of degree II. A conjiguration
of y is any n-tuple
w=(wl, . ..) zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
w ,)
where WiE I’,*,i for all zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJI
1 < i < TV( VG,i = VN,iu VT,i). The configuration
of y. We say that the configuration
v is
(S 1, ... 3S,) is called the initial con$guration
reachablefrom
the configuration
u (in y) if u & U,where % is the reflexive and transitive
closure of the relation
*. If u is the initial configuration
of y then we simple say that
u is reachable (in y). The configuration
w =(wl, . . . , w,) is called circular
the pairwise distinct integers il, iZ, . . . , ikE { 1,2, . . . , n} such that:
Let us remark that a circular configuration
string on the first component
(the definition
if there exist
may occur after generating
a terminal
of the relation 3 permits such a case).
The productions
in the grammar Gi (the ith component
of y) are considered to be
labelled (it is not necessary to have distinct labels for distinct components
of y). The set
of all labels of the ith component
of y will be denoted by Lab+, or Labi when y is
understood
from the context.
In a rewriting step in y there are cases when no production
is applied on some
components.
For example, one case is that of a terminal string and an other case is
that of an unsynchronized
PCS. For technical reasons we want to apply exactly one
production
in a rewriting step, from each grammar. Thus, we consider a phantom
production
which can be applied to any string, in the synchronized
case, and only to
terminal strings, in the unsynchronized
By extension we put:
#(x,LHS(O))=
case. In any case, 0 does not change the string.
#(x,RHS(O))=O
for any symbol x, where, for a rule r, LHS(r) and RHS(r) denote the left hand side and
the right hand side, respectively, of the rule r.
Now we can say that in any effective rewriting
step of y it is applied
an n-tuple
of
productions,
n-tuple which will be called a transition of y. For uniformity we assume
that the communication
steps are performed by a special transition
denoted ,4. This
transition
will cumulate all consecutive communication
steps between two rewriting
steps. Thus, a transition
of y is either il or any n-tuple t =(I-~, . . . , r,), where
riELabiu{O}
for all 1 <id n. By TR(y) we denote the set of all transitions
of y.
Those transitions
which produce circular configurations
will be called circular
transitions;
they can be effectively determined
by the inspection of the productions.
Let w=(wl, . . . , w,) be a configuraiton
of y and t =(I-~, . . . , r,) a transition.
We say
that t is enabled at w if w does not contain query symbols and the rule ri can be applied
to the string Wi. If t is enabled at w then t may occur yielding a new configuration,
say
u, computed by applying each rule ri to the string Wi. We denote this by zyxwvutsrqponmlkjihgfed
w 2 U.
The transition
/1 is only enabled at configurations
containing
query symbols but
not circular ones. The occurrence
of /1 yields a new configuration
solving all communications
imposed by the query symbols appearing
configuration.
computed
by
in the current
Some decision problems
4. On context-free
for parallel
communicating
369
grammar systems
PCS’s
In this section we only deal with nonreturning
synchronized
context-free
PCS’s and
we present a method to associate a finite coverability
structure to such PCS’s
a careful analysis of it we shall derive some useful properties of PCS’s.
By
The structure will be a tree and it will be obtained by analysing the increment and
decrement of the number of nonterminals
in all derivations of the grammar system. To
do this we associate to each configuration
w of a PCS y a vector which retains the
number of occurrences of nonterminals
in w (the image of w by the Parikh mapping
associated to I’,,,). To each derivation
in y will correspond
a computation
with
vectors
of natural
numbers.
4.1. The coverability
We follow then the ideas from [8].
tree of a context-free
We begin with some notations,
Notation 4.1. The set N is extended
operations
conventions,
and definitions.
by a special symbol w to the set N,z= N u(o).
“ + “, “ - “, “.“, and the relation
o+o=w+n=n+o=o,
PCS
“<”
over N are extended
w-n=o,
o.n=n.w=o,
The
to N, by:
n<o,
for all nEN.
The operations and relations over N (NJ are extended to Nk (Ni) by applying them
componentwise
(for a set A and a natural number k> 1, Ak denotes the set of all
k-dimensional
vectors
over A).
4.2. In this section the PCS’s are considered as follows:
synchronized
context-free PCS of degree n, n 3 1;
y=(Gi, . . . , G,) is a nonreturning
Gi = (VN, i, Vr, if Si, Pi) is the ith component
of y, 1 < id n;
K={Q1,...
, Q,,} is the set of all query symbols of y;
the set VN,?- K of all nonterminals
of y, excepting the query symbols, is ordered,
Notation
l
l
l
l
A 1,
...
such that A,=S,,
Notation
vector
3
A,+,
(m30),
. . . ,A,=&.
4.3. (1) Let w=(wi,
. . . , w, ) be a configuration
Mw=K#(X,,w,)> ... , #(xzn+m,wA
of y. By M,
we denote
the
. ,(#(X~,W,), . .. , #(x,,+,,w,))),
where Xi=Aiforall
1 <i<n+m
and Xn+m+j= Qj for all 1 <j d n. M,(i, j) denotes the
element #(Xj, Wi) and M,(i, -) denotes the vector zyxwvutsrqponmlkjihgfedcbaZYXWVUTSR
(#(x19wi)2...,
where l<iQn
#(XZn+m,W i)),
and l<j<2n+m.
370
F. Laurentiu et al.
(2) Let t =(rI, . . . , r,) be a transition
zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPON
of y (t # A). By At we denote
the vector
At=((a:,...,cr:,+,),...,(crl,...,cr2,+,))
where M:= #(Xj,
The notations
RHS(ri))At(i,j)
#(Xj,
LHS(ri))
and At(i, -)
for all 1 <idn
and 1 dj62n+m.
are as those from (1).
In Notation
4.3 we have introduced
an “encoding”
which associates a vector of
natural numbers
with each configuration
of a PCS. We show now how we can
associate
a computation
with such vectors
to each derivation
in a PCS. zyxwvutsrqponmlkjihgfedcbaZ
Definition 4.4. Let y be a PCS (as in Notation 4.2), U~(kIc+~)n and t a transition of y.
(1) The transition t is enabled at U (in y), denoted U[t),, if one of the next two cases
holds:
and n +m+ 1 <j<2n +m (U does not “contain”
(a) U(i,j)=O for all 1 <i<n
queries), and t = (r 1, . . . , r,) # A, and for each i, 1~ id n, we have: if ri = 0 then
U(i,j) = 0 for all 1 <j d n + m (0 can be only applied
LHS(ri)) for all 1 <j<n+m;
U(i,j)#
O
for
some
l<idn
and n+m+ 1 <j<2n+m,
(b)
not exist any sequence of natural numbers
U(i,j)3
to terminal
strings); else
# (A,,
i, ,...,
i/E{1 ,...,
and t is /1, and does
n}
such that:
U(iI,n+m+i,)31,
U(i2,n+m+i3)3
1,
..
U(i,-1,n+m+i,)31,
U(i(, n + m + iI) 3 1
(i.e., there is no circular query).
(2) If t is enabled at U then t may occur yielding a new vector WE(~J$‘~~)“, denoted
U[t),W , and given by:
(4
if.U(i,j)=O
then:
for all 1 <i<n
W (i, -)=
and n+m+
U(i, -)+At(i,
-),
U(i, -),
1 <j<2n+m,
and t=(rl,
. . ..r.)# A,
if ri# O,
if ri= 0,
for all 1 <i < n;
(b) if
U(i,j)# O
for some i and j, l<i<n,
computed by the following algorithm:
Pl. wI=u;
n+m+l<j<2n+m,
then
W is
Some decision problems for parallel communicating grammar sy stems
371
P2. Compute the largest set A E {1, . . . , n} such that for any SEA there is
je(1,2 ,..., n}-A,suchthat
W(i,n+m+j)>Oandforallp~(l,2
,..., rr>
we have W (j,n+m+p)=O.
Let B= {jl 1 <j<n,
3i~A such that
W(i,n+m+j)>O
and
W (j,n+m+p)=O
for any l<p<n}.
If A #Q, then goto P3 else goto P4.
P3. for (any SEA) do
for (any jEB such that W(i, n + m + j) > 0) do
begin
for p:= 1 to n+m do W (i,p)~= W (i,p)+ W (i,n+m+j)W (j,p);
W (i,n+m+j)+O;
end;
got0 Pl;
P4. zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
stop (W is computed).
We remark that we have associated a computation step with vectors of natural
numbers either to each rewriting step (Definition 4.4 (2(a))) or to all consecutive
communication steps between two rewriting steps (Definition 4.4 (2(b))). Let us
exemplify the above constructions.
Example 4.5. Let y =(Gr, Gz, G3) be the nonreturning synchronized PCS given below
(we only specify the rules of the grammars Gi; the nonterminals will be denoted by
capital letters).
Gr: rl : S1-+uQ2
G1: rl : S2+aQ3
G3: rl : S,- +aABbB
r2 : A- +bQ3
r2 : S2+aAB
r2 : B+AAbB
r3 : A- - +a
r3 : B+bbB
r3 : A+aBQ,.
r4: B-+b
r5 : B- rAB
The following are derivations in y:
372
F. Laurentiu et al.
wheretl =(rlt
rl, rl), t2 =(r2, r3, r2), t3 =(r3,r3,r3), t4 =(rl,r2, rd, and t5 =(r2, r-3, r3).
If we denote by wo, wl, w2, w3, w4, w5, w6 (resp., wo, ul, u2, uj) the configurations
from
derivation
Dl (resp., D2) then we have:
and
(considering
the order Sl, S2,S3,A, B, Ql, Q2, Q3, the vectors M , and At, w being
a configuration
and t a transition,
are constructed
as in Notation 4.3; for example,
MW6 =((0,0,0,2,4,0,0,0,),
(O,O,
0,1,2,0,0,0),(0,0,0,~>
2,0,0,0))
and
Atl=((-1,0,0,0,0,0,1,0,),(0,
-l,O,O,O,O,O,
l),(O,O,
-1,1,2,0,0,0)))
We remark
that the derivation
D2 is blocked
by circularity.
Let A and B be two arbitrary
sets. If F( V, E,tl,t2)
is an (A, B)-labelled tree
(i.e. /, : V-tA is the node labelling function
and /,: E- B
is the edge labelling
function), by d,-(u, v’) we denote the set of all nodes on the path from u to v’.
We are now in a position to introduce the notion of coverability
tree of a context-free PCS y. It is based on the tree F’(y) of all reachable configurations
of y. The
The branches
root of F’(J) is labelled by M ,o, w. being the initial configuration.
starting at a node o labelled by M are constructed
as follows: if the occurrence of
a transition t at M yields the vector M ’, the tree F’(y) has a t-labelled edge that start at
u and ends at an M’-labelled node. This construction
yields of course, in general,
infinite trees F’(y). But we can derive from F’(y) a finite tree F(y) without loosing too
much information
about the reachable configurations.
The idea is to skip “regularly
structured”
paths and to indicate this regularity in the inscription
of leafs.
Assume a path ~~-!&~&a~.
of Y’(y) with two nodes v,, up such that tl< p and
up does not contain “query symbols” and for all i and j, d,(v,) (i,j) <E,(v,) (i,j). F’(y)
has in this case an infinite path which infinitely often repeats the transition sequence
t a+1 ... tS. This infinite sequence is in F(‘J) replaced by a single leaf. Its label may
contain the symbol w which says us that the value on some component
unboundedly
increases within the replaced path.
373
Some decision problems for parallel communicating grammar sy stems
zyxwvutsrqponmlk
Definition 4.6. Let y be a PCS (as in Notation 4.2).
tree, F = (V, E, t’,, f,), is called a zyxwvutsrqponmlkjihgfedcbaZYXWVU
coverability tree of y if
A (W 2n+m)n, TR(y))-labelled
the following
(1) the
hold:
root,
by vO, is labelled
denoted
by MWO where
w0 =(S1, . . . , S,) (i.e.,
[1(vo)= M,J;
(2) for any node UE V,
!I
there
0, if either
IU+J=
is not any transition
the number
of transitions
enabled
at e,(u), otherwise,
t which is enabled
(3) for any DE V with Iv+1 >O and any transition
at e,(v),
uf u’ and e,(u)=el(u’),
is u’~d~(u~, u) such that
or there
enabled
at L,(u) there is
a node u’ such that:
(a) (u, u’)E E,
(b) lz(u, 0’) = t,
(c)
d,(u’)
is given by:
- let A4 be such that f,(u)[t),M;
_ if A4 contains “queries” then /,(u’)=
M
else
w,
e,(u’)(U)
if there
dl(u” )dM
=
M(i,j),
for all ldidn
exists
and
u”~d~(u~,u)
f,(u” )(i,j)<
such that
M(i,j),
otherwise,
and ldj<2n+m.
If F1 and Y-2 are two coverability
tress of a PCS y then F1 and F2 are isomorphic
(i.e. there is an isomorphism
of directed trees which preserves the labels of the nodes
and edges). Hence, we can talk about the coverability
tree of a PCS y which will be
denoted by F(y).
The coverability tree of a PCS is always finite. This fact can be shown following the
same line as in [8] where the finiteness of the coverability
tree of vector addition
system was established.
Theorem 4.7. For any nonreturning synchronized
finite and can be efectiuely
context-free
PCS y, the tree T(y)
is
constructed.
Proof. The next two results are used:
(1) Let uO,ul, . . . , II,,, . be an infinite sequence of elements of NP,, p 2 1. Then there is
an infinite subsequence Vi,,Ui,, . . . , Ui.3. . . such that Ui, < Ui, < . . . < ui. < . . . (for a proof see zyxwvutsrqponm
C81);
314 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
F. Laurentiu et al.
(2) (Ktinig Infinitary
Lemma [9]) Let T be a rooted tree in which each node has
only a finite number of successors and there is no infinite path directed away from the
root. Then T is finite.
The first remark is that each node in Y(y) has only a finite number of successors.
Now if we assume that there is an infinite path v~,u~, . . . .v,, . . . in Y(y), then
~,(u~),~,(u,), . ,tl(un), . . . is an infinite sequence of elements of (N$““)“.
For such
vectors,
(1) holds too. Hence,
there is an infinite
subsequence
Ui,, Ui,, . . . ,Uin, . such
that e,(vi,)~e,(Ui,)~
... <d,(Oi.)< .... By definition of Y(y), each vector e,(u,+,) has
more o-coordinates
than e,(U,) (since none of those nodes is an end, we never have
d,(Ui,)=&1(Ui,+,)); a contradiction
with the finite number of coordinates. Thus, all paths
in r(y) are finite and Y(y) is finite by Kiinig’s lemma.
Since r-(y) is finite, its construction,
using the (recursive)
effective.
definition,
is clearly
0
Example 4.8. A fragment
pictorially
represented
of the coverability
tree of the PCS given in Example 4.5 is
in Fig. 1. The letters in circles represent the nodes of the tree
and, t6 and t, are the transitions:
t6 =@3,
y3T r2),
c7 =
(r4,
r3,
r2 1.
The node vlo is a leaf node because its label is identical with a previous one (the
node v8), and u7 is a leaf node because no transition is enabled at e,(v,) (in fact, el(u7)
contains a circular query).
The dot line in Fig. 1 specifies an “o-breakpoint”.
Fig. 1
375
Some decision problems for parallel communicating grammar sy stems
Definition 4.9. Let y be a PCS and ME(N~+~)“.
(1) The vector A4 is called coverable in y if there is a derivation:
such that M, > M (wO being the initial
configuration
of y).
(2) The vector M is called coverable in F(y) if there is a node v or F(y) such that
e,(v) > M.
Some information
about the set of all reachable
configurations
of a PCS y cannot
gained from the coverability tree F(y). But, it will be shown in the following
coverability
tree F(y) covers all reachable configurations
of the system y.
be
that the
Theorem 4.10. Let y be a nonreturning sy nchronized context- free PCS and M E(N’“+~)
such that M (i, n + m + j) = 0 for all 1~ i, j < n. Then, M is coverable in y iff M is coverable
in F(y ).
Proof. Suppose
t1
first that M is coverable
wg*w~=E-..~~wh
t2
in y. There is a derivation
in y
th
such that M ,I 2 M (3 specifies that the step of the derivation
transition
ti). We consider the sequence of vectors
is performed
by the
Mwo,M,,, . . . , M,b
and we shall prove that there is a sequence
vo,ut,..., vh (not necessarily
of nodes in F(y)
pairwise
distinct)
such that e,(Ui) > M ,! for all 0 <i < h. Thus we shall obtain
coverable in F(y).
el(uh) 2 M and hence M is
The node v. is the root of F(y), and we have ~,(v~)=M ,~. Suppose that we have
determined
the nodes u0, . . . , vi, i< h, such that e,(Uj)a M , for all 0 <j< i, and we
want to determine the node Ui+l. We have two cases to consider:
(1) vi is not a leaf node. Then ti+ 1 is enabled at vi and vi + 1 is uniquely
is that node v with the property ez(Oi, v) = ti+ 1;
determined:
it
(2) zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
Vi
is a leaf node. Then it is easy to see that only possible case is that in which
there is vEd,(,) (vo, vi), v # vi, such that zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGF
l,(ui)=/,(u).
The transition
ti+ 1 is enabled at
e,(v) and hence there is a unique node v’ such that e2(v, v’)= ti+ 1. We choose then
Vi+l=V’.
In both cases it is easy to see that e,(vi+l)>M ,Z+I.
316
F. Laurentiu et al.
Conversely,
suppose
that A4 is coverable
in F(y). Let v be a node of r(y)
such that
e,(v) > zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
M and let the path from v. to v have the successive nodes
vo,
01,
...
)
Oh =
v.
Let ti, 1 did h, be the transition which labels the arc (Vi_ 1, vi). If e,(v) does not contain
o-components
then the derivation
has the property M,6=81(v), and hence M is coverable in y.
In the case that e,(v) contains o-components,
the idea is that there are vectors M,
(w being a reachable
configuration
and can be made arbitrarily
large
sequence of transitions
which led
tion involve some calculation
and
from [S]).
0
4.2. Decidable
of y) which agree with e,(v) in its finite coordinates,
in the coordinates
equal to o by repetition of the
to the occurrence of o. The details of the constructhey are omitted (they follow a line similar to that
questions
We apply now the results obtained
decidability
PCS’S.
of some properties
about
in the previous
section in order to establish
the nonreturning
synchronized
the
context-free
The first problem is: can we decide whether a transition
of a nonreturning
context-free PCS y is enabled in y? The answer to this question will be obtained from the
following theorem.
Theorem 4.11. Let y be a nonreturning context-free
enabled
in y ifs there is at least an arc in F(y)
Proof. Suppose
first that
t is enabled
PCS and tETR(y) - {A}. Then t is
labelled
in y. Hence
S %Y w &-? w’ (the last step in the above derivation
by t.
there exist w and w’ such that
is performed
by t).
Let ME(N 2n+m)nbe the smallest vector such that t is enabled at it. Clearly M, 2 M,
and from this fact it follows that M is coverable in y (M does not contain query
symbols! ). From Theorem 4.10 it follows that M is coverable in r(y), i.e. there is
a node in Y(y) such that M Gus.
Without loss of generality we may assume that
ll(v) does not contain queries.
Now, if w is not a leaf node then t is enabled at k,(o) and hence v will have
a successor o’ such that /,(v, v’) = t.
In the case that v is a leaf node, there is v’ sd ~~y~(vo,
v), v # v’ , and k’,(u) = e,(v’). We
obtain that t is enabled at Ll(v’) and v’ is not a leaf node. Hence, there is a node v” such
that e2(v’, v”) = t.
371
Some decision problems for parallel communicating grammar sy stems
Conversely,
let (u, u’) be an arc in Y(y) labelled by t. We have e,(o)[t)
and
considering
the vector M as above we obtain e,(u) 3 M , i.e. M is coverable in Y(y).
From Theorem 4.10 it follows that M is coverable in y, i.e. there is a reachable
w such that M , B M . Thus, t is enabled
configuration
enabled
in y.
From Theorem
Corollary.
Corollary
4.10 and
4.12. It is decidable
sy nchronized
at w and hence the transition
t is
0
context- free
Theorem
whether
4.11 one
a transition
PCS y is enabled
easily
t# A
obtain
the following
of a given
nonreturning
in y.
A PCS y is called circular if it has some circular
the circular configurations
are yielded
obtain the following Corollaries.
can
reachable
by applying
circular
Corollary 4.13. It is decidable whether a given nonreturning
configurations.
However,
transitions
and so, we
sy nchronized
context- free
PCS y is circular.
Corollary 4.14. It is decidable whether a given nonreturning sy nchronized context- free
PCS y works like a centralized
one.
Proof. A PCS y works like a centralized
y has the property:
#(K,RHS(t(i)))=O
The corollary
4.12.
0
one iff any transition
t # ,4 which is enabled
in
for any 2<i<n.
follows now from the finiteness
of the tree Y(y) and from Corollary
We say that there is conflict in a PCS y if there is a configuration
y, and there exist i, j, k such that i # j # k # i and # (Qk, wi) > 1 and
If in y there is not any conflict we say that y is conflict-free.
Corollary 4.15. It is decidable whether a given nonreturning
w = (wi, . . . , w,) in
# (Qk, wj) 2 1.
sy nchronized
context- free
PCS y is conflict- free.
Proof. In a PCS y there is conflict iff there is a transition t #A which is enabled in y,
and there is j and k such that j# k# i# j
and
#(Qk, RHS(t(i)))> 1 and
#(Qk, RHS(t(j)))>
1. The corollary
and from Corollary 4.12.
0
follows now from the finiteness
of the tree 5(y)
378
F. Laurentiu
et al.
There have been studied in [6] the PCS’s with a bounded
tions. But, is it decidable whether a given PCS has a bounded
number
number
of communicaof communica-
tions?
Corollary 4.16 It zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
is decidable whether a given nonreturning sy nchronized context- free
PCS has a bounded
number of communications.
Proof. A nonreturning
synchronized
PCS y is not a bounded
PCS iff there is a path in
F(Y)
Vl,V2,
...
,u,, zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
(k32)
such that:
(ii) there is 1 did
k
5. On context-sensitive
PCS’s
This section is dedicated to context-sensitive
are undecidable
for such PCS’s
5.1.
Some
undecidable
The enabling,
0
such that ez(vi, vi+ 1) = n.
PCS’s, As we shall see many problems
questions
circularity,
centralizing,
conflict-freeness
and boundedness
problems
defined for context-free PCS’s are similarly defined for context sensitive PCS’s. For
example, the enabling problem is the problem to decide whether a transition
t # A of
a given context-sensitive
PCS y is enabled in y.
Using an undecidability
result for context-sensitive
grammars we shall
the above problems are undecidable
for context-sensitive
PCS’s.
Let c be an arbitrary but fixed symbol. The c- reachability problem for
Chomsky grammars 3 consist of giving an algorithm that will tell whether
symbol c is reachable in a given grammar GE% (i.e., if there is a word
c derivable from the axiom of G).
We shall prove that this problem is undecidable
using the Post correspondence
problem ([21]).
machines, can be found in [4].
Theorem 5.1. The c- reachability
Proof. Assuming the existence
Post correspondence
problem.
show that
a family of
or not the
containing
for context-sensitive
grammars by
Another proof, based on counter
problem is undecidable for context- sensitive
of such an algorithm,
grammars.
we show the decidability
of the
Some decision problems for parallel communicating
379
grammar systems
Consider an arbitrary instance PCP of the Post correspondence problem, given by
an alphabet C not containing c and two arbitrary lists of words over Z, c1r,. . . , cc,and
P 1, . . . , fl,,. Without loss of generality we may assume that there is no 1 <i < n such that
both C(iand pi are the null string.
Consider the grammar G = (I’,, VT,S, P) given by:
0 VN={S,A,X};
n}, where @ is a new symbol and C is disjoint with
0 V,=cu{c,@}u{l,...,
(1, . . ..n}.
l P contains the next groups of rules;
(1) S-AX;
n, if we suppose
(2) for each 1~ i < zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
tLi =
Ui,
/Ji=bir
ai, . . . aik,,
biz . . . him,,
and
then
ki<mi,
If ki>,mi, then @ occur on the second component in a similar way (the
nonterminal A tries for a solution of PCP); zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONM
(3)
[:IM+M
[:I~
for any x,y~C and z~Cu(@]
(the words cli and pi are compacted to the right);
(4)
for any x~Cu{@}
[:]+:]~
(the nonterminal X verifies the correspondence);
iX- +ic, for any 1 d i < n (when a solution of PCP have been found, the symbol
c is generated).
Clearly, G is context-sensitive and PCP possesses a solution iff the symbol c is
reachable in G. 0
(5)
Corollary
5.2.
sy nchronized
The
enabling
problem
or unsynchronized)
is undecidable
context- sensitive
for
PCs’s
(returning
of degree
or nonreturning,
n, n > 2.
F. Laurentiu et al.
380
Proof. Let c be an arbitrary symobi and G be a context-sensitive
grammar such that
there exists at least one rule containing c in its right hand side (we assume c is not the
axiom of G). Let zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
rl, . . . , rk be all rules such that #(c, RHS(ri)) > 0, 1~ i < k.
Consider y=(G1, . . . , G,), n 22, where G, = G and Gj, 2 <j,< n, only contains the
rule rl:
Clearly, c is reachable in G iff at least one of the transitions
1 did k, is enabled in y.
The corollary follows now from Theorem 5.1. 0
Sj
+
Sj.
Corollary 5.3. The circularity
synchronized
problem
or unsynchronized)
is undecidable
context-sensitive
Proof. Consider y = (G,, . . , G,), n > 2, where
l G, is a context-sensitive
grammar containing
l all rules of G2 are SZ-+S2, S2+Q1;
l Gi, 3 <i<n,
only contains the rule Si-‘Si.
Corollary 5.4. The centralizing
synchronized
problem
or unsynchronized)
a unique
n, n 2 2.
query symbol
a circular
is undecidable
context-sensitive
for (returning or nonreturning,
PCS’ s of degree
The symbol Q2 is reachable in G1 iff y reaches
conclusion follows from Theorem 5.1. 0
ti =(ri, rl, . . . , rl),
Q2;
configuration,
and the
for (returning or nonreturning,
PCs’ s
of degree
n, n>2.
Proof. Consider y = (G,, . . . , G,), n > 2, where
l Gi zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
(1 < i<n1) has the unique production
Si+Si;
l G, is a context-sensitive
grammar which contains the query symbol Q1.
0
The symbol Q1 is reachable in G, iffy is noncentralized.
Corollary 5.5. The conflict-freeness
ing, synchronized
problem
or unsynchronized)
is undecidable for (returning or nonreturn-
context-sensitive
PCS’ s of degree
n, n > 3.
Proof. Consider y = (G,, . . . , G,), n 3 3, where
l G1 is a context-sensitive
grammar which contains the unique query symbol
l the rules of G2 are SZ+S2, S2-+Q3;
l Gi, 3 <i<n,
has the unique rule Si-+Si.
0
The symbol Q3 is reachable in GI iffy is not conflict-free.
Corollary 5.6. The boundedness
synchronized
or unsynchronized)
problem
Q3;
is undecidable for (returning or nonreturning,
context-sensitive
PCS’ s of degree
Proof. Let Q2 be an arbitrary symbol and G be a context-sensitive
contains Q2. Consider y = (G,, . . . , G,), n 2 2, where
n, n>,2.
grammar
which
Some decision problems for parallel communicating grammar
l
l
G1 contains
in G);
Gi, 2<i<n,
all rules from G and in addition
The symbol
Q2 is reachable
tions.
only contains
sy stems
381
the rule S2-+Q2 (S, does not appear
the rule Si-‘Si.
in G iffy has an unbounded
number
of communica-
0
5.2. The simulation of O- ty pe grammars and other undecidable questions
The O-type grammars
can be simulated
by very “simple”
context-sensitive
PCs’s.
Theorem 5.7. For any O- ty pe grammar G which cannot generate the null string 1 we can
e&tively
construct a returning sy nchronized PCS y o of degree 3 such that:
(1) yc has two regular components (without using A- rules) and one context sensitive
component (the master grammar is regular);
(2) L(G)= W C).
Proof. Let G =( V,, V,,
modify any rule r: a-b
(a) if (CIId IpI, then we
r is aAb+aaB then we
S, P) be a O-type grammar such that I$L(G). The idea is to
as follows:
concatenate
to p the query symbol Q1 (for example, if the rule
construct the new rule aAb+aaBQ,);
(b) if ICI\> IpI, then we concatenate
to fi the string Q’;, where m= I@I-IflI (for
example, if the rule r is aAb+a then we construct the new rule aAb- +aQ,Q,).
These new rules will be in the second component
of our system.
We assume V,=(aI,...,
a,} and y =(G1, Gz, G3) where:
G,: S1+S;,
S’+Q3,
A- A’,
A’+Q3,
Bk- +ak
for any l<k<p;
Gz: &+CXS#QI,
u+vQ1
for any U+VEP
u*vQ{
for any U+UEP such that j = JuJ- Iv]> 0,
S;a+aQ1
such that JuI<(v(,
for any zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCB
a El/,uV ,u(# },
CXak+CX’ak for any 1 <k < p,
a,X+a,QJX,
akAXakai+akAakXai,
BkXak # - SBkakX# ,
for any 1 <k<p;
G,: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
s3 +s3 , S3+akA, S3+BL for any l<k<p
382 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
F. Laurentiu et al.
PI,
S;,
SZ, S3, A, A’, C, # ,
X, &, 1 <k < p, are new symbols;
they are not members
of
the set V,u V,).
The system y simulates
the derivations
I
Sl
in G as follows:
Sl
S2
S3
‘$XS#S>
3
S3
:
(the markers c and #, the nonterminal
second component);
X, and the axiom of G, are introduced
s;
Sl
... j
1
=a..
~Xucm # (S;)’
S3
1
a
CXuPQ( u # (s;) i
s3
on the
Ii
=
Sl
CXu/qS;)ju#(S;)’
s3
zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJI
CXug~+(sl)i+j
S3
(it is simulated
j =
a rewriting
step in G using
the rule a-j?;
if IM]= I/J1 then j= 1 else
I4 - zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
IDI);
Sl
... *
i
CXUl . . . 4t#(S;)’
I
s3
I
1
I
*
:
CQ 3XU,
s3
I
UlA zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONML
Q3
=
s;
CX’U, . ..u.#(sJ
~u,AXulu2
. . . u,# (S;)’
UlA
. ..un#(S.)’
j
...
s3
(the system y guesses that a terminal
string has been generated
on the second
component.
Then y generates this string on the third component
in a linear manner
and verifies it step by step. The master grammar asks for this string); zyxwvutsrqponmlkjihgfedcb
alQ3
Cu,Au,Q3Xu,
aA
...u.#(S;)’
Some decision problems
for parallel
communicating
383 zyxwvutsrqponmlk
grammar systems
a, . . . a,- ,A
alaJzyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
=
CalAalazAXa,a3
i
*
. ..a.# (S;)’
$
s3
1
CalAal ...a,_lAXa,_la,# (S~)’
i
s3
a, . . . an_1A’
a, . . . an-IQ3
zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPO
ca,Aal
CatAal . ..a.- ,Aa,- ,Q3Xa,# (S;)’
. . . a,_,Aa,_,Xa,# (S;)
s3
B”
J
a, . . . a,- 1B,
+
Ca,Aal . . . a,, - 1Aa, - 1B,Xa, # (S’J
s3
a, . . . am- la,
=
Cal Aa, . . . a,_,Aa,- 1B,a,X# (S;)’
s3
It is easy to see that the derivation is blocked in other cases. Moreover, we have:
Sg,;l a, . . . a,
iff
3 20
such that
Sl
s2
i
1 . ..a._,Aa,_,B,a,X# (S;)’
s3
The theorem is completely proved.
0
Remark 5.8. The condition
“A$L(G)” permits us not to use A-rules in the regular
components of YG.Otherwise, with the same construction, point (2) of Theorem 5.7
becomes
(2’)L(G)- {A>= UYG).
If we use I-rules, the O-type grammars can be simulated by PCS’s of degree 2.
Theorem 5.9. Any O- ty pe grammar can be simulated by a (returning or nonreturning)
sy nchronized PCS of degree 2 with one context sensitive component and one regular
component.
384
F. Laurentiu et al.
Proof. If G =( VN,VT,S, P) is a O-type grammar,
let yG =(Gi,
G2) where:
G,: u-+v for any U-+VEP such that Iuj 6 (VI,
u+vQT
for any U+VEP
such that zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQ
m=lul-Ivl>O;
G2: S,-+1.
It is easy to see that G1 works like G but its rules are monotonic.
Corollary 5.10. The membership,
lems are all undecidable
degree
at least
text-sensitive
3, and for
PCs’ s
equivalence,
both for
returning
(returning
of degree
inclusion, emptiness
synchronzied
or nonreturning)
0
and finiteness
context-sensitive
synchronized
prob-
PCs’ s
arbitrary
of
con-
at least 2.
Proof. These problems all are undecidable
for the family of O-type grammars
theorem follows from this fact and from the Theorems 5.7 and 5.9. 0
and the
6. Final remarks
The results established in Section 4.2 hold also true for the unsynchronized
What we have to do is to consider that the phantom rule 0 can be applied
string (not only to terminal strings).
The circularity problem remains open for returning
context-free
case.
to any
PCS’s.
Acknowledgements
The authors
wish to thank Dr. Gheorghe
and for suggesting
the proof
of Theorem
Paun both for his encouraging
5.1 based
on the Post
comments
correspondence
problem.
References
[l]
E. Csuhaj-Varju
and J. Dassow,
On cooperating/distributed
grammar
systems,
J. Inform. Process.
Cy bern. EIK 26 (l/2) (1990) 49- 63.
[Z] K. Culik, J. Gruska
[3] J. Dassow
and A. Salomaa: Systolic trellis automata, Internat. .I. Comput. M ath. 15 (1984) 16.
and Gh. Paun, Regulated Rewriting in Formal Language Theory, (Akademie-Verlag.
Berlin,
1989).
[4] C. Ene, A decision problem for monotonic
grammars,
submitted.
[S] M. Hack, Petri Net Languages: CSG Memo 124, Project MAC (MIT Press, Cambridge,
MA, 1975).
[6] C.M. Ionescu and 0. Procopiuc,
Bounded communication
in parallel communicating
grammar
systems, submitted.
[7] J. Kari, Games Played on the Plane: Solitaire and Cellular Automata,
EATCS Bull. 40 (1990).
Some decision
problems for parallel
communicating
grammar
systems
385
[S] R. Karp and R. Miller, Parallel program schemata, J. Comput. System Sci. 3 (1969) 147-195.
[9] D. Kiinig, Theorie der Endlichen und Unendlichen Graphen (Akademische Verlagsgesellschaft,
Leipzig
1936).
[lo] R. Meersman and G. Rozenberg, Cooperating
grammar systems, in: Lecture Notes in Computer
Science 64 (Springer, Berlin, 1978) 364-373.
[11] M.L. Minsky, Recursive unsolvability
of post’s problem of “Tag” and other topics in the theory of
Turing machines, Ann. of Math. 74 (3) (1961) 437-455.
[12] Gh. Paun, Parallel Communicating
grammar systems: the context-free case, Found. Control Engrg. 14
(1) (1989) 39-50.
[13] Gh. Paun: Non-centralized
parallel communicating
grammar
systems, EATCS Bull. 40 (1990)
257-264.
1141 Gh. Paun and L. Santean, Further remarks on parallel communicating
grammar systems, Internat. .I.
Comput. Math. 34 (1990) 187-203.
[lS] Gh. Paun and L. Santean, Parallel communicating
grammar systems: the regular case, Ann. Univ.
Bucharest, Math.-lnformatics
Ser. 37 (2) (1989) 55-63.
[16] Gh. Paun, S. Vicolov and A. Salomaa, On the generative
capacity of parallel communicating
grammar systems, Internat. J. Comput. Math. 45 (1992) 49-59.
[17] 0. Procopiuc,
CM. Ionescu and F.L. Tiplea, Parallel communicating
grammar
systems: the context-sensitive case, Internat. J. Comput. Math. 51 (1) and (2), to appear.
[18] P.J.G. Ramadge and W.M. Wonham, The control of discrete event systems, in: Proc. of the IEEE,
Vol. 77 (1) (1989).
[19] W. Reisig, Petri Nets - An Introduction (Springer, Berlin, 1985)
[20] G. Rozenberg and A. Salomaa, The M athematical Theory ofL System (Academic Press, New York,
1980).
[21] A. Salomaa, Formal Languages (Academic Press, New York, 1973).
[22] L. Santean, Parallel communicating
systems, Bull. EATCS 42 (1990) 160-171.
[23] F.L. Tiplea and C. Ene, A converability
structure for parallel communicating
grammar
systems,
J. Inform. Process.
Cybern. EIK 29 (5) (1993) 303-315.