Parallel communicating grammar systems with ... - Semantic Scholar

3 downloads 62057 Views 251KB Size Report
IOS Press. Parallel communicating grammar systems with negotiation ..... BBM. 3. ZZZZZZZZZZZZ}. Note in the diagram in figure 2 a series of open problems, ...
Fundamenta Informaticae 1(1996)1-6 IOS Press

1

Parallel communicating grammar systems with negotiation Gheorghe Paun

Institute of Mathematics Romanian Academy PO Box 1 { 764, 70700 Bucuresti, Romania [email protected]

Lech Polkowski

Institute of Mathematics Warsaw University of Technology Plac Politechniki 1, 00-651 Warsaw, Poland [email protected]

Andrzej Skowron

Institute of Mathematics Warsaw University Banacha 2, 02-097 Warsaw, Poland [email protected]

Abstract. In a parallel communicating grammar system, several grammars work to-

gether, synchronously, on their own sentential forms, and communicate on request. No restriction is imposed usually about the communicated strings. We consider here two types of restrictions, as models of the negotiation process in multi-agent systems: (1) conditions formulated on the transmitted strings, and (2) conditions formulated on the resulting string in the receiving components. These conditions are expressed in terms of regular languages, whose elements the mentioned strings should be. Moreover, we allow that the communicated string is a part (any one, a pre x, a maximal, a minimal one, etc.) of the string of the communicating component. We investigate these variants from the point of view of the generative capacity of the corresponding parallel communicating grammar systems.

1. Introduction This paper is concerned with the aspect of distributed problem - solving (cooperative problem - solving, multi - agent systems) [1],[3],[4],[13],[14],[32] related to the problem of negotiations [9],[32], among intelligent agents , cooperating towards the synthesis of a solution (possibly, approximate) to a given problem (speci cation). The theory of grammar systems was explicitly initiated as a possible grammatical approach to multi-agent systems appearing in Arti cial Intelligence , Cognitive Psychology, etc. Two basic classes of systems were mainly considered: the sequential ones, introduced in Research supported by the Academy of Finland, project 11281, and grant from the State Committee for Scienti c Research #8T11C01011 

[5] following [15], and called cooperating distributed (CD) grammar systems, and the parallel ones, introduced in [21] and known under the name of parallel communicating (PC) grammar systems. In the rst model, several grammars work, by turns, on the same sentential form, according to a speci ed protocol (start and stop conditions, sequencing the components, etc.). The set of terminal strings obtained in this way is the language generated by the system. In a PC grammar system, the component grammars work synchronously, each on its sentential form, and they communicate on request: Special query symbols are provided, of the form Qj , with j identifying a component of the system. When some component i introduces the symbol Qj , then a communication step must be performed. The current sentential form of the component j is sent to the component i, where it replaces the occurrence(s) of Qj in the sentential form. The language generated by the rst component of the system (it is called the master of the system), after a sequence of such rewriting and communication steps, with each component starting from its axiom, is the language generated by the system. Details (at the level of the middle of 1992) can be found in [6]; further bibliographical information can be found in [18], [19], [20]. On the other hand, the theory of analysis, synthesis, design and control of complex systems by means of dedicated teams of intelligent, communicating and negotiating agents has been developed by the last two authors [24], [25], [28], [31] on the basis of a new paradigm for approximate reasoning called rough mereology ,[24], [26], [27]. Rough mereology has been developed in the framework of the rough set theory [22], [23]. The negotiation mechanism proposed in [24] has been based on a particular formal system viz. boolean reasoning [2]. In this paper we address the problem of negotiations in multi - agent systems from the point of view of grammar systems. In spite of the fact that the theory of grammar systems is well developed, a series of important features of multi-agent systems are still not covered. The present paper is an attempt to ll such a gap, regarding the notion of negotiation. For instance, in a simple framework as that illustrated in gure 1, when the children nodes C ; C send some messages x ; x (pieces of information or parts of a goal-object, etc.) to the father node, F , then each x ; x separately must observe certain properties, but also the pair (x ; x ) must ful l certain restrictions: the father node has a goal and the pair (x ; x ) has to t with the goal. 1

1

2

1

2

2

1

1

2

2

Ft





TT

TT



C t

TT tC

1

2

Fig. 1. In the three-agent system (F; C ; C ), the fact that the above mentioned restrictions re ful lled is subject of a sort of negociation among the components of the system. A natural framework for modelling this is the PC grammar systems theory. In general (see Sect.2 for de nitions), a PC grammar system contains rewriting systems (S ; P );..,(Sn; Pn) interpreted as languages of agents entering the negotiation process as well as alphabets N (non - terminals), K (query symbols), T (terminals). In the process of negotiation, any agent i may issue a string of the form xi = xQ(i; j )y where Q(i; j ) 2 K; meaning that the agent j is to submit its current string xj in order to replace with it the symbol Q(i; j ) in xi . It is natural to assume that a negotiated constraint is ful lled when 1

1

1

2

after eventual replacement of all query symbols with requested strings, the resulting string belongs to the speci ed (possibly, in advance) negotiation language L: It turns out (cf. Theorems 5,7,8 below and Sect.5) that from the point of view of the generative power of the considered mechanism (which is our aim in this paper) it is sucient to consider some restricted forms of satisfying a query constraint viz. the selection of individual messages and target restrictions (cf. Sect. 2 ). We shall separately consider PC grammar systems with conditions about the communicated strings taken into account individually, and about the string obtained after completing a communication by the receiving component. Both these conditions are formulated in terms of regular languages: the submitted strings, as well as the resulting string must be members of certain speci ed regular languages. On the other hand, we allow the communication of substrings of the current sentential forms of components, considering modes of selecting the transmitted string: a pre x, any subword, a maximal or a minimal subword of the current string, the whole string, etc. Adding such a control on the communication operation in PC grammar systems proves to signi cantly increase their power: when -rules are allowed, characterizations of recursively enumerable languages are obtained in most cases (at least the context-sensitive family is covered in the -free case), always using context-free rules. This shows that the ability to negotiate is important, it increases the competence of multi-agent systems. A more complex form of negotiation is considered in the last section of the paper, without however entering into details.

2. PC grammar systems

For an alphabet V , we denote by V  the free monoid generated by V under the operation of concatenation; the empty string is denoted by  and V  ? fg by V . The length of x 2 V  is denoted by jxj, whereas jxjU is the number of occurrences of symbols of U  V in x 2 V . For a string x, we denote by Pref (x); Sub(x) the set of pre xes, resp. subwords of x. For x 2 V  ; L  V , @xl (L); @xr (L) denote the left and the right derivatives of L with respect to x: @xl (L) = fy 2 V  j xy 2 Lg; @xr (L) = fy 2 V  j yx 2 Lg: The families of regular, linear, context-free, context-sensitive, recursively enumerable languages are denoted by REG, LIN, CF, CS, RE, respectively. A PC grammar system (of degree n; n  1) is a construct ? = (N; K; T; (S ; P ); : : : ; (Sn; Pn)); where N; K; T are mutually disjoint alphabets, with K = fQ ; : : : ; Qng, Si 2 N , and Pi are nite sets of rewriting rules over N [ K [ T; 1  i  n: The alphabet N is the nonterminal one, T is the terminal alphabet, the elements of K are called query symbols, and the pairs (Si; Pi) are the components of the system. Often, we call Pi a component. Note the one-to-one correspondence between the query symbols and the components. The symbol Si is the axiom of the component i. An n-tuple (x ; : : : ; xn), with xi 2 (N [ K [ T ), is called a con guration of ?. For two con gurations, (x ; : : : ; xn); (y ; : : : ; yn) with x 2= T , we write (x ; : : : ; xn) =)rw (y ; : : : ; yn) i the following conditions hold: 1. jxi jK = 0; for all 1  i  n; 2. either xi =)P yi, or xi 2 T ; 1  i  n: For two con gurations as above, we write (x ; : : : ; xn) =)com;r (y ; : : : ; yn) i the following conditions hold: 1. there is i; 1  i  n, such that jxijK > 0; 2. if xi = z Qi1 z : : : zk Qi zk ; k  1, for zj 2 (N [ T ) ; 1  j  k + 1, and +

1

1

1

1

1

1

1

1

1

i

1

1

2

k

+1

1

jxi jK = 0 for each j; 1  j  k, then j

yi = z xi1 z : : : zk xi zk and [yi = Si ; 1  j  k]; otherwise, yi = xi ; 3. for all i for which yi has not been de ned at point 2, we have yi = xi. The relation =)rw represents a rewriting step (performed in parallel, synchronously, on all components whose current sentential forms are not terminal), the relation =)com;r de nes a communication step. The query symbols are replaced by the strings identi ed by their indices (we say that the query symbols are satis ed), providing that these strings do not contain further query symbols. The communication has priority over rewriting. If some query symbols are not satis ed at a given step, then they might be satis ed at the next ones, providing that the requested strings were modi ed by the previous communications in such a way that they do not contain query symbols. If circular queries appear, the system is blocked. The system can be also blocked in the rewriting mode, when a component cannot rewrite its sentential form although it is a nonterminal one. Note that neither a rewriting nor a communication is possible when the sentential form of the rst component, x above, is terminal. The work of the system stops in that moment. The above de ned communication step is a returning one: after communicating, a component resumes working from its axiom. If we remove the brackets, [yi = Si ; 1  j  k], then we obtain a non-returning communication, denoted by =)com;nr : after communicating, a component continues processing the current sentential form. We write, in general, =)r ; =)nr for denoting both a rewriting and a communicating step (this second one in the returning or non-returning mode, respectively), and =)r ; =)nr for the re exive and transitive closure of these relations. The language generated by ? in the mode q 2 fr; nrg is Lq (?) = fx 2 T  j (S ; : : : ; Sn) =)q (x; y ; : : : ; yn); yi 2 (N [ K [ T ); 2  i  ng: The rst component of the system is called the master; its language is the language of the system. Note that no restriction on the sentential forms of the components is imposed. When only the master can introduce query symbols (formally, jwjK = 0 for all A ! w 2 Pi; 2  i  n), then we say that the system is centralized; otherwise, the system is non-centralized. We denote by PCnX the family of languages Lr (?) generated (in the returning mode) by non-centralized PC grammar systems with at most n components, n  1, of type X . When centralized systems are used, we write CPCnX , when the non-returning mode of working is used we add the letter N, getting NPCnX; NCPCnX . When no bound is imposed on the number of components, we replace the subscript n with . In what concerns the type of the components, we consider here X 2 fRL; CF; CF ; CS g, where RL stands for -free rightlinear, CF for -free context-free, CF  for arbitrary context-free, and CS for (-free) length increasing. When de ning the type of rules, the query symbols are considered nonterminals. Results about these families can be found in [6], [18], [19], [20]. The diagram in gure 2 contains also some new results, proved in [10], [16], [17] (MAT denotes the family of languages generated by matrix grammars with -free context-free rules and without appearance checking { see [8] for de nitions). We also recall the following relations about the context-sensitive case, [6], [12]: 1. CPC CS = NCPC CS = CPCCS = NCPCCS = CS; 2. CS = PC CS = PC CS  PC CS = PCCS = RE; 3. CS = NPC CS  NPC CS = NPCCS = RE: 1

2

k

+1

j

j

1

j

1

1

2

1

1

2

1

3

2

j

RE

 6

CS

 6BMB B NPCCF PC  CF  PiPPP 1    B  o S 6 6 S  PPPP BB S   PCRL NPC RL  SS BB 6@ 6 I@ MAT B  @@  6 BB  @@CPCCF NCPCCFH YHH *  I @  ? @ ?  @ HH  @ @@ ?? HH  @ CPCRL NCPCRL @ CF @@ 6 }Z Z 3   ZZ @   ZZ LIN   ZZ 6  ZZ  Z  REG Fig. 2

Note in the diagram in gure 2 a series of open problems, especially concerning the righthand part of the diagram (about non-returning families), and about the context-sensitivity of languages in PCCF; PCRL, etc. The families CPCRL; NCPCRL are incomparable, [11], but no other incomparability results are known in this area.

3. PC grammar systems with selected communicated strings In the previous de nition, no restriction has been imposed on the communicated strings, excepting the rather strong one that the whole sentential form of the component identi ed by the query symbol is communicated. We relax this condition here, but we demand of the communicated string to be an element of a given regular language. A PC grammar system (of degree (n; m); n; m  1) with selected communicated strings (shortly, a PCS grammar system) is a construct ? = (N; K; T; (S ; P ); : : : ; (Sn; Pn); R ; : : : ; Rm ); where N; T; Si; Pi; 1  i  n, are as in a PC grammar system, Rj  (N [ T ); 1  j  m, are regular languages, and K = fQ ; : : : ; Qng  f1; : : : ; mg; Ri are called selectors. The meaning of a symbol (Qi ; j ) is as follows: the component i has to communicate to the component which has introduced (Qi; j ) a string which belongs to Rj . 1

1

1

1

For a string x 2 (N [ T ), a language Rj ; 1  j  m, and q 2 ft; f; p; l; M; mg, we de ne the set (x; Rj ; q) as follows.  x 2 Rj , (total ) (x; Rj ; t) = f;x; g; ifotherwise, (x; Rj ; f ) = Sub(x) \ Rj ; (free ) (x; Rj ; p) = Pref (x) \ Rj ; (pre x ) (x; Rj ; l) = fy 2 (N [ T ) j x = x yx ; x ; x 2 (N [ T ); and if x = x0 y0x0 ; x0 ; x0 2 (N [ T ); y0 2 Rj ; then jx j  jx0 jg; (leftmost ) (x; Rj ; M ) = fy 2 (N [ T ) j x = x yx ; x ; x 2 (N [ T ); and if x = x0 y0x0 ; x0 ; x0 2 (N [ T ); y0 2 Rj ; then jx j  jx0 j and jx j  jx0 jg; (maximal ) (x; Rj ; m) = fy 2 (N [ T ) j x = x yx ; x ; x 2 (N [ T ); and if x = x0 y0x0 ; x0 ; x0 2 (N [ T ); y0 2 Rj ; then jx j  jx0 j and jx j  jx0 jg: (minimal ) For two con gurations (x ; : : : ; x ); (y ; : : : ; yn), we de ne the rewriting relation =)rw as for usual PC grammar systems and the communication relation (x ; : : : ; xn) =)com;q (y ; : : : ; yn), in the mode q 2 ft; f; p; l; M; mg, when the following conditions hold: 1. there is i; 1  i  n, such that jxijK > 0; 2. if xi = z (Qi1 ; j )z : : : zk (Qi ;j )zk ; k  1; for zs 2 (N [ T ); 1  s  k + 1, and jxi jK = 0; 1  s  k; then: 1

1

2

1

2

1

1

2

2

1

1

2

2

1

1

2

2

2

1

1

2

1

1

1

1

2

1

1

2

1

2

2

2

2

1

2

1

1

1

1

2

k

k

1

+1

s

2.1. yi = z w z : : : zk wk zk ; for some ws 2 (xi ; Rj ; q); 1  s  k, and 2.2. if xi = x0i wsx00i , then  0 00 x0i s00i 6= , yi = xy i x=i ;S ; when otherwise, i i for 1  s  k; 3. in all other cases, yi = xi; 1  i  n. In plain words, we communicate strings in (xi ; Ri ; q) in order to satisfy a symbol (Qi ; js) in the mode q, and the sending component continues working from the remaining string providing it is non-empty, or it returns to the axiom if the whole string has been communicated. (A natural de nition of the returning { non-returning modes is obtained in this way.) Note that in the t mode the derivation is returning by the de nition. As above, we write =)q for both =)rw and =)com;q . The language generated by ? in the mode q is Lq (?) = fx 2 T  j (S ; : : : ; Sn) =)q (x; y ; : : : ; yn); yi 2 (N [ K [ T ); 2  i  ng: The family of languages generated by non-centralized PCS grammar systems of degree at q X . When most (n; m); n; m  1, of type X , working in the mode q, is denoted by PCSn;m q centralized systems are used we write CPCSn;mX and we replace n or m by  when no restriction on the number of components or on the number of selectors are imposed. Directly from the de nitions, we obtain: 1

s

1 2 s

+1

s

s

s

s

1

s

s

s

s

s

s

Lemma 3.1.

s

s

s

2

q X  PCS q X; for all n; m; q; X . 1. CPCSn;m n;m q X  CPCS q X 0 and PCS q X  PCS q X 0 , for all n  n0 ; m  2. CPCSn;m n;m n ;m n ;m m0 ; X  X 0 ;q 3. X = CPCS ;X = PCS q;X , for all q and X. If we add to a usual PC grammar system ? the selector R = (N [ T ) , then we can consider ? a PCS grammar system working in one of the modes t; M and the obtained language is not changed. Hence we get Lemma 3.2. CPCnX  CPCSn;q X and PCnX  PCSn;q X; for all X; n  1; q 2 ft; M g. Clearly, the counterparts of the relations in Lemmas 1, 2 when replacing n; m; n0; m0 by  are true, too. In the centralized case, the t mode of selecting the communicated string does not increase the power of systems, and this is true for all types of components (that is, in these cases the rst relations in Lemma 2 are equalities). Theorem 3.1. CPCnX = CPCSn;t X; X 2 fRL; CF; CF g: 0

1

0

0

0

1

1

1

1

1

Proof:

In view of Lemma 2, we have to prove only the inclusion . Let ? = (N; K; T; (S ; P ); : : : ; (Sn; Pn); R ) be a PCS grammar system with -free context-free components. Take a deterministic nite automaton A = (Q; N [ T; s ; F; ) recognizing the language R . We construct the PC grammar system ?0 = (N 0 ; K 0; T; (S ; P 0 ); (S ; P 0 ); : : : ; (Sn; Pn0 )) as follows. Take N 00 = N [ fA j A 2 N g [ f(s ; A; s ) j A 2 N; s ; s 2 Qg: For w 2 (N [ T ) and s; s0 2 Q, apply the following algorithm: 1. write w = : : : k ; k  1; i 2 N [ T; 1  i  k; 2. for any s ; : : : ; sk? 2 Q, consider the string w0 = s s : : : sk? k s0 ; 3. for i 2 T and si = (si? ; i), replace si? i si in w0 by i; 4. if i 2 N and si = (si? ; i), then nondeterministically replace si? isi in w0 by i or by (si? ; i; si); 5. if i 2 N and si 6= (si? ; i), then replace si? isi in w0 by (si? ; i; si). Denote by M (w; s; s0) the set of strings over N 00 [ T obtained in this way; clearly, this is a nite set. For each i; 2  i  n, denote by (i) the length of the longest possible derivation in Pi; if Pi can generate a terminal string, then (i) = 1. Denote  = maxf(i) j 2  i  n; (i) < 1g: Now, consider N 0 = N 00 [ fX g [ fXj j 1  j  g; and P 0 = P [ fA ! w j A ! w 2 P g; Pi0 = fSi ! z j Si ! w 2 Pi; z 2 M (w; s ; sf ); for sf 2 F g [ f(s; A; s0) ! z j A ! w 2 Pi; s; s0 2 Q; z 2 M (w; s; s0)g [ Pi00; where  fS ! X; X ! X g; 1, 00 Pi = fSii ! X ; X ! X ; : : : ; X i ? ! X i g; ifif ((ii)) = < 1, 1

1

1

0

1

1

2

1

1

2

2

1

2

+

1

2

1

2 1 1

1

1

2

2

1

1

1

1

1

1

1

1

1

1

1

0

1

1

2

( )

1

( )

for each i = 1; 2; : : : ; n. We have the equality Lr (?0 ) = Lt (?). Let us examine the work of ?0. By the rules in Pi0 ? Pi00 we can simulate the derivations in Pi, at the same time checking whether or not the obtained string is in the regular language R . If this is the case, then the string contains only symbols in N [ T [ fA j A 2 N g, otherwise also symbols of the form (s; A; s0); A 2 N; s; s0 2 Q, remain. If a string containing such a symbol is communicated to P 0 , then the symbol (s; A; s0) will never be removed, hence the derivation cannot produce a terminal string. Thus, each comunication in ?0 corresponds to a correct communication in ?. Also the rewriting steps in ? are reproduced in ?0 (P 0 contains all rules in P plus rules for rewriting symbols A, A 2 N , whereas the rules in Pi0 ? Pi00; 2  i  n, simulate rules in Pi). A problem appears with the derivations in components Pi which either do not communicate a string to P or, after communicating a string, the derivation continues without communicating again from that component. The intersection with R could limit the length of the derivation in Pi. In order to avoid such a situation, one can use the rules in Pi00. Nondeterministically, at the beginning of a derivation in the component i, we can introduce the symbol X when Pi is able to work for ever (or to produce a terminal string) and X otherwise; the second case will limit the length of the subsequent derivation as Pi does, to at most (i) steps. No symbol X; Xj can be rewritten in P 0 , hence no further communication from the ith component is possible. Therefore, the equality Lr (?0) = Lt (?) holds. When ? is right-linear, then ?0 is rightlinear, and when ? is -free, then also ?0 is -free. When ? contains -rules, then we construct ?0 with P 0 as above and with Pi0 containing also the rules fSi !  j Si !  2 Pig [ f(s; A; s) !  j A !  2 Pi; s 2 Qg: We obtain again Lr (?0) = Lt (?). 2 In the context-sensitive case the equalities corresponding to those in Theorem 1 follow from the relations pointed out at the end of Section 2 and from the following result: t CS = CPCS t CS = CS; n; m  1: Theorem 3.2. CPCSn;m ; 1

1

1

1

1

1

1

1

1

Proof:

The same construction as in the proof of Theorem 7.3, [6], where one proves that CPCCS  CS , can be used, with simple modi cations needed by checking whether or not the communicated strings belong to the selectors. 2 Moreover, we have Theorem 3.3. CS = PCS t;CS = PCS t;CS  PCS t;CS = PCSt;CS = RE: 1

2

3

Proof:

The equality CS = PCS t;CS has been pointed out in Lemma 1, PCS t;CS = RE follows from Lemma 2 and from the corresponding equality for PC grammar systems. The inclusion PCS t;CS  CS can be proved as in [12]. 2 As it is expected, the other modes of selecting the communicated strings, di erent from t, can simulate the erasing of symbols, a fact which makes plausible the next result: Theorem 3.4. CPCS q; CS = PCS q; CS = CPCSq;CS = PCSq;CS = RE , q 2 ff; p, l; M; mg. 1

3

2

21

21

Proof:

Clearly, it is enough to prove the inclusion RE  CPCS q; CS: 21

Take L  T ; L 2 RE , and write [ L = (L \ fx 2 T  j jxj  2g) [ fag@al (@br (L))fbg: a;b2T

Each language La;b = @al (@br (L)) is in RE . According to Theorem 9.9 in [29], there are L0a;b 2 CS and Xb; Y two new symbol, such that (1) L0a;b  La;b XbY  , and (2) for each w 2 La;b there is i  0 such that wXbY i 2 L0a;b . Take a context-sensitive grammar Ga;b = (Na;b; T [ fXb; Y g; Sa;b; Pa;b) such that L(Ga;b ) = L0a;b . Without any loss of generality, we may assume that Na;b \ Nc;d = ; for (a; b) 6= (c; d); a; b; c; d 2 T . We construct the PCS grammar system ? = (N; K; T; (S ; P ); (S ; P ); R ), where [ N= Na;b [ fS ; S ; Y g [ fXa j a 2 T g, a;b2T P = fS ! S ; S ! (Q ; 1)g[ [ fXa ! a j a 2 T g [ fS ! x j x 2 L; jxj  2g, P = f[ S ! XaSa;b Y j a; b 2 T g [ fY ! Y g[ [ Pa;b , a;b2T R = fXawXb j a; b 2 T; w 2 T g. The component P generates a string of the form Xa wXbY i, for some a; b 2 T; w 2 La;b ; i  1. In the meantime, P uses the rule S ! S . Because of the markers Xa; Xb, all selection modes coincide. The pre x XawXb is transmitted to P when the rule S ! (Q ; 1) is used, whereas the sux Y i remains in the second component. Because we start the derivation in P by introducing one occurrence of Y , we have i  1, hence the rule Y ! Y can be used in P during the steps when P replaces Xa and Xb by a; b, respectively. Consequently, we obtain Lq (?) = L(G), for all q 2 ff; p; l; M; mg: 2 1

1

1

1

1

2

2

1

2

2

1

2

1

2

1

1

2

1

1

1

1

1

2

2

2

1

For the non-centralized case the previous result can be considerably improved: Theorem 3.5. CS  PCS q; CF; RE = PCS q; CF , for all q. 21

21

Proof:

Take L  T ; L 2 RE . As in the previous proof, we write [ L = (L \ fx 2 T  j jxj  2g) [ fagLa;b fbg; a;b2T

for La;b = @al (@br (L))fbg: Take a grammar Ga;b = (Na;b; T; Sa;b; Pa;b) for La;b in Kuroda normal form, that is with the rules in Pa;b of the forms A ! x; x 2 (Na;b [ T ) ; jxj  2, AB ! CD; A; B; C; D 2 Na;b . If A = B for some rule r : AB ! CD, then we replace it by A ! Ar ; Ar A ! CD and the generated language is not changed. Therefore, without any loss of generality, we may assume that A 6= B for each rule AB ! CD 2 Pa;b. Similarly, we can assume that Na;b \ Nc;d = ; for (a; b) 6= (c; d) and, moreover, that the rules AB ! CD in various sets Pa;b are labeled by distinct labels. We construct the PCS grammar system ? = (N; K; T; (S ; P ); (S ; P ); R ); where [ N = Na;b [ fS ; S ; X ; X ; X g [ fZa; Za0 j a 2 T g[ a;b2T [ fAr ; A0r ; A00r ; A000r j r : AB ! CD 2 Pa;b or r : BA ! CD 2 Pa;b, 1

1

1

2

2

1

2

1

2

3

for some a; b 2 T g, P = fS ! ZaSa;b Zb j a; b 2 T g[ [ fA ! x j A ! x 20 Pa;b0 ; a; b 200 T g[ [ fA ! Ar ; Ar ! A0r ; A0r ! A00r ; A0000r ! A000r000; A000r000 ! C , B ! B r ; B r ! B r ; Br ! B r ; B r ! B r ; B r ! D j r : AB ! CD 2 Pa;b; a; b 2 T g[ [ fS 0 ! X ; X0 ! (Q ; 1)g[ [ fZc ! Zc; Zc ! c j c 2 T g[ [ fA ! A j A 2 Na;b; a; b 2 T g[ [ fS ! x j x 2 L; jxj  2g, P = fS ! X ; X ! X ; X ! X ; X ! (Q ; 1)g[ [ fSZc ! Zc0 j c 2 T g, R = a;b2T Ra;b, 1

1

1

1

1

1

1

2

1

2

2

2

2

3

3

1

1

for

Ra;b = Za (Na;b [ T )Zb [ Za0 (Na;b [ T ) Zb0 [ [ Za (Na;b [ T )fAr Br ; A0r Br0 ; A00r Br00 ; A000r Br000 j  r : AB ! CD 2 Pa;bg(Na;b [ T ) Zb[ [ Za0 (Na;b [ T )fAr Br ; A0r Br0 ; A00r Br00 ; A000r Br000 j  0 r : AB ! CD 2 Pa;bg(Na;b [ T ) Zb. We obtain the equality L = Lq (?) for all q 2 ft; f; p; l; M; mg: First, it is easy to see that the inclusion  holds. Indeed, the strings x 2 L; jxj  2, are directly introduced by rules of P . For a string z = awb 2 L, we can simulate each derivation S =) w in Pa;b by a derivation in ?. We do not construct it here, it will be implicitly seen that this is the case from the discussion about the converse inclusion, Lq (?)  L. We have to show that ? cannot produce parasitic strings. If we start with (S ; S ) =) (x; X ); x 2 L; jxj  2, then the derivation leads to a string in L. Suppose that we start with (S ; S ) =) (ZaSa;b Zb; X ): After introducing X ; the component P has to follow the cycle X ! X ! X ! (Q ; 1). In total, counting also the step S ! X , we have four steps. Because P contains the rule A ! A for each A 2 N , P can work for any number of steps. The rules A ! x in all Pa;b are in P , hence they can be simulated. They introduce only symbols in Na;b [ T . Because the work of P can be continued only a limited number of steps, in some moment P introduces (Q ; 1), hence a communication must be performed. The string is controlled by R , it has to start and to end with Za ; Zb or with Za0 ; Zb0 , and it has to contain either no subword Ar Br or exactly one such subword, maybe with primed Ar ; Br { always with the same number of primes for both these symbols { for a rule r : AB ! CD 2 Pa;b. In four steps of a derivation, the component P cannot start using a rule A ! Ar (or B ! Br ) and nish by using the corresponding rule A000r ! C (or Br000 ! D). A string with only one symbol of the type Ar ; Br , maybe primed, cannot be communicated. Therefore, either rules A ! x from Pa;b and, possibly, A ! A for A 2 Na;b are used, or both rules A ! Ar ; B ! Br for r : AB ! CD were used. In this way, we send to P a string of the form Zax Ar Br x Zb. On such a string, P can perform two steps, replacing Za; Zb by Za0 ; Zb0 . If the rst component starts by using again a rule S ! ZcSc;dZd, then the derivation is blocked after two rewriting steps. Therefore, we have to use S ! X , which will be followed by X ! (Q ; 1). We communicate back to P the string Za0 x Ar Br x Zb0 . After four steps, again P will introduce (Q ; 1). If Za0 ; Zb0 are still present in the current string, then the derivation is blocked, P cannot do any rewriting. Therefore, P has either to produce a terminal string (then the 1

1

1

2

1

2

1

1

2

2

1

1

2

3

1

1

1

1

2

2

1

1

1

2

1

2

2

1

1

1

1

1

1

1

2

1

2

2

1

derivation is terminated), or to replace both Za0 ; Zb0 with Za; Zb and to use two other rules. These rules can be either of the forms A ! x 2 Pa;b; A ! A; A 2 N (then again a string of the form Za x0 Ar Br x0 Zb is communicated) or both Ar and Br are replaced by A0r ; Br0 , respectively. The process is iterated. Always the number of primes grows synchronously for Ar and Br . Eventually, we use the rules A000r ! C; Br000 ! D. This simulates the use of the rule r : AB ! CD (in a correct way, due to the control of R about the communicated strings, to the fact that A 6= B , and to the fact that we have supposed the rules labeled by distinct labels). It is now clear that what ? can do is exactly to simulate the rules in Pa;b. When the rules Za0 ! a; Zb0 ! b are used, then the string between these symbols must be terminal, otherwise the derivation is blocked (in that moment, the second component contains the string (Q ; 1)). Due to the markers Za; Zb; Za0 ; Zb0 , the modes of selecting the communicated string coincide and the t mode is always used. (This also ensures the returning to axioms after each communication, an essential detail in the previous discussion.) Consequently, L = Lq (?); for all q. It is easy to see that when the grammars Ga;b ; a; b 2 T , are context-sensitive, hence free, then the PCS grammar system ? is -free. The inclusions CS  PCS q; CF; RE  PCS q; CF  are proved. The second one is an equality by Turing-Church thesis. 2 1

2

1

1

21

21

The inclusion PCSq;CF  CS is an open problem (hence we do not know whether or not the inclusion CS  PCS q; CF is, in fact, an equality). As probably CS ? PCCF 6= ; (this is also open), Theorem 5 proves that the selection of communicated strings (strictly) increases the generative capacity of PC grammar systems. 21

4. PC grammar systems with target conditions We shall consider now PC grammar systems with restrictions imposed not on the individual strings which are communicated, but on the whole string obtained by the component which has received the communicated strings. This is somewhat similar to the hypothesis language considered in [7] for CD grammar systems, and also closer to the idea of negotiation as discussed in the Introduction (it express the satisfaction of the receiver's goals, by communication). A PC grammar system (of degree n; n  1) with target conditions (a PCT grammar system, for short), is a construct ? = (N; K; T; (S ; P ; M ); : : : ; (Sn; Pn; Mn )); where N; K; T; Si; Pi; 1  i  n, are exactly as in a PC grammar system, and Mi  (N [ T ) are regular languages, 1  i  n; they are called the target languages of the components of ?. Both the rewriting steps and the communication steps are de ned in ? as in the underlying PC grammar system ? = (N; K; T; (S ; P ); : : : ; (Sn; Pn)), with the following di erence: the relation (x ; : : : ; xn) =)com;q (y ; : : : ; yn); q 2 fr; nrg, holds in ? if it holds in ?0 and, moreover, if jxi jK > 0 and yi 2 (N [ T ) (hence yi is obtained by replacing the query symbols in xi by the corresponding strings), then yi 2 Mi; 1  i  n. We denote by PCTnX the family of languages generated in the returning mode by PCT grammar systems with at most n components, n  1, of type X . As for PC families, we add the letter C when only centralized systems are used and the letter N when working in the non-returning mode. (Of course, in the centralized case only the master component needs a target language.) From the de nitions, we have 1

1

1

0

1

1

1

1

Lemma 4.1.

1. CPCTnX  PCTnX; NCPCTnX  NPCTnX; for all n  1; and X . 2. PCTnX  PCTn X 0; CPCTnX  CPCTn X 0; NPCnX  NPCTn X 0 , NCPCTnX  NCPCTn X 0; for all n  n0; X  X 0. 3. X = PCT X = CPCT X = NPCT X = NCPCT X , for all X . A usual PC grammar system can be considered a PCT one, with the target language (N [T ) , hence we have Lemma 4.2. PCnX  PCTnX , CPCnX  CPCTnX , NPCnX  NPCTnX , NCPCnX  NCPCTnX , for all n  1 and X. All relations in Lemmas 3, 4 hold true also when replacing the subscript n by . For the context-sensitive case, these relations, together with the relations mentioned at the end of Section 2 and together with the proofs in [6] and [12], imply 0

0

0

0

1

1

1

1

Theorem 4.1.

1. CPCTCS = NCPCT CS = CS: 2. CS = PCT CS = PCT CS  PCT CS = PCTCS = RE: 3. CS = NPCT CS  NPCT CS = NPCTCS = RE: These relations can be signi cantly strenghtened. Theorem 4.2. RE = CPCT CF  = PCT CF : 1

2

3

1

2

3

3

Proof:

The target language of the master component can be used in order to control the correct simulation of a grammar in Kuroda normal form in a similar way to that used in the proof of Theorem 5 for selector languages. Take L  T  ; L 2 RE , and a grammar G = (N; T; S; P ) in Kuroda normal form such that L(G) = L and for each rule r : AB ! CD in P we have A 6= B (as in the proof of Theorem 5, this can be arranged if we also allow chain rules in P ). We construct the PCT grammar system ? = (N 0 ; K; T; (S; P ; M ); (S ; P ; ;); (S ; P ; ;)); where N 0 = N [ fA0 ; A00 j A 2 N g [ fAr ; Br j r : AB ! CD 2 P g [ fS ; S g; P = fA ! xQ j A ! x 2 P g [ [ fS ! g [ [ fA ! Ar ; Ar ! Q ; B ! Q ; Br ! Q ; C 0 ! Q ; C 00 ! C; D00 ! D j r : AB ! CD 2 P g; 1

1

2

2

3

3

2

1

3

3

3

2

2

2

2

P = fS ! S g [ [ fS ! Br ; S ! C 0; S ! D00; S ! C 00 j r : AB ! CD 2 P g; P = fS ! S g; M = (N [ T )S (N [ T ) [ [ (N [ T )fAr Br ; C 0Br ; C 0D00; C 00D00 j r : AB ! CD 2 P g(N [ T ): The system ? works as follows. Each rule A ! x 2 P can be simulated in P ; a query symbol Q is introduced at each such step, hence S is transmitted to P . The obtained string must be of the form x S x ; with x ; x 2 (N [ T ), hence no symbol Ar ; Br ; C; C 0; D00 can be present, for some r : AB ! CD 2 P . 2

2

2

2

3

1

3

2

2

2

3

3

1

3

3

1

3

2

1

2

1

If a rule X ! Q is used in P , then we have to communicate to P a symbol di erent from S . The obtained string in P must contain a substring Ar Br ; C 0Br ; C 0D00 or C 00D00 , for some r : AB ! CD 2 P , otherwise the communication is not accepted. Therefore, we cannot use both A ! Ar ; Ar ! Q , also we cannot use directly B ! Q . We have to use A ! Ar and B ! Q , for neighboring positions in the string of P . No rule of the form A ! xQ can be used in the presence of Ar (as well as in the presence of primed symbols), because the communication is not possible. We have to continue by communicating Br to P , hence obtaining a string of the form x Ar Br x , with x ; x 2 (N [ T ); and r : AB ! CD 2 P . If we continue with Br ! Q , then the only possibility is to get from P the symbol Br again, hence we change nothing. If we use Ar ! Q , then we have to communicate C 0, hence we obtain x C 0Br x . Now C 0 ! Q cannot be used without returning to x C 0Br x . Using Br ! Q we will obtain x C 0 D00x in the rst component (no other string { excepting x C 0 Br x again { is accepted). The continuation is again unique: we use C 0 ! Q and we get x C 00 D00x (if we replace D00 by D, then C 0 ! Q is not possible and the derivation is blocked). In x C 00D00x both C 00 and D00 can be replaced by C; D, respectively. In this way, the rule r : AB ! CD 2 P has been correctly simulated. This proves that L(G)  Lr (?), and, moreover, that no parasitic string can be produced, hence we have, in fact, the equality L(G) = Lr (?). Observe the role of the third component, used for separating the simulation of contextfree rules in P from the simulation of non-context-free rules. We have obtained the inclusion RE  CPCT CF . The inclusions CPCT CF   PCT CF   RE are obvious. 2 We do not know whether the previous result can be improved to CPCT CF  = RE . On the other hand, the use of erasing rule S !  can be avoided with the price of increasing the number of the components. Theorem 4.3. CS  CPCTCF: 2

1

2

1

1

2

2

2

1

3

1

1

2

1

2

2

2

2

1

2

2

2

1

1

1

2

2

2

2

1

2

2

1

2

3

3

3

2

3

Proof:

Start as in the previous proof from a language L  T  ; L 2 CS , generated by a (-free) grammar G = (N; T; S; P ) in Kuroda normal form. Assume that N [ T = f ; ; : : : ; mg. We construct the PCT grammar system ? = (N 0 ; K; T; (S; P ; M ); (S ; P ; ;); (S ; P ; ;); : : : ; (Sm ; Pm ; ;)), where 1

1

1

2

2

3

3

+2

2

+2

N 0 = N [ fA0; A00 j A 2 N g [ fAr ; Br j r : AB ! CD 2 P g [ [ fSi j 2  i  m + 2g [ f i j 1  i  mg; P = fA ! xQi j A ! x i 2 P; x 2 (N [ T ) ; 1  i  mg [ [ f i ! i j 1  i  mg [ [ fA ! Ar ; Ar ! Q ; B ! Q ; Br ! Q ; C 0 ! Q ; C 00 ! C; D00 ! D j r : AB ! CD 2 P g; P = fS ! S g [ [ fS ! Br ; S ! C 0; S ! D00; S ! C 00 j r : AB ! CD 2 P g; P i = fS i ! i; i ! i g; for i = 1; 2; : : : ; m; M = (N [ T ) f i j 1  i  mg(N [ T ) [ [ (N [ T ) fAr Br ; C 0Br ; C 0D00 ; C 00D00 j r : AB ! CD 2 P g(N [ T ): Now, the separation of simulating context-free and non-context-free rules in P is accomplished using the components 3, 4,. . . , m + 2. As in the previous proof, the interplay between the rst and the second components, controlled by the target language M , ensures 1

+2

2

2

2

2

2+

2

2

2

2

2

2

2

2+

1

1

the correct simulation of rules r : AB ! CD 2 P . Consequently, we obtain L(G) = Lr (?).

2

The component P in the proof of Theorem 7 and the components P ; : : : ; Pm in the proof of Theorem 8 can be supposed to work in the non-returning mode. Again by increasing the number of components, we can obtain a system working in the non-returning mode in the rigorous sense. The idea is to replace the component P , the same in both the previous proofs, by components associated to pairs (r; Br ); (r; C 0); (r; D00); (r; C 00), for r : AB ! CD 2 P , as follows: P r;X = fSr;X ! X; X ! X g; for each X 2 fBr ; C 0; D00; C 00g as above, and to introduce in P , instead of rules X ! Q , rules X ! Q r;X . Therefore, we obtain Theorem 4.4. RE = NCPCT CF  = NPCTCF ; CS  NCPCTCF . 3

3

+2

2

(

)

1

(

2

)

5. Final remarks From a practical point of view, also a combination of the restrictions investigated here deserves to be considered: systems with both restricted selection of the communicated strings and with target languages (such a complex model can be closer to the intuitive idea of a negotiation in a multi-agent system). However, in view of results like those in Theorems 5, 7, 8, the unexpected fact appears that one of the two sides of the control on the communication suces: both by selection of individual messages and by target restrictions we get the full power of Turing machines (characterizations of recursively enumerable languages by systems with context-free rules). This is worth emphasizing, because it can be useful when designing negotiation procedures in multi-agent systems: redundant negociation tools can be avoided. From mathematical point of view, the previously considered classes of PC grammar systems still need further investigations, many problems being not yet settled. We hope to return to this topic in another paper. For instance, a more elaborated variant of negotiation, modelled by PC grammar systems with target conditions, can be considered. In the usual meaning of the concept, a negotiation supposes some turns, some exibility of the parts, aiming to reach a compromise when the initial criteria cannot be satis ed. This can be captured in our PC grammar systems as follows. Consider, for simplicity, a centralized system with target conditions, ? = (N; K; T; (S ; P ; M ); (S ; P ; ;); : : : ; (Sn; Pn; ;)), and de ne the derivation relation as follows: 1. The rewriting is performed as usually (componentwise, synchronously). 2. In a communication step, if the rst component obtains a string in M , then it is satis ed; otherwise, the strings communicated to P are sent back to the corresponding components, which have to continue to process them. Several variants can be considered: 2.1. The senders work until a string in M can be obtained after communication. 2.2. A limit on the number of steps is imposed and the system is blocked if P is not satis ed in that interval of time. 2.3. The senders work unsynchronously (as in 2.1 or 2.2, hence four cases can be considered). During this "negotiated communication steps" the master, as well as the components not involved in communication, are waiting. 1

1

1

2

2

1

1

1

1

Some diculties can appear in the non-centralized case when certain target conditions are not satis ed at the middle of a communication chain. We do not enter here into details and we conclude by stressing again the exibility and the usefulness of (PC) grammar systems theory for modelling practical aspects of multi-agent systems, in general, the fact that grammar systems theory has many unexplored capabilities.

References [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22]

R. Axelrod, The Evolution of Cooperation, Basic Books, 1994. E. M. Brown, Boolean Reasoning, Kluwer, Dordrecht, 1990. S. H. Clearwater, B. A. Huberman, T. Hogg, Cooperative problem solving , in Computation: The Micro and Macro View (B. A. Huberman, ed.), World Sci. Publ., Singapore, 1992, pp. 33-70. J. H. Connolly, E. A. Edmunds, CSCW and Arti cial Intelligence, Springer-Verlag, Berlin, 1994. E. Csuhaj-Varju, J. Dassow, On cooperating distributed grammar systems, J. Inform. Process. Cybern., EIK, 26 (1990), 49 { 63. E. Csuhaj-Varju, J. Dassow, J. Kelemen, Gh. Paun, Grammar Systems. A Grammatical Approach to Distribution and Cooperation, Gordon and Breach, London, 1994. J. Dassow, Cooperating distributed grammar systems with hypothesis languages, J. Exper. Th. AI, 3 (1991), 11 { 16. J. Dassow, Gh. Paun, Regulated Rewriting in Formal Language Theory, SpringerVerlag, Berlin, Heidelberg, 1989. R. Davis, R. G. Smith, Negotiations as a metafor for distributed problem solving, Arti cial Intelligence 20, 63-109, 1989. S. Dumitrescu, Nonreturning OC grammar systems can be simulated by returning systems, Theoretical Computer Sci., to appear. S. Dumitrescu, Gh. Paun, On the power of parallel communicating grammar systems with right-linear components, submitted, 1995. R. Freund, Gh. Paun, C. M. Procopiuc, O. Procopiuc, Parallel communicating grammar systems with context-sensitive components, in [12], 166 { 174. B. Hayes-Roth, Agents on stage: advancing the state of the art of AI, in Proceedings of IJCAI-95; Fourteenth Joint Conference on Arti cial Intelligence, Montreal, 967-971, 1995. T. Ishida, Parallel, Distributed and Multiagent Production Systems, LNCS 878, Springer-Verlag, Berlin, 1994. R. Meersman, G. Rozenberg, Cooperating grammar systems, Proc. MFCS 78, LNCS 64, Springer-Verlag, Berlin, 1978, 364 { 374. V. Mihalache, Matrix grammars versus parallel communicating grammar systems, in Mathematical Aspects of Natural and Formal Languages (Gh. Paun, ed.), World Sci. Publ., Singapore, 1994, 293 { 318. V. Mihalache, On the generative capacity of parallel communicating grammar systems with regular components, Computers and AI, 1996. Gh. Paun, Grammar systems: A grammatical approach to distribution and cooperation, Proc. ICALP Conf., LNCS 944 (1995), 429 { 443. Gh. Paun, Generating languages in a distributed way: grammar systems, XIth Congress on Natural and Formal Languages, Tortosa, 1995, 45 { 67. Gh. Paun, Parallel comunicating grammar systems. A survey, XIth Congress on Natural and Formal Languages, Tortosa, 1995, 257 { 283. Gh. Paun, L. S^antean, Parallel communicating grammar systems: the regular case, Ann. Univ. Buc., Ser. Matem.-Inform., 38 (1989), 55 { 63. Z. Pawlak, Rough Sets; Theoretical aspects of reasoning about Data, Kluwer, Dordrecht, 1991.

[23] Z. Pawlak, A. Skowron, Rough membership functions, in Advances in the DempsterShafer Theory of Evidence (R.R. Yager, M. Fedrizzi , J. Kacprzyk, eds.), Wiley, New York, 1994, pp. 251-271. [24] L. Polkowski, A. Skowron, Rough mereology, in Proceedings ISMIS-94; International Symposium on Methodologies for Intelligent Systems, LNAI 869, Springer-Verlag, Berlin, 1994, pp.85-94. [25] L. Polkowski, A. Skowron, Introducing rough mereological controllers: rough quality control, in Proceedings RSSC-94; The Third International Workshop on Rough Sets and Soft Computing,San Jose, CA, November 1994; also in Soft Computing (T . Y. Lin, A. M. Wildberger, eds.), The Society for Computer Simulation, San Diego, 1995. [26] L. Polkowski, A. Skowron, Rough mereology: a new paradigm for approximate reasoning, International Journal of Approximate Reasoning, in print. [27] L. Polkowski , A. Skowron, Rough mereology and analytical morphology: new developments in rough set theory, in Proceedings of WOCFAI-95; Second World Conference on Fundamentals of arti cial Intelligence, Angkor, Paris, 1995, pp. 343-354. [28] L. Polkowski, A. Skowron, Rough mereological approach to knowledge-based distributed AI, in Proceedings of WCES-3; Third World Congress on Expert Systems, Seoul, Korea, February 1996, in print. [29] A. Salomaa, Formal Languages, Academic Press, New York, 1973. [30] A. Skowron, Synthesis of adaptive decision systems from experimental data, in Proceedings of SCAI-95; The Fifth Scandinavian Conference on Arti cial Intelligence, IOS Press, Amsterdam, 1995, pp. 220-238. [31] A. Skowron, L. Polkowski, Rough mereological foundations for design, analysis, synthesis and control of complex systems, in Proceedings of Second Annual International Conference on Information Sciences, Wrightsville Beach, NC, October 1995, in print. [32] D. Sriram, R. Logcher, S. Fukuda, Computer-Aided Cooperative Product Development,LNCS 492, Springer-Verlag, Berlin, 1991.