Presentation is loading. Please wait.

Presentation is loading. Please wait.

Refining the Nonterminal Complexity of Graph-controlled Grammars Faculty of Informatics TU Wien, Wien, Austria Rudolf FREUND Wilhelm-Schickard-Institut.

Similar presentations


Presentation on theme: "Refining the Nonterminal Complexity of Graph-controlled Grammars Faculty of Informatics TU Wien, Wien, Austria Rudolf FREUND Wilhelm-Schickard-Institut."— Presentation transcript:

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

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

3 Graph-controlled grammars A (context-free) graph-controlled grammar G 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* : (w 0,l 0 )  G (w 1,l 1 )…  G (w k,l k ), k ≥ 1, w j  V*, l j  Lab(G) for 0 ≤ j ≤ k, w 0 = S, w k = v, l 0  L(in), l k  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  0 nonterminals are used in the appearance checking mode GC ac :=  k  1, n  1, j  0 GC( n,j,k) GC :=  k  1, n  1 GC( 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 grammar G 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  0 nonterminals are used in the appearance checking mode P ac :=  k  1, n  1, j  0 P( n,j,k) P :=  k  1, n  1 P( n,0,k)

10 Matrix grammars M is a finite set of finite sequences of productions (an element of M is called a matrix), and F  P. 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,

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

12 Matrix grammars - languages The language generated by G is L(G) = {v  T* : S  m(i,1) w 1 …  m(i,k) w k, w k = v, w j  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  0 nonterminals are used in the appearance checking mode M ac :=  k  1, n  1, j  0 M( n,j,k) M :=  k  1, n  1 M( n,0,k)

14 Graph-controlled, programmed, and matrix grammars RE = M ac = P ac = GC ac and M = 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 = M ac = P ac = GC ac  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 = { a 2 n : 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 all k  1.

18 The history continued MCU 2001: Two new results obtained in parallel in Proc. 3rd MCU. LNCS 2055, Springer, 2001. Henning Fernau: Nonterminal complexity of programmed grammars. In: MCU 2001, 202 - 213. RE(k) = GC( 3,3,k) = P( 3,3,k) = M( 4,4,k) for k  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. RE(k) = GC( 3,2,k) = P( 4,2,k) = M( 4,3,k) = M( *,2,k) for k  1.

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. proved by Henning Fernau and Rudolf Freund, and as well: GC( n,1,1)  RE(1) GC(1,1,k) = GC(1,0,k) and RE(1) = GC(2,2, 1).

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

21 Register machines - definition A (deterministic)register machine is a construct M = (n,R,l 0,l h ) where n is the number of registers, R is a finite set of instructions injectively labelled with elements from a given set lab(M), l 0 is the initial/start label, and l h is the final label. The instructions are of the following forms: - l 1 :(ADD(r), l 2 ) Add 1 to the contents of register r and proceed to the instruction (labelled with) l 2. - l 1 :(SUB(r), l 2, l 3 ) If register r is not empty, then subtract 1 from its contents and go to instruction ) l 2, otherwise proceed to instruction ) l 2. - l 1 :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 2 n in register 1 and 0 in register 2, M accepts the input 2 n (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 2 n in register 1 and 0 in register 2, M computes f(n) by halting with 2 f(n) in register 1 and 0 in register 2.

24 Complexity results for graph-controlled grammars Proof: Given L  RE(k), L  T*, for some alphabet T = { a m : 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 g T : T*  N inductively defined by g T ( ) = 0, g T (a m ) = m for 1  m  k, and g T (wa) = g T (w) (k+1) +g T (a) for a  T and w  T*. Theorem 1. RE(k) = GC( 2,2,k) for all k  1.

25 Complexity results for graph-controlled grammars – proof We now iteratively generate wA 2 g T (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 waB 2 g T (w). Then we simulate a register machine constructed according to Propostion 4 computing 2 g T (wa) from 2 g T (w).

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

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

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 all k  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 all n  1 and all k  1. Theorem 2. GC( n,1,1)  RE(1) In fact, we will show

30 Priority-multicounter-automata A priority-multicounter-automaton is a one- way automaton described by A = ( k, Z, T, , z 0, 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 z 0  Z, accepting states E  Z.

31 Priority-multicounter-automata - configurations configurations C A = Z x T* x N k, initial configuration  A (x) = configuration transition relation |  A if and only if z,z‘  Z, a  T  { },  , and for all i  j n i = 0.

32 Priority-multicounter-automata - language L(A) = { w : |  * A } 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 P n k CA(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)  P n 1 CA(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 a m is accepted by the automaton if and only if a a m 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 all k  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 third variable needed? Matrix grammars: Is the third variable needed in the appearance checking mode? The third variable 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.


Download ppt "Refining the Nonterminal Complexity of Graph-controlled Grammars Faculty of Informatics TU Wien, Wien, Austria Rudolf FREUND Wilhelm-Schickard-Institut."

Similar presentations


Ads by Google