Conjunctive Grammars and Alternating Automata Tamar Aizikowitz and Michael Kaminski Technion – Israel Institute of Technology WoLLIC 2008 Heriot-Watt University.

Slides:



Advertisements
Similar presentations
Variations of the Turing Machine
Advertisements

PDAs Accept Context-Free Languages
CS2303-THEORY OF COMPUTATION Push Down Automata (PDA)
By John E. Hopcroft, Rajeev Motwani and Jeffrey D. Ullman
Source of slides: Introduction to Automata Theory, Languages and Computation.
By John E. Hopcroft, Rajeev Motwani and Jeffrey D. Ullman
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
Addition Facts
Formal Languages: main findings so far
Reductions Complexity ©D.Moshkovitz.
Lecture 10: Context-Free Languages Contextually David Evans
CSCI 3130: Formal Languages and Automata Theory Tutorial 5
PARIXIT PRASAD December 4, 2013 Parixit Prasad | CSA - IISC 1 Deciding Presburger Arithmetic Using Automata Department of Computer Science and Automaton.
Conjunctive Grammars and Synchronized Alternating Pushdown Automata October 2009 Tamar Aizikowitz Joint work with Michael Kaminski Technion – Israel Institute.
Computing functions with Turing machines
Turing Machines.
ABC Technology Project
Cook-Levin Theorem Proof and Illustration
Hector Miguel Chavez Western Michigan University.
How to convert a left linear grammar to a right linear grammar
Grammar types There are 4 types of grammars according to the types of rules: – General grammars – Context Sensitive grammars – Context Free grammars –
Formal Languages: main findings so far A problem can be formalised as a formal language A formal language can be defined in various ways, e.g.: the language.
Chapter 5 Test Review Sections 5-1 through 5-4.
Addition 1’s to 20.
25 seconds left…...
Introduction to Computability Theory
Finite-state Recognizers
Week 1.
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
Chapter 6 Languages: finite state machines
The Pumping Lemma for CFL’s
Linear Conjunctive Grammars and One-turn Synchronized Alternating Pushdown Automata Formal Grammar 2009, Bordeaux Tamar Aizikowitz* and Michael Kaminski.
Theory of Computation CS3102 – Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer.
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 13: Turing Machines.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Introduction to Computability Theory
CS 310 – Fall 2006 Pacific University CS310 Pushdown Automata Sections: 2.2 page 109 October 9, 2006.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 4 Context-free grammars Jan Maluszynski, IDA, 2007
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
CS 3240: Languages and Computation Pushdown Automata & CF Grammars NOTE: THESE ARE ONLY PARTIAL SLIDES RELATED TO WEEKS 9 AND 10. PLEASE REFER TO THE TEXTBOOK.
CSR 2011, St. Petersburg, Russia
::ICS 804:: Theory of Computation - Ibrahim Otieno SCI/ICT Building Rm. G15.
Pushdown Automata CS 130: Theory of Computation HMU textbook, Chap 6.
Pushdown Automata (PDAs)
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 11 Midterm Exam 2 -Context-Free Languages Mälardalen University 2005.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Grammar Set of variables Set of terminal symbols Start variable Set of Production rules.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
Theory of Languages and Automata By: Mojtaba Khezrian.
CS6800 Advance Theory of Computation Spring 2016 Nasser Alsaedi
Formal Languages, Automata and Models of Computation
Deterministic FA/ PDA Sequential Machine Theory Prof. K. J. Hintz
Review : Theory of Computation
Context Sensitive Grammar & Turing Machines
Context Sensitive Languages and Linear Bounded Automata
Discrete Math II Howon Kim
NPDAs Accept Context-Free Languages
Course 2 Introduction to Formal Languages and Automata Theory (part 2)
CSE322 The Chomsky Hierarchy
Chapter 2 Context-Free Language - 01
… NPDAs continued.
The Chomsky Hierarchy Costas Busch - LSU.
Normal Forms for Context-free Grammars
Presentation transcript:

Conjunctive Grammars and Alternating Automata Tamar Aizikowitz and Michael Kaminski Technion – Israel Institute of Technology WoLLIC 2008 Heriot-Watt University

2 of 25 Introduction: ND Computational Models Non-deterministic computational models have existential acceptance conditions At least one computation must accept E.g., FSA, PDA, CFG, TM Languages accepted have disjunctive quality A word must meet one of many possible conditions (computations)  Language class closed under union

3 of 25 Introduction: Co-ND Computational Models Dual computational models have universal acceptance conditions All computations must accept E.g., Universal TM ; accepts class Co-NP Languages accepted have conjunctive quality A word must meet all conditions (computations)  Language class closed under intersection

4 of 25 Introduction: Combined Computational Models Several models combining existential and universal computations have been explored. We explore extensions of models for Context Free Languages. Specifically: Conjunctive Grammars Alternating Pushdown Automata

5 of 25 Introduction: Conjunctive Grammars ( CG ) Introduced by Alexander Okhotin in 2001 * Extension of Context Free Grammars Add power of explicit intersection  CG- s generate a larger class of languages * Okhotin A., Conjunctive Grammars, Journal of Automata, Languages and Combinatorics 6(4) (2001) Reminder: Context free languages are not closed under intersection…

6 of 25 Polynomial TimeCG LanguagesFinite ∩ CF Introduction: Conjunctive Grammars ( CG ) Conjunctive Grammars generate: Context Free languages Finite ∩ of CF languages Some more languages Generated languages are polynomial No known non-trivial technique to prove a language cannot be generated by a CG  Exact placing in the Chomsky Hierarchy not known Context Free

7 of 25 Introduction: Alternating Automata Alternating Automata were introduced by Chandra et.al. in 1981 * Computations alternate between existential and universal acceptance modes Well known examples: Alternating Finite State Automata (Verification) Alternating Turing Machines (Complexity Theory) Both equivalent to non-alternating counterparts * Chandra, A.K., Kozen, D.C., Stockmeyer, L.J., Alternation. Journal of the ACM 28(1) (1981)

8 of 25 Introduction: Alternating Pushdown Automata ( APDA ) Further explored by Ladner et.al. in 1984 * Add conjunction to computations  Not equivalent to standard PDA model Accept exactly the Exp. Time Languages  Not equivalent to the CG model * Ladner, R.E., Lipton, R.J., Stockmeyer, L.J., Alternating pushdown and stack automata. SIAM Journal on Computing 13(1) (1984)

9 of 25 Introduction: Synchronized APDA ( SAPDA ) We introduce a new model: Synchronized Alternating Pushdown Automata Equivalent to Conjunctive Grammar model In fact, this is the first class of automata suggested for Conjunctive Grammars

10 of 25 Outline Conjunctive Grammars Synchronized Alternating PDA Equivalence Results: CG ~ SAPDA Future Work

11 of 25 Conjunctive Grammars: Model Definition G = ( V, T, P, S ) V,T,S as in the standard CFG case P contains rules X → (  1 &  &  n ) n = 1 gives standard CFG rules Conjunctive Formulas: {  }   V  T are formulas If  and  are formulas then  is a formula If  1,…,  n are formulas then (  1 &  &  n ) is a formula conjunct

12 of 25 Conjunctive Grammars: Model Definition Derivation: Application: s 1 X s 2  s 1 (  1 &  &  n )s 2 s.t. X → (  1 &  &  n )  P Contraction: s 1 (w &  & w) s 2  s 1 w s 2 Language: L(G) = {w  T * | S  * w} Note: (  &  )  * w iff   * w and   * w

13 of 25 Conjunctive Grammars: Example 1 L = {a n b n c n | n   } Note: L = L 1  L 2 where L 1 = {a n b n c i | n,i   } L 2 = {a i b n c n | n,i   } G = ({S,S 1,S 2,S 3,S 4 }, {a,b,c}, S, P) where P = : S 1 → a S 1 b |  ;S 2 → c S 2 |  S 3 → a S 3 |  ;S 4 → b S 4 c |  S → (S 1 S 2 & S 3 S 4 ) S1S2*L1S1S2*L1 S3S4*L2S3S4*L2 L1  L2L1  L2

14 of 25 Conjunctive Grammars: Example 1 Derivation of aaabbbccc : S  (S 1 S 2 & S 3 S 4 )  (aS 1 bS 2 & S 3 S 4 )  …  (aaaS 1 bbbS 2 & S 3 S 4 )  (aaabbbS 2 & S 3 S 4 )  (aaabbbcS 2 & S 3 S 4 )  …  (aaabbbccc & S 3 S 4 )  …  (aaabbbccc & aaabbbccc)  aaabbbccc S → (S 1 S 2 & S 3 S 4 )S 1 → aS 1 b S 1 →  S 2 → cS 2 contraction S 2 → cS 2

Conjunctive Grammars: Interesting Languages CG s can generate some interesting languages: Multiple agreement: {a n b n c n | n   } Cross agreement: {a n b m c n d m | n,m   } Reduplication: {w$w | w  {a,b} * }  all mildly context-sensitive languages ( MCS ) CG s can also generate “stronger” languages such as: {ba 2 ba 4  ba 2 n b | n   }  not MCS because not semi-linear! 15 of 25

16 of 25 Synchronized Alternating Pushdown Automata ( SAPDA ) Extension of the standard PDA model Transitions are to conjunctions of (state,stack-word) pairs E.g.  (q, , X ) = {( p 1, XX )  ( p 2, Y ), ( p 3, Z ) } If all conjunctions are of one pair then we have the standard PDA model Non-deterministic model = many possible conjunctions

Synchronized Alternating Pushdown Automata ( SAPDA ) Stack memory is a tree Each leaf has a separate processing head A conjunctive transition to n pairs splits the current branch to n branches Branches are processed independently Sibling branches must empty synchronously. A B C D A q p 17 of 25

18 of 25 SAPDA: Model Definition A = (Q, , , , q 0,  ) For every (q, , X )  Q  (  {  })    (q, , X )  {(q 1,  1 )    (q n,  n ) | q i  Q,  i   *, n   } Example:  (q, , X ) = {( p 1, Z )  ( p 2, YY )} Y Y Z p1p1 p2p2 X q 

Configuration: a labeled tree T where Internal nodes labeled α denoting stack contents Leaves labeled (q,w,α) denoting current state, remaining input and stack contents Initial Configuration: the tree T 0 which is the tree Accepting Configuration: a tree T e s.t. it is the tree for some q  Q 19 of 25 SAPDA: Configurations (q0,w,)(q0,w,) (q,, )(q,, ) BA (q,ba, A)( p,a, DC ) A B C D A q p abba

20 of 25 SAPDA: Computation Computation: Each computation step, a transition is applied to one stack-branch If a stack-branch empties, it cannot be selected If all siblings branches are empty and “synchronized” then they are collapsed Synchronized Collapsing: All siblings… Are empty Have the same state Have the same remaining input Are all labeled (q,w, ɛ )

21 of 25 SAPDA: Language Accepting Computation: The final configuration is an accepting one, i.e. (q, ,  ) for some q  Q. L(A) = {w   * | A has an accepting computation on w} Note: Acceptance by accepting states can also be defined. Both models of acceptance are equivalent.

SAPDA: Example L = {w  {a,b,c} * | # a (w) = # b (w) = # c (w)} 22 of 25 a a b c c a b b c δ (q 0, ε,  ) = (q 1,  1 )  (q 2,  2 ) δ (q 1, a,  1 ) = (q 1, a  1 )δ (q 2, a,  2 ) = (q 2,  2 ) δ (q 1, a, a) = (q 1, aa) δ (q 2, a,  2 ) = (q 2,  2 ) δ (q 1, b, a) = (q 1, ε) δ (q 2, b,  2 ) = (q 2, b  2 ) δ (q 1, c, a) = (q 1, a)δ (q 2, c, b) = (q 2, ε) δ (q 1, ε,  1 ) = (q 0, ε)δ (q 2, ε,  2 ) = (q 0, ε) q1q1 q2q2 q0q0 q0q0 q0q0  ε 11 22 a a b ε ε

23 of 25 Equivalence Results Theorem 1: SAPDA  CG Theorem 2: CG  1-state SAPDA ( 1SAPDA ) Corollary 1: SAPDA ~ CG Corollary 2: SAPDA ~ 1SAPDA Proofs: Both are extensions of the classical ones Surprisingly, the grammar-to-automaton translation is the more complicated one…

Future Directions Linear CG and 1-turn SAPDA It is well known that LCFG ~ 1-turn PDA Linear CG : one non-terminal in each conjunct 1-turn SAPDA : each stack-branch turns once Initial results point towards: 1-turn SAPDA ~ LCG Finite-turn SAPDA, Deterministic SAPDA … Possibly, find a method to prove a language cannot be accepted by an SAPDA / CG … 24 of 25

Thank You