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

Slides:



Advertisements
Similar presentations
Chapter 5 Pushdown Automata
Advertisements

Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Lecture 24 MAS 714 Hartmut Klauck
1 Lecture 32 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union,
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Magic Numbers and Subset Construction Samik Datta Sayantan Mahinder.
Syntactical Pattern Recognition with 2-Dimensional Array Grammars and Array Automata Faculty of Informatics Vienna University of Technology Wien, Austria.
Introduction to Computability Theory
1 … NPDAs continued. 2 Pushing Strings Input symbol Pop symbol Push string.
Courtesy Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 4 Context-free grammars Jan Maluszynski, IDA, 2007
Validating Streaming XML Documents Luc Segoufin & Victor Vianu Presented by Harel Paz.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2009 with acknowledgement.
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
79 Regular Expression Regular expressions over an alphabet  are defined recursively as follows. (1) Ø, which denotes the empty set, is a regular expression.
1 Module 31 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union, concatenation.
Normal forms for Context-Free Grammars
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { ‘{‘, ‘}’ } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite language,
Complexity and Computability Theory I Lecture #13 Instructor: Rina Zviel-Girshin Lea Epstein Yael Moses.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Scattered Context Grammars Alexander Meduna Faculty of Information Technology Brno University of Technology Brno, Czech Republic, Europe.
Lecture 23: Finite State Machines with no Outputs Acceptors & Recognizers.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 Section 14.2 A Hierarchy of Languages Context-Sensitive Languages A context-sensitive grammar has productions of the form xAz  xyz, where A is a nonterminal.
Pushdown Automata (PDAs)
Context Free Grammars CIS 361. Introduction Finite Automata accept all regular languages and only regular languages Many simple languages are non regular:
Regulated Pushdown Automata Alexander Meduna 1/22 Faculty of Information Technology Brno University of Technology Brno, Czech Republic, Europe.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
1 Computability Five lectures. Slides available from my web page There is some formality, but it is gentle,
Introduction to Language Theory
MEMBRANE COMPUTING Faculty of Informatics Vienna University of Technology Wien, Austria Rudolf FREUND MOLECULAR COMPUTING.
Regular Grammars Chapter 7. Regular Grammars A regular grammar G is a quadruple (V, , R, S), where: ● V is the rule alphabet, which contains nonterminals.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
MA/CSSE 474 Theory of Computation Regular Expressions Intro.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Chapter 6 Properties of Regular Languages. 2 Regular Sets and Languages  Claim(1). The family of languages accepted by FSAs consists of precisely the.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2010 with acknowledgement.
Grammars A grammar is a 4-tuple G = (V, T, P, S) where 1)V is a set of nonterminal symbols (also called variables or syntactic categories) 2)T is a finite.
Introduction Finite Automata accept all regular languages and only regular languages Even very simple languages are non regular (  = {a,b}): - {a n b.
Discrete Structures ICS252 Chapter 5 Lecture 2. Languages and Grammars prepared By sabiha begum.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2007.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
1/44 #-Rewriting Systems Based upon Brno University of Technology, Czech Republic  Křivka, Z., Meduna, A., Schönecker, R.: Generation.
Mathematical Foundations of Computer Science Chapter 3: Regular Languages and Regular Grammars.
Algorithms for hard problems Automata and tree automata Juris Viksna, 2015.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
CS 154 Formal Languages and Computability February 11 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Unrestricted Grammars
1 A well-parenthesized string is a string with the same number of (‘s as )’s which has the property that every prefix of the string has at least as many.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2006.
1 Chapter Pushdown Automata. 2 Section 12.2 Pushdown Automata A pushdown automaton (PDA) is a finite automaton with a stack that has stack operations.
Complexity and Computability Theory I Lecture #12 Instructor: Rina Zviel-Girshin Lea Epstein.
Week 14 - Friday.  What did we talk about last time?  Simplifying FSAs  Quotient automata.
February 1, 2016CS21 Lecture 121 CS21 Decidability and Tractability Lecture 12 February 1, 2016.
Complexity and Computability Theory I
Chapter 7 PUSHDOWN AUTOMATA.
REGULAR LANGUAGES AND REGULAR GRAMMARS
Hierarchy of languages
A HIERARCHY OF FORMAL LANGUAGES AND AUTOMATA
Chapter 7 Regular Grammars
Formal Languages, Automata and Models of Computation
… NPDAs continued.
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
Decidability continued….
Presentation transcript:

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

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

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.

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)).

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) }.

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)

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.

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).

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)

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,

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.

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}.

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)

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.

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 M( n,0,1) = REG(1).

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, ,  ) }

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 RE(k) = M( 6,6,k) for all k  1.

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

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).

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.

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.

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.

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.

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.

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).

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

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 } ).

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.

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

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.

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.

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).

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.)

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.

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:

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