1 / 36

Refining the Nonterminal Complexity of Graph-controlled Grammars

Refining the Nonterminal Complexity of Graph-controlled Grammars. Henning FERNAU. Rudolf FREUND. Klaus REINHARDT. Marion OSWALD. Wilhelm-Schickard-Institut für Informatik, Univ. Tübingen, Tübingen, Germany. Faculty of Informatics TU Wien, Wien, Austria. Overview. - the problem.

arien
Download Presentation

Refining the Nonterminal Complexity of Graph-controlled Grammars

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Refining the Nonterminal Complexity ofGraph-controlled Grammars Henning FERNAU Rudolf FREUND Klaus REINHARDT Marion OSWALD Wilhelm-Schickard-Institut für Informatik, Univ. Tübingen, Tübingen, Germany Faculty of Informatics TU Wien, Wien, Austria

  2. Overview - the problem - the history - the solution • related problems and solutions • open problems

  3. Graph-controlled grammars A (context-free) graph-controlled grammarG is a construct (N,T,P,S,R,L(in),L(fin)) where (N,T,P,S) is a context-free grammar, V := N  T, R is a finite set of rules r of the form ( l(r): p(l(r)),σ(l(r)),φ(l(r)) ), where l(r)Lab(G), a set of labels, p(l(r))P, σ(l(r))Lab(G) is the success field, φ(l(r))Lab(G) is the failure field of the rule r; L(in)Lab(G) is the set of initial labels, and L(fin)Lab(G) is the set of final labels.

  4. Graph-controlled grammar - derivations For ( l(r): p(l(r)),σ(l(r)),φ(l(r)) ) and v,uV* we define (v,l(r)) G (u,k) if and only if ∙ either p(l(r)) is applicable to v, v u, and k(l(r)), ∙ or p(l(r)) is not applicable to v, u=v, and k(l(r)).

  5. Graph-controlled grammar - languages The language generated by G is L(G) ={v T* : (w0,l0) G (w1,l1)… G(wk,lk), k ≥ 1,wjV*, ljLab(G)for 0 ≤ j ≤ k, w0= S, wk = v, l0L(in), lkL(fin) }.

  6. Graph-controlled grammar - complexity • GC( n,j,k) is the family of languages • over some terminal alphabet of cardinality k 1, • that can be generated by graph-controlled • grammars with at most n 1 nonterminals, • out of which at most j  0nonterminals are • used in the appearance checking mode • GCac := k 1, n 1,j 0GC( n,j,k) GC := k 1, n 1GC( n,0,k)

  7. Graph-controlled grammars – the nonterminal complexity problem For each k 1, which is the minimal number n  1 and the minimal number j  1 such that GC( n,j,k) = RE(k), where RE(k) is the family of recursively enumerable languages over a k-letter alphabet.

  8. Programmed grammars A (context-free) programmed grammarG is a graph-controlled grammar (N,T,P,S,R,L(in),L(fin)) where L(in) = L(fin) = Lab(G). In a(context-free) programmed grammar G there is no specific starting rule for a derivation, and moreover, every derivation yielding a terminal string adds this string to L(G).

  9. Programmed grammars - complexity • P( n,j,k) is the family of languages • over some terminal alphabet of cardinality k 1, • that can be generated by programmed • grammars with at most n 1 nonterminals, • out of which at most j  0nonterminals are • used in the appearance checking mode • Pac := k 1, n 1,j 0P( n,j,k) P := k 1, n 1P( n,0,k)

  10. Matrix grammars A (context-free) matrix grammar G is a construct (N,T,P,S,M,F) where (N,T,P,S) is a context-free grammar, M is a finite set of finite sequences of productions (an element of M is called a matrix), and FP.

  11. Matrix grammars - derivations For a matrix m(i) = [mi,1,…,mi,n(i)] in M and v,uV* we define v m(i)u if and only if there are w0,w1,…,wn(i)V* such that w0= v, wn(i) = u, and for each j, 1 ≤ j ≤ n(i), ∙ either wj-1m(i,j) wj ∙ or m(i,j) is not applicable to wj-1, wj = wj-1, and m(i,j)F.

  12. Matrix grammars - languages The language generated by G is L(G) = {v T* : Sm(i,1)w1…m(i,k) wk,wk = v, wjV*, m(i,j) M for 1 ≤ j ≤ k ,k ≥ 1}.

  13. Matrix grammars - complexity • M( n,j,k) is the family of languages • over some terminal alphabet of cardinality k 1, • that can be generated by matrix • grammars with at most n 1 nonterminals, • out of which at most j  0nonterminals are • used in the appearance checking mode • Mac := k 1, n 1,j 0M( n,j,k) M := k 1, n 1M( n,0,k)

  14. Graph-controlled, programmed, and matrix grammars RE = Mac = Pac = GCacandM = P = GC. Jürgen Dassow and Gheorghe Păun: Regulated Rewriting in Formal Language Theory. Volume 18 of EATCS Monographs in Theoretical Computer Science. Springer, 1989.

  15. Graph-controlled, programmed, and matrix grammars – the importance of appearance checking RE = Mac = Pac = GCac M = P = GC. D. Hauschildt and M. Jantzen: Petri net algorithms in the theory of matrix grammars. Acta Informatica, 31 (1994), pp. 719 - 728. M( n,0,1) = REG(1).

  16. A famous example from GC( 2,2,1) L = { a2n : n  1 } G =({A,B},{a},P,A,R,{1},{4}) P = { A  BB, B  A, B  a } Lab(G) = { 1,2,3,4 } R = { ( 1: A  BB, {1},{2,3} ), ( 2: B  A, {2},{1} ), ( 3: B  a, {3},{4} ), ( 4: B  a, , ) }

  17. The history – first results Gheorghe Păun: Six nonterminals are enough for generating each r.e. language by a matrix grammar. International Journal of Computer Mathematics, 15 (1984), pp. 23 - 37. RE(k) = M( 6,6,k) for allk 1.

  18. The history continued MCU 2001: Two new results obtained in parallel in Proc. 3rd MCU. LNCS 2055, Springer, 2001. RE(k) = GC( 3,3,k) = P( 3,3,k) = M( 4,4,k) fork 1. Henning Fernau: Nonterminal complexity of programmed grammars. In: MCU 2001, 202 - 213. RE(k) = GC( 3,2,k) = P( 4,2,k) = M( 4,3,k) = M(*,2,k) fork 1. Rudolf Freund and Gheorghe Păun: On the number of non-terminal symbols in graph-controlled, programmed and matrix grammars. In: MCU 2001, 214 - 225.

  19. The history of the latest results Theorietag 2001 in Magdeburg: Klaus Reinhardt: The reachability problem of Petri nets with one inhibitor arc is decidable. GC( n,1,1)  RE(1) proved by Henning Fernau and Rudolf Freund, and as well: GC(1,1,k) = GC(1,0,k) and RE(1) = GC(2,2, 1).

  20. Newest results Theorem 1. RE(k) = GC( 2,2,k) for all k 1. Theorem 2. GC( n,1,1)  RE(1) proved by using a decibability result for priority-multicounter-automata established by Klaus Reinhardt.

  21. Register machines - definition • A (deterministic)register machine is a construct M = (n,R,l0,lh) where n is the number of registers, R is a finite set of instructions injectively labelled with elements from a given set lab(M), l0 is the initial/start label, and lh is the final label. The instructions are of the following forms: • l1:(ADD(r), l2)Add 1 to the contents of register r and proceed to the instruction (labelled with) l2. • l1:(SUB(r), l2, l3) If register r is not empty, then subtract 1 from its contents and go to instruction ) l2, otherwise proceed to instruction ) l2 . • l1:halt Stop the machine.

  22. Register machines – results (accept) Proposition 3. For any recursively enumerable set L  N there exists a register machine M with two registers accepting L in such a way that, when starting with 2n in register 1 and 0 in register 2, M accepts the input 2n (by halting with both registers being empty) if and only if n  L.

  23. Register machines – results (compute) Proposition 4. For any partial recursive function f: N  N there exists a register machine M with two registers computing f in such a way that, when starting with 2n in register 1 and 0 in register 2, M computes f(n) by halting with 2f(n) in register 1 and 0 in register 2.

  24. Complexity results for graph-controlled grammars Theorem 1. RE(k) = GC( 2,2,k) for all k 1. Proof: Given L  RE(k), L T*, for some alphabet T = { am : 1  m  k }, we construct a graph-controlled grammar G = ( { A,B } , T , P , A , R , { i }, { f } ) with ( G) = L as follows: Every string in T* can be encoded as a non-negative integer using the function gT: T*  N inductively defined by gT() = 0, gT(am) = m for 1  m  k , and gT(wa) = gT(w) (k+1) +gT(a) for a  T and w T*.

  25. Complexity results for graph-controlled grammars – proof We now iteratively generate wA2gT(w) for some w  T*. The addition of a new symbol a starts with applying the production A aB; then renaming all symbols A to B exhaustively using the sequence of productions A  and B BB finally yields the string waB2gT(w) . Then we simulate a register machine constructed according to Propostion 4 computing 2gT(wa) from 2gT(w) .

  26. Simulation of a register machine by a graph-controlled grammar – ADD l1: (ADD(1) ,l2) is simulated in G by ( l1: A  AA, {l2 }, { l1’ }) and ( l1’: B  BA, {l2 },) ; l1: (ADD(2) ,l2) is simulated in G by ( l1: B  BB, {l2 }, { l1’ }) and ( l1’: A  AB, {l2 },) ;

  27. Simulation of a register machine by a graph-controlled grammar – SUB l1: (SUB(1) ,l2, l3 ) is simulated in G by ( l1: A , {l2 }, { l3 } ); l1: (SUB(2) ,l2, l3 ) is simulated in G by ( l1: B , {l2 }, { l3 } ).

  28. Simulation of a register machine by a graph-controlled grammar – accept After having generated a string w over T and its encoding we simulate a register machine M constructed according to Propostion 3. M checks whether w is in L which is the case if and only if the encoding of w is accepted by M. After halting in the final label, the two registers are empty, hence, the remaining sentential form is terminal, i.e., G has generated the terminal string w. q.e.d.

  29. For graph-controlled grammars this complexity result is optimal RE(k) = GC( 2,2,k) for allk 1 is optimal with respect to the number of nonterminals as well as with respect to the number of nonterminals to be used in the appearance checking mode. This is due to the fact that we can prove GC( n,1,k)  RE(k) for alln  1 and allk 1. In fact, we will show Theorem 2. GC( n,1,1)  RE(1)

  30. Priority-multicounter-automata A priority-multicounter-automaton is a one-way automaton described by A = ( k, Z, T, , z0, E) with the set of states Z, the input alphabet T, the transition relation  (Z x (T  {}) x {0,...,k}) x (Z x {-1,0,1}k), initial state z0 Z, accepting states E Z.

  31. Priority-multicounter-automata - configurations configurations CA = Z x T* x Nk, initial configuration A(x) = <z0,x,0k> configuration transition relation <z,ax,n1,...,nk> |A <z‘,x,n1+i1,...,nk+ik> if and only if z,z‘  Z, a  T  {}, <(z,a,j),(z',i1,...ik)> , and for all i  j ni = 0.

  32. Priority-multicounter-automata - language L(A) = { w : <z0,w,0k> |*A <ze,,0k> } The family of languages over a k-letter alphabet accepted by priority-multicounter-automata with n counters of which at most j can be tested for zero in the restricted way defined above is denoted by PnkCA(j) .

  33. Priority-multicounter-automata - results Theorem 5. (KlausReinhardt: Habilschrift, 2005) The emptiness problem for priority-multicounter-automata is decidable. (The same holds for the halting problem.)

  34. Priority-multicounter-automata – relation to graph-controlled grammars Theorem 6. GC(n,1,1)  Pn1CA(1) . Proof (sketch). The counters count the number of nonterminals. The first counter (the only one tested for zero) corresponds to the only nonterminal symbol that is used in the appearance checking mode. States correspond to labels of G. Reading an input symbol a corresponds to producing the terminal symbol a. The input amis accepted by the automaton if and only if a am can be generated by the grammar.

  35. Complexity results for programmed grammars and matrix grammars RE(k) = P( 3,2,k) = M( 3,3,k) for allk 1. These results are immediate consequences of Theorem 1 and the proof methods used in Rudolf Freund and Gheorghe Păun: From regulated rewriting to computing with membranes: collapsing hierarchies. Theoretical Computer Science 312 (2004), pp. 143 – 188:

  36. Open Problems Programmed grammars: Is the thirdvariable needed? Matrix grammars: Is the thirdvariable needed in the appearance checking mode? The thirdvariable here is needed anyway due to Jürgen Dassow and Gheorghe Păun: Further remarks on the complexity of regulated rewriting. Kybernetika, 21, pp. 213 - 227.

More Related