SlideShare a Scribd company logo
1 of 27
LR(0) Conjunctive Grammars and Deterministic SynchronizedAlternating Pushdown AutomataTamar Aizikowitz and Michael KaminskiTechnion – Israel Institute of Technology June 17 CSR 2011, St. Petersburg, Russia
Context-Free Languages Combine expressiveness with polynomial parsing, which is appealing for practical applications. One of the most widely used language class in Computer Science. At the theoretical basis of Programming Languages, Computational Linguistics, Formal Verification, Computational Biology, and more.
Extended Models Goal: Models of computation that generate a slightly stronger language class without sacrificing polynomial parsing. Why? Such models seem to have great potential for practical applications. In fact, several fields (e.g.,Computational Linguistics) have already voiced their need for a stronger language class.
Conjunctive Grammars ,[object Object],Add explicit intersection rules S (A & B)⋯ (w & w) w Semantics:L(A & B) = L(A) ⋂ L(B) Since context-free languages are not closed under intersection, CG is a wider class of languages Retain polynomial parsing and therefore can be useful for practical applications
Synchronized Alternating PDA Synchronized Alternating Pushdown Automata (SAPDA) [Aizikowitz & Kaminski, 2008] extend PDA. Stack modeled as tree in which all braches must accept. A limited form of synchronization createslocalized parallel computations. Firstautomaton counterpart shown for Conjunctive Grammars.
Outline Model Definitions Equivalence Results Linear-time LR(0) Parsing Summary
Conjunctive Grammars Synchronized Alternating Pushdown Automata Model Definitions
Conjunctive Grammars A CG is a quadruple: G=(V , Σ , P , S ) Rules:A -> (α1&⋯&αn), where A∊V,αi∊(V⋃Σ)* Examples: A-> (aAB & Bc & aD) ; A->abC Derivation steps: s1As2s1(α1&⋯&αn)s2,where   A->(α1&⋯&αn)∊P s1(w&⋯&w)s2s1 w s2,  where   w∊ Σ* non-terminals   terminals   derivation rules   start symbol The case of all n=1 isan ordinary CFG
Grammar Language Language:L(G) = {w∊Σ*| S*w}, i.e., L(G) consists of all terminal words w derivable from the start symbol S. Note: ( , ) , and & are not terminal symbols. Therefore, all conjunctions must be collapsed in order to derive a terminal word. Semantics:(A & B) *w    if and only if    A *wand B *w. Therefore, L(A & B) = L(A) ⋂ L(B).
Example: Multiple Agreement Example: a CG for the multiple-agreement language {anbncn | n∊ℕ}: C->Cc | D  ;  D->aDb | ε:L(C) = {anbncm | n,m∊ℕ} A->aA | E  ;  E->bEc | ε:L(A) = {ambncn | n,m∊ℕ} S-> (C & A)                       :L(S ) = L(C) ⋂ L(A) S (C&A)  (Cc&A)  (Dc&A)  (aDbc&A)   (abc&A) ⋯ (abc&abc) abc
Synchronized Alternating Pushdown Automata (SAPDA) An extension of classical PDA. Transitions are made to conjunctions of ( state , stack-word ) pairs, e.g., δ(q , σ, X) = { (p1 , XX)∧(p2 ,Y)  ,  (p3 , Z) } Note:if all conjunctions are of one pair only, the automaton is an “ordinary” PDA. non-deterministic model, i.e., many possible transitions
SAPDA Stack Tree  The stack of an SAPDA is a tree.A transition to n pairs splits the current branch into n branches. Branches are processed independently. Empty sibling branches can be collapsed if they are synchronized, i.e., are in the same state and have read the same portion of the input. p D q q q q A C ε ε A q B (q,A)(p,DC)δ(q,σ,A) B B collapse B
SAPDA Definition An SAPDA is a sextuple  A = (  Q  ,  Σ  ,  Γ  ,  q0  ,  δ  ,  ⊥  ) Transition function: δ(q,σ,X) ⊆ {(q1,α1)∧⋯∧(qn,αn) | qi∊Q, αi∊Γ*, n∊ℕ} states     terminals initial  state transition  function initial stack  symbol stack  symbols
SAPDA Computation and Language Computation:  Each step, a transition is applied to one stack-branch If a stack-branch is empty, it cannot be selected Synchronous empty sibling branches are collapsed Initial Configuration:  Accepting configuration: Language:L(A)={w∊Σ*| ∃q∊Q, (q0,w,⊥)⊢*(q,ε,ε)}  Note: all branches must empty, i.e., must “agree”. have the same state and remaining input q0 ⊥ q ε
SAPDA and Conjunctive Grammars Equivalence Results
Equivalence of SAPDA and CG Theorem 1.A language is generated by an CG if and only if it is accepted by an SAPDA. The equivalence is analogous to the classical equivalence between CFG and PDA. The proofs of the equivalence are extended versions of the classical proofs. Corollary:Single-state SAPDA and multi-state SAPDA are equivalent (like ordinary PDA).
Deterministic SAPDA and LR(0) CG Linear-time Implementation of DSAPDA and LR(0) Parsing Linear-time LR(0) Parsing
Deterministic Context-free Languages DCFL are a sub-family of context-free languages, accepted by Deterministic PDA (DPDA). LR(k) languages were introduced by Knuth, and shown to be equivalent to DPDA, [Knuth, 1965]. Knuth developed a linear-time parsing algorithm for DCFL  the basis of Compilation Theory. Knuth also proved that LR(0) grammars are equivalent to DPDA which accept by empty stack.
Deterministic SAPDA Deterministic SAPDA are defined according to the classical notion of a deterministic model. That is, an SAPDA is deterministic if it has only one possible step from any given configuration. Remark:A deterministic SAPDA has exactly one computation on any given input word w.
LR(0) Conjunctive Grammars To define LR(0) conjunctive grammars, we extend the notions of viable prefixes, valid items              ([A->]), etc… A conjunctive grammar is LR(0) if a conflict-free item automaton can be constructed for it. Main issue: How to build the item automaton so that it supports conjunctive rules... Solution: Read the paper 
Equivalence Results Theorem 2.A language is generated by an LR(0) CG if and only if it is accepted by a DSAPDA. The equivalence is analogous to the classical equivalence between LR(0) CFG and DPDA. The proofs of the equivalence are extended versions of the classical proofs.
The DSAPDA Membership Problem By using a naive implementation of a DSAPDA, we have an exponential time solution for the membership problem.  Each branch is linear, but there can be an exponential number of branches.
Do we need so many branches?
DSAPDA Efficient Implementation There are at most M = |Q|  |Γ| different combinations for branch head configurations. Thus, at any given time, we need at most M heads.
Linear-time Parsing Based on the efficient implementation of a DSAPDA, we can build an LR(0) parser. The parser runs in linear time for the boolean closure of LR(0) Conjunctive Languages This class strictly Includes the boolean closure of classical LR(0) languages. { ai1 bai2 b2 ⋯ ainbn$ bai1 bai2 ⋯ bain$ | n ≥ 1  ij≥ 1 } That is, we have linear-time parsing for a wider class of languages.
Summary Conjunctive Languages are interesting because: They are a strong, rich class of languages. They are polynomially parsable. Their models of computation are intuitive and easy to understand; highly resemble classical CFG and PDA. SAPDA are the first automaton model presented for Conjunctive Languages. They are a natural extension of PDA. They lend new intuition on Conjunctive Languages. They are the basis of a linear parsing algorithm for a wide class of languages.
Thank you.

More Related Content

What's hot

Types of Language in Theory of Computation
Types of Language in Theory of ComputationTypes of Language in Theory of Computation
Types of Language in Theory of ComputationAnkur Singh
 
Introduction to the theory of computation
Introduction to the theory of computationIntroduction to the theory of computation
Introduction to the theory of computationprasadmvreddy
 
Ch3 4 regular expression and grammar
Ch3 4 regular expression and grammarCh3 4 regular expression and grammar
Ch3 4 regular expression and grammarmeresie tesfay
 
Theory of Computation Lecture Notes
Theory of Computation Lecture NotesTheory of Computation Lecture Notes
Theory of Computation Lecture NotesFellowBuddy.com
 
Problems of function based syntax
Problems of function based syntaxProblems of function based syntax
Problems of function based syntaxDiego Krivochen
 
Semantic Web languages: Expressivity vs scalability
Semantic Web languages: Expressivity vs scalabilitySemantic Web languages: Expressivity vs scalability
Semantic Web languages: Expressivity vs scalabilitynvitucci
 
A Study Of Statistical Models For Query Translation :Finding A Good Unit Of T...
A Study Of Statistical Models For Query Translation :Finding A Good Unit Of T...A Study Of Statistical Models For Query Translation :Finding A Good Unit Of T...
A Study Of Statistical Models For Query Translation :Finding A Good Unit Of T...iyo
 
PARSING ARABIC VERB PHRASES USING PREGROUP GRAMMARS
PARSING ARABIC VERB PHRASES USING PREGROUP GRAMMARSPARSING ARABIC VERB PHRASES USING PREGROUP GRAMMARS
PARSING ARABIC VERB PHRASES USING PREGROUP GRAMMARSijnlc
 
Flat notes iii i (1)(7-9-20)
Flat notes iii i (1)(7-9-20)Flat notes iii i (1)(7-9-20)
Flat notes iii i (1)(7-9-20)saithirumalg
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4shah zeb
 
Looking for Invariant Operators in Argumentation
Looking for Invariant Operators in ArgumentationLooking for Invariant Operators in Argumentation
Looking for Invariant Operators in ArgumentationCarlo Taticchi
 
A Concurrent Language for Argumentation: Preliminary Notes
A Concurrent Language for Argumentation: Preliminary NotesA Concurrent Language for Argumentation: Preliminary Notes
A Concurrent Language for Argumentation: Preliminary NotesCarlo Taticchi
 
LDA/TagLDA In Slow Motion
LDA/TagLDA In Slow MotionLDA/TagLDA In Slow Motion
LDA/TagLDA In Slow MotionPradipto Das
 
Formal language & automata theory
Formal language & automata theoryFormal language & automata theory
Formal language & automata theoryNYversity
 
Logic Programming and Prolog
Logic Programming and PrologLogic Programming and Prolog
Logic Programming and PrologSadegh Dorri N.
 
A Concurrent Language for Argumentation
A Concurrent Language for ArgumentationA Concurrent Language for Argumentation
A Concurrent Language for ArgumentationCarlo Taticchi
 

What's hot (20)

Types of Language in Theory of Computation
Types of Language in Theory of ComputationTypes of Language in Theory of Computation
Types of Language in Theory of Computation
 
Introduction to the theory of computation
Introduction to the theory of computationIntroduction to the theory of computation
Introduction to the theory of computation
 
Automata Theory
Automata TheoryAutomata Theory
Automata Theory
 
Flat unit 3
Flat unit 3Flat unit 3
Flat unit 3
 
Ch3 4 regular expression and grammar
Ch3 4 regular expression and grammarCh3 4 regular expression and grammar
Ch3 4 regular expression and grammar
 
Theory of Computation Lecture Notes
Theory of Computation Lecture NotesTheory of Computation Lecture Notes
Theory of Computation Lecture Notes
 
Problems of function based syntax
Problems of function based syntaxProblems of function based syntax
Problems of function based syntax
 
Semantic Web languages: Expressivity vs scalability
Semantic Web languages: Expressivity vs scalabilitySemantic Web languages: Expressivity vs scalability
Semantic Web languages: Expressivity vs scalability
 
A Study Of Statistical Models For Query Translation :Finding A Good Unit Of T...
A Study Of Statistical Models For Query Translation :Finding A Good Unit Of T...A Study Of Statistical Models For Query Translation :Finding A Good Unit Of T...
A Study Of Statistical Models For Query Translation :Finding A Good Unit Of T...
 
Fafl notes [2010] (sjbit)
Fafl notes [2010] (sjbit)Fafl notes [2010] (sjbit)
Fafl notes [2010] (sjbit)
 
Ambiguous grammar, dfa and slr grammar.
Ambiguous grammar, dfa and slr  grammar.Ambiguous grammar, dfa and slr  grammar.
Ambiguous grammar, dfa and slr grammar.
 
PARSING ARABIC VERB PHRASES USING PREGROUP GRAMMARS
PARSING ARABIC VERB PHRASES USING PREGROUP GRAMMARSPARSING ARABIC VERB PHRASES USING PREGROUP GRAMMARS
PARSING ARABIC VERB PHRASES USING PREGROUP GRAMMARS
 
Flat notes iii i (1)(7-9-20)
Flat notes iii i (1)(7-9-20)Flat notes iii i (1)(7-9-20)
Flat notes iii i (1)(7-9-20)
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
Looking for Invariant Operators in Argumentation
Looking for Invariant Operators in ArgumentationLooking for Invariant Operators in Argumentation
Looking for Invariant Operators in Argumentation
 
A Concurrent Language for Argumentation: Preliminary Notes
A Concurrent Language for Argumentation: Preliminary NotesA Concurrent Language for Argumentation: Preliminary Notes
A Concurrent Language for Argumentation: Preliminary Notes
 
LDA/TagLDA In Slow Motion
LDA/TagLDA In Slow MotionLDA/TagLDA In Slow Motion
LDA/TagLDA In Slow Motion
 
Formal language & automata theory
Formal language & automata theoryFormal language & automata theory
Formal language & automata theory
 
Logic Programming and Prolog
Logic Programming and PrologLogic Programming and Prolog
Logic Programming and Prolog
 
A Concurrent Language for Argumentation
A Concurrent Language for ArgumentationA Concurrent Language for Argumentation
A Concurrent Language for Argumentation
 

Viewers also liked

Csr2011 june15 12_00_davydow
Csr2011 june15 12_00_davydowCsr2011 june15 12_00_davydow
Csr2011 june15 12_00_davydowCSR2011
 
Csr2011 june16 17_00_lohrey
Csr2011 june16 17_00_lohreyCsr2011 june16 17_00_lohrey
Csr2011 june16 17_00_lohreyCSR2011
 
Csr2011 june17 09_30_yekhanin
Csr2011 june17 09_30_yekhaninCsr2011 june17 09_30_yekhanin
Csr2011 june17 09_30_yekhaninCSR2011
 
Gaming In Libraries
Gaming In  LibrariesGaming In  Libraries
Gaming In LibrariesJohn Fudrow
 
Csr2011 june15 09_30_shen
Csr2011 june15 09_30_shenCsr2011 june15 09_30_shen
Csr2011 june15 09_30_shenCSR2011
 
Lecture 09 syntax analysis 05
Lecture 09 syntax analysis 05Lecture 09 syntax analysis 05
Lecture 09 syntax analysis 05Iffat Anjum
 

Viewers also liked (11)

Pâtissier
PâtissierPâtissier
Pâtissier
 
Csr2011 june15 12_00_davydow
Csr2011 june15 12_00_davydowCsr2011 june15 12_00_davydow
Csr2011 june15 12_00_davydow
 
TVI
TVITVI
TVI
 
Falcon vacuum-pumps-systems
Falcon vacuum-pumps-systemsFalcon vacuum-pumps-systems
Falcon vacuum-pumps-systems
 
Csr2011 june16 17_00_lohrey
Csr2011 june16 17_00_lohreyCsr2011 june16 17_00_lohrey
Csr2011 june16 17_00_lohrey
 
Csr2011 june17 09_30_yekhanin
Csr2011 june17 09_30_yekhaninCsr2011 june17 09_30_yekhanin
Csr2011 june17 09_30_yekhanin
 
Gaming In Libraries
Gaming In  LibrariesGaming In  Libraries
Gaming In Libraries
 
Csr2011 june15 09_30_shen
Csr2011 june15 09_30_shenCsr2011 june15 09_30_shen
Csr2011 june15 09_30_shen
 
Vocabulary of food
Vocabulary of foodVocabulary of food
Vocabulary of food
 
110 lr and slr parsing
110 lr and slr parsing110 lr and slr parsing
110 lr and slr parsing
 
Lecture 09 syntax analysis 05
Lecture 09 syntax analysis 05Lecture 09 syntax analysis 05
Lecture 09 syntax analysis 05
 

Similar to Csr2011 june17 15_15_kaminski

Detecting paraphrases using recursive autoencoders
Detecting paraphrases using recursive autoencodersDetecting paraphrases using recursive autoencoders
Detecting paraphrases using recursive autoencodersFeynman Liang
 
Automata
AutomataAutomata
AutomataGaditek
 
Automata
AutomataAutomata
AutomataGaditek
 
Ldml - public
Ldml - publicLdml - public
Ldml - publicseanscon
 
A Distributed Tableau Algorithm for Package-based Description Logics
A Distributed Tableau Algorithm for Package-based Description LogicsA Distributed Tableau Algorithm for Package-based Description Logics
A Distributed Tableau Algorithm for Package-based Description LogicsJie Bao
 
contextfreegrammars-120925004035-phpapp02.pdf
contextfreegrammars-120925004035-phpapp02.pdfcontextfreegrammars-120925004035-phpapp02.pdf
contextfreegrammars-120925004035-phpapp02.pdfry54321288
 
leanCoR: lean Connection-based DL Reasoner
leanCoR: lean Connection-based DL ReasonerleanCoR: lean Connection-based DL Reasoner
leanCoR: lean Connection-based DL ReasonerAdriano Melo
 
Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........NaumanAli215439
 
Ch 2.pptx
Ch 2.pptxCh 2.pptx
Ch 2.pptxwoldu2
 
形式言語理論への 測度論的アプローチ
形式言語理論への 測度論的アプローチ形式言語理論への 測度論的アプローチ
形式言語理論への 測度論的アプローチRyoma Sin'ya
 
The Theory of Finite Automata.pptx
The Theory of Finite Automata.pptxThe Theory of Finite Automata.pptx
The Theory of Finite Automata.pptxssuser039bf6
 
Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5Dr. Maamoun Ahmed
 
Ldml presentation
Ldml presentationLdml presentation
Ldml presentationSean Con
 
Cs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer KeyCs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer Keyappasami
 
2022-10, UCL NLP meetup, Toward a Better Understanding of Relational Knowledg...
2022-10, UCL NLP meetup, Toward a Better Understanding of Relational Knowledg...2022-10, UCL NLP meetup, Toward a Better Understanding of Relational Knowledg...
2022-10, UCL NLP meetup, Toward a Better Understanding of Relational Knowledg...asahiushio1
 
Pattern-Level Programming with Asteroid
Pattern-Level Programming with AsteroidPattern-Level Programming with Asteroid
Pattern-Level Programming with Asteroidijpla
 
Introduction to complexity theory assignment
Introduction to complexity theory assignmentIntroduction to complexity theory assignment
Introduction to complexity theory assignmenttesfahunegn minwuyelet
 

Similar to Csr2011 june17 15_15_kaminski (20)

Detecting paraphrases using recursive autoencoders
Detecting paraphrases using recursive autoencodersDetecting paraphrases using recursive autoencoders
Detecting paraphrases using recursive autoencoders
 
Automata
AutomataAutomata
Automata
 
Automata
AutomataAutomata
Automata
 
TOC question bank.pdf
TOC question bank.pdfTOC question bank.pdf
TOC question bank.pdf
 
Ldml - public
Ldml - publicLdml - public
Ldml - public
 
A Distributed Tableau Algorithm for Package-based Description Logics
A Distributed Tableau Algorithm for Package-based Description LogicsA Distributed Tableau Algorithm for Package-based Description Logics
A Distributed Tableau Algorithm for Package-based Description Logics
 
contextfreegrammars-120925004035-phpapp02.pdf
contextfreegrammars-120925004035-phpapp02.pdfcontextfreegrammars-120925004035-phpapp02.pdf
contextfreegrammars-120925004035-phpapp02.pdf
 
leanCoR: lean Connection-based DL Reasoner
leanCoR: lean Connection-based DL ReasonerleanCoR: lean Connection-based DL Reasoner
leanCoR: lean Connection-based DL Reasoner
 
Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........
 
Ch 2.pptx
Ch 2.pptxCh 2.pptx
Ch 2.pptx
 
QB104543.pdf
QB104543.pdfQB104543.pdf
QB104543.pdf
 
rs1.ppt
rs1.pptrs1.ppt
rs1.ppt
 
形式言語理論への 測度論的アプローチ
形式言語理論への 測度論的アプローチ形式言語理論への 測度論的アプローチ
形式言語理論への 測度論的アプローチ
 
The Theory of Finite Automata.pptx
The Theory of Finite Automata.pptxThe Theory of Finite Automata.pptx
The Theory of Finite Automata.pptx
 
Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5
 
Ldml presentation
Ldml presentationLdml presentation
Ldml presentation
 
Cs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer KeyCs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer Key
 
2022-10, UCL NLP meetup, Toward a Better Understanding of Relational Knowledg...
2022-10, UCL NLP meetup, Toward a Better Understanding of Relational Knowledg...2022-10, UCL NLP meetup, Toward a Better Understanding of Relational Knowledg...
2022-10, UCL NLP meetup, Toward a Better Understanding of Relational Knowledg...
 
Pattern-Level Programming with Asteroid
Pattern-Level Programming with AsteroidPattern-Level Programming with Asteroid
Pattern-Level Programming with Asteroid
 
Introduction to complexity theory assignment
Introduction to complexity theory assignmentIntroduction to complexity theory assignment
Introduction to complexity theory assignment
 

More from CSR2011

Csr2011 june14 09_30_grigoriev
Csr2011 june14 09_30_grigorievCsr2011 june14 09_30_grigoriev
Csr2011 june14 09_30_grigorievCSR2011
 
Csr2011 june18 15_15_bomhoff
Csr2011 june18 15_15_bomhoffCsr2011 june18 15_15_bomhoff
Csr2011 june18 15_15_bomhoffCSR2011
 
Csr2011 june18 15_15_bomhoff
Csr2011 june18 15_15_bomhoffCsr2011 june18 15_15_bomhoff
Csr2011 june18 15_15_bomhoffCSR2011
 
Csr2011 june18 14_00_sudan
Csr2011 june18 14_00_sudanCsr2011 june18 14_00_sudan
Csr2011 june18 14_00_sudanCSR2011
 
Csr2011 june18 15_45_avron
Csr2011 june18 15_45_avronCsr2011 june18 15_45_avron
Csr2011 june18 15_45_avronCSR2011
 
Csr2011 june18 09_30_shpilka
Csr2011 june18 09_30_shpilkaCsr2011 june18 09_30_shpilka
Csr2011 june18 09_30_shpilkaCSR2011
 
Csr2011 june18 12_00_nguyen
Csr2011 june18 12_00_nguyenCsr2011 june18 12_00_nguyen
Csr2011 june18 12_00_nguyenCSR2011
 
Csr2011 june18 11_00_tiskin
Csr2011 june18 11_00_tiskinCsr2011 june18 11_00_tiskin
Csr2011 june18 11_00_tiskinCSR2011
 
Csr2011 june18 11_30_remila
Csr2011 june18 11_30_remilaCsr2011 june18 11_30_remila
Csr2011 june18 11_30_remilaCSR2011
 
Csr2011 june17 17_00_likhomanov
Csr2011 june17 17_00_likhomanovCsr2011 june17 17_00_likhomanov
Csr2011 june17 17_00_likhomanovCSR2011
 
Csr2011 june17 16_30_blin
Csr2011 june17 16_30_blinCsr2011 june17 16_30_blin
Csr2011 june17 16_30_blinCSR2011
 
Csr2011 june17 09_30_yekhanin
Csr2011 june17 09_30_yekhaninCsr2011 june17 09_30_yekhanin
Csr2011 june17 09_30_yekhaninCSR2011
 
Csr2011 june17 09_30_yekhanin
Csr2011 june17 09_30_yekhaninCsr2011 june17 09_30_yekhanin
Csr2011 june17 09_30_yekhaninCSR2011
 
Csr2011 june17 12_00_morin
Csr2011 june17 12_00_morinCsr2011 june17 12_00_morin
Csr2011 june17 12_00_morinCSR2011
 
Csr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyiCsr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyiCSR2011
 
Csr2011 june17 11_00_lonati
Csr2011 june17 11_00_lonatiCsr2011 june17 11_00_lonati
Csr2011 june17 11_00_lonatiCSR2011
 
Csr2011 june17 14_00_bulatov
Csr2011 june17 14_00_bulatovCsr2011 june17 14_00_bulatov
Csr2011 june17 14_00_bulatovCSR2011
 
Csr2011 june17 14_00_bulatov
Csr2011 june17 14_00_bulatovCsr2011 june17 14_00_bulatov
Csr2011 june17 14_00_bulatovCSR2011
 
Csr2011 june17 12_00_morin
Csr2011 june17 12_00_morinCsr2011 june17 12_00_morin
Csr2011 june17 12_00_morinCSR2011
 
Csr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyiCsr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyiCSR2011
 

More from CSR2011 (20)

Csr2011 june14 09_30_grigoriev
Csr2011 june14 09_30_grigorievCsr2011 june14 09_30_grigoriev
Csr2011 june14 09_30_grigoriev
 
Csr2011 june18 15_15_bomhoff
Csr2011 june18 15_15_bomhoffCsr2011 june18 15_15_bomhoff
Csr2011 june18 15_15_bomhoff
 
Csr2011 june18 15_15_bomhoff
Csr2011 june18 15_15_bomhoffCsr2011 june18 15_15_bomhoff
Csr2011 june18 15_15_bomhoff
 
Csr2011 june18 14_00_sudan
Csr2011 june18 14_00_sudanCsr2011 june18 14_00_sudan
Csr2011 june18 14_00_sudan
 
Csr2011 june18 15_45_avron
Csr2011 june18 15_45_avronCsr2011 june18 15_45_avron
Csr2011 june18 15_45_avron
 
Csr2011 june18 09_30_shpilka
Csr2011 june18 09_30_shpilkaCsr2011 june18 09_30_shpilka
Csr2011 june18 09_30_shpilka
 
Csr2011 june18 12_00_nguyen
Csr2011 june18 12_00_nguyenCsr2011 june18 12_00_nguyen
Csr2011 june18 12_00_nguyen
 
Csr2011 june18 11_00_tiskin
Csr2011 june18 11_00_tiskinCsr2011 june18 11_00_tiskin
Csr2011 june18 11_00_tiskin
 
Csr2011 june18 11_30_remila
Csr2011 june18 11_30_remilaCsr2011 june18 11_30_remila
Csr2011 june18 11_30_remila
 
Csr2011 june17 17_00_likhomanov
Csr2011 june17 17_00_likhomanovCsr2011 june17 17_00_likhomanov
Csr2011 june17 17_00_likhomanov
 
Csr2011 june17 16_30_blin
Csr2011 june17 16_30_blinCsr2011 june17 16_30_blin
Csr2011 june17 16_30_blin
 
Csr2011 june17 09_30_yekhanin
Csr2011 june17 09_30_yekhaninCsr2011 june17 09_30_yekhanin
Csr2011 june17 09_30_yekhanin
 
Csr2011 june17 09_30_yekhanin
Csr2011 june17 09_30_yekhaninCsr2011 june17 09_30_yekhanin
Csr2011 june17 09_30_yekhanin
 
Csr2011 june17 12_00_morin
Csr2011 june17 12_00_morinCsr2011 june17 12_00_morin
Csr2011 june17 12_00_morin
 
Csr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyiCsr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyi
 
Csr2011 june17 11_00_lonati
Csr2011 june17 11_00_lonatiCsr2011 june17 11_00_lonati
Csr2011 june17 11_00_lonati
 
Csr2011 june17 14_00_bulatov
Csr2011 june17 14_00_bulatovCsr2011 june17 14_00_bulatov
Csr2011 june17 14_00_bulatov
 
Csr2011 june17 14_00_bulatov
Csr2011 june17 14_00_bulatovCsr2011 june17 14_00_bulatov
Csr2011 june17 14_00_bulatov
 
Csr2011 june17 12_00_morin
Csr2011 june17 12_00_morinCsr2011 june17 12_00_morin
Csr2011 june17 12_00_morin
 
Csr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyiCsr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyi
 

Recently uploaded

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Recently uploaded (20)

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

Csr2011 june17 15_15_kaminski

  • 1. LR(0) Conjunctive Grammars and Deterministic SynchronizedAlternating Pushdown AutomataTamar Aizikowitz and Michael KaminskiTechnion – Israel Institute of Technology June 17 CSR 2011, St. Petersburg, Russia
  • 2. Context-Free Languages Combine expressiveness with polynomial parsing, which is appealing for practical applications. One of the most widely used language class in Computer Science. At the theoretical basis of Programming Languages, Computational Linguistics, Formal Verification, Computational Biology, and more.
  • 3. Extended Models Goal: Models of computation that generate a slightly stronger language class without sacrificing polynomial parsing. Why? Such models seem to have great potential for practical applications. In fact, several fields (e.g.,Computational Linguistics) have already voiced their need for a stronger language class.
  • 4.
  • 5. Synchronized Alternating PDA Synchronized Alternating Pushdown Automata (SAPDA) [Aizikowitz & Kaminski, 2008] extend PDA. Stack modeled as tree in which all braches must accept. A limited form of synchronization createslocalized parallel computations. Firstautomaton counterpart shown for Conjunctive Grammars.
  • 6. Outline Model Definitions Equivalence Results Linear-time LR(0) Parsing Summary
  • 7. Conjunctive Grammars Synchronized Alternating Pushdown Automata Model Definitions
  • 8. Conjunctive Grammars A CG is a quadruple: G=(V , Σ , P , S ) Rules:A -> (α1&⋯&αn), where A∊V,αi∊(V⋃Σ)* Examples: A-> (aAB & Bc & aD) ; A->abC Derivation steps: s1As2s1(α1&⋯&αn)s2,where A->(α1&⋯&αn)∊P s1(w&⋯&w)s2s1 w s2, where w∊ Σ* non-terminals terminals derivation rules start symbol The case of all n=1 isan ordinary CFG
  • 9. Grammar Language Language:L(G) = {w∊Σ*| S*w}, i.e., L(G) consists of all terminal words w derivable from the start symbol S. Note: ( , ) , and & are not terminal symbols. Therefore, all conjunctions must be collapsed in order to derive a terminal word. Semantics:(A & B) *w if and only if A *wand B *w. Therefore, L(A & B) = L(A) ⋂ L(B).
  • 10. Example: Multiple Agreement Example: a CG for the multiple-agreement language {anbncn | n∊ℕ}: C->Cc | D ; D->aDb | ε:L(C) = {anbncm | n,m∊ℕ} A->aA | E ; E->bEc | ε:L(A) = {ambncn | n,m∊ℕ} S-> (C & A) :L(S ) = L(C) ⋂ L(A) S (C&A)  (Cc&A)  (Dc&A)  (aDbc&A)   (abc&A) ⋯ (abc&abc) abc
  • 11. Synchronized Alternating Pushdown Automata (SAPDA) An extension of classical PDA. Transitions are made to conjunctions of ( state , stack-word ) pairs, e.g., δ(q , σ, X) = { (p1 , XX)∧(p2 ,Y) , (p3 , Z) } Note:if all conjunctions are of one pair only, the automaton is an “ordinary” PDA. non-deterministic model, i.e., many possible transitions
  • 12. SAPDA Stack Tree The stack of an SAPDA is a tree.A transition to n pairs splits the current branch into n branches. Branches are processed independently. Empty sibling branches can be collapsed if they are synchronized, i.e., are in the same state and have read the same portion of the input. p D q q q q A C ε ε A q B (q,A)(p,DC)δ(q,σ,A) B B collapse B
  • 13. SAPDA Definition An SAPDA is a sextuple A = ( Q , Σ , Γ , q0 , δ , ⊥ ) Transition function: δ(q,σ,X) ⊆ {(q1,α1)∧⋯∧(qn,αn) | qi∊Q, αi∊Γ*, n∊ℕ} states terminals initial state transition function initial stack symbol stack symbols
  • 14. SAPDA Computation and Language Computation: Each step, a transition is applied to one stack-branch If a stack-branch is empty, it cannot be selected Synchronous empty sibling branches are collapsed Initial Configuration: Accepting configuration: Language:L(A)={w∊Σ*| ∃q∊Q, (q0,w,⊥)⊢*(q,ε,ε)} Note: all branches must empty, i.e., must “agree”. have the same state and remaining input q0 ⊥ q ε
  • 15. SAPDA and Conjunctive Grammars Equivalence Results
  • 16. Equivalence of SAPDA and CG Theorem 1.A language is generated by an CG if and only if it is accepted by an SAPDA. The equivalence is analogous to the classical equivalence between CFG and PDA. The proofs of the equivalence are extended versions of the classical proofs. Corollary:Single-state SAPDA and multi-state SAPDA are equivalent (like ordinary PDA).
  • 17. Deterministic SAPDA and LR(0) CG Linear-time Implementation of DSAPDA and LR(0) Parsing Linear-time LR(0) Parsing
  • 18. Deterministic Context-free Languages DCFL are a sub-family of context-free languages, accepted by Deterministic PDA (DPDA). LR(k) languages were introduced by Knuth, and shown to be equivalent to DPDA, [Knuth, 1965]. Knuth developed a linear-time parsing algorithm for DCFL  the basis of Compilation Theory. Knuth also proved that LR(0) grammars are equivalent to DPDA which accept by empty stack.
  • 19. Deterministic SAPDA Deterministic SAPDA are defined according to the classical notion of a deterministic model. That is, an SAPDA is deterministic if it has only one possible step from any given configuration. Remark:A deterministic SAPDA has exactly one computation on any given input word w.
  • 20. LR(0) Conjunctive Grammars To define LR(0) conjunctive grammars, we extend the notions of viable prefixes, valid items ([A->]), etc… A conjunctive grammar is LR(0) if a conflict-free item automaton can be constructed for it. Main issue: How to build the item automaton so that it supports conjunctive rules... Solution: Read the paper 
  • 21. Equivalence Results Theorem 2.A language is generated by an LR(0) CG if and only if it is accepted by a DSAPDA. The equivalence is analogous to the classical equivalence between LR(0) CFG and DPDA. The proofs of the equivalence are extended versions of the classical proofs.
  • 22. The DSAPDA Membership Problem By using a naive implementation of a DSAPDA, we have an exponential time solution for the membership problem. Each branch is linear, but there can be an exponential number of branches.
  • 23. Do we need so many branches?
  • 24. DSAPDA Efficient Implementation There are at most M = |Q|  |Γ| different combinations for branch head configurations. Thus, at any given time, we need at most M heads.
  • 25. Linear-time Parsing Based on the efficient implementation of a DSAPDA, we can build an LR(0) parser. The parser runs in linear time for the boolean closure of LR(0) Conjunctive Languages This class strictly Includes the boolean closure of classical LR(0) languages. { ai1 bai2 b2 ⋯ ainbn$ bai1 bai2 ⋯ bain$ | n ≥ 1  ij≥ 1 } That is, we have linear-time parsing for a wider class of languages.
  • 26. Summary Conjunctive Languages are interesting because: They are a strong, rich class of languages. They are polynomially parsable. Their models of computation are intuitive and easy to understand; highly resemble classical CFG and PDA. SAPDA are the first automaton model presented for Conjunctive Languages. They are a natural extension of PDA. They lend new intuition on Conjunctive Languages. They are the basis of a linear parsing algorithm for a wide class of languages.
  • 28. Thesis Overview Conjunctive grammars and alternating pushdown automata. T. Aizikowitz and M. Kaminski.WoLLIC 2008, LNAI vol. 5110. Linear conjunctive grammars and one-turn synchronized alternating pushdown automata. T. Aizikowitz and M. Kaminski.FG 2009, LNAI vol. 5591. LR(0) conjunctive grammars and deterministic synchronized alternating pushdown automata. T. Aizikowitz and M. Kaminski.submitted.
  • 29. References Aizikowitz, T., Kaminski, M.: Conjunctive grammars and alternating pushdown automata. WoLLIC’09. LNAI 5110 (2008) 30 – 41. Aizikowitz, T., Kaminski, M.: Linear conjunctive grammars and one-turn synchronized alternating pushdown automata.Formal Grammars: Bordeaux 2009. LNAI 5591. To appear. Ginsburg, S., Spanier, E.H.: Finite-turn pushdown automata.SIAM Journal on Control. 4(3) (1966) 429 – 453 Knuth, D.E.: On the translation of languages from left to right. Information and Control. 8 (1965) 114 – 133. Okhotin, A.: Conjunctive grammars. Journal of Automata, Languages and Combinatorics. 6(4) (2001) 519 – 535 Okhotin, A.: LR parsing for conjunctive grammars. Grammars. 5(2) (2002) 21 – 40 Okhotin, A.: Conjunctive languages are closed under inverse homomorphism. Technical Report 2003-468. School of Computing, Queens Univ., Kingston, Ontario, Canada. Okhotin, A.: On the equivalence of linear conjunctive grammars and trellis automata.RAIRO Theoretical Informatics and Applications. 38(1) (2004) 69 – 88 Vijay-Shanker, K., Weir, D.J.: The equivalence of four extensions of context-free grammars. Mathematical Systems Theory. 27(6) (1994) 511 – 546.
  • 30. Reduplication with a Center Marker The reduplication with a center markerlanguage (RCM) , {w$w | w∊Σ*}, describes structures in various fields, e.g., Copying phenomena in natural languages: “deal or no deal”, “boys will be boys”, “is she beautiful or is she beautiful?” Biology:microRNA patterns in DNA, tandem repeats We will construct an SAPDA for RCM. Note: it is not known whether reduplicationwithout a center marker can be derived by a CG.
  • 31. Example: SAPDA for RCM We consider an SAPDA for {w$uw | w,u∊Σ*}, which can easily be modified to accept RCM. The SAPDA is especially interesting, as it utilizes recursive conjunctive transitions. Construction Idea:if σ in the nth letter before the $, check that the nth letter from the end is also σ. n - 1 n - 1 σ σ $ w u w
  • 32. Construction of SAPDA for RCM A=(Q,{a,b,$},{⊥,#},q0,δ,⊥) Q = {q0,qe}⋃{qσi| σ∊{a,b} , i∊{1,2}} δ(q0,σ,⊥) = {(qσ1,⊥) ∧(q0,⊥)} δ(qσ1,τ,X) = {(qσ1,#X)} δ(q0,$,⊥) = {(qe,ε)} δ(qσ1,$,X) = {(qσ2,X)} δ(qσ2,τσ,X) = {(qσ2,X)} δ(qσ2,σ,X) = {(qe,X),(qσ2,X)} δ(qe,τ,#) = {(qe,ε)} δ(qe,ε,⊥) = {(qe,ε)} recursively open branch to verify σ is nth from the $ and from the end “count” symbols between σ and $ $ reached, stop recursion $ reached, stop “counting” symbols look for σ “guess” that this is the σwe are looking for, or keep looking “count” symbols from σ to the end all done: empty stack
  • 33. Computation of SAPDA for RCM qb1 qb2 qe qe qb1 qb2 qe word accepted! qa1 qa2 qe qe q0 ⊥ ε ⊥ ε # qe # q0 ε ⊥ ⊥ ε qa1 qe # q0 qa1 ⊥ ⊥ ε ε abb$babb q0 ⊥ ε
  • 34. What CG can do for Programming Language Specification and Parsing Usage Example
  • 35. A Toy Programming Language A program in PrintVars has three parts: Definition of variables Assignment of values Printing of variable values to the screen Example: VARS a , b , c VALS b = 2 , a = 1 , c = 3 PRNT b a a c b Output:2 1 1 3 2
  • 36. PrintVars Specification A PrintVars program is well-formed if: (1) It has the correct structure (2) All used variables are defined (3) All defined variables are used (4) All defined variables are assigned a value (5) All variables assigned a value are defined Item (1) is easily defined by a CF Grammar. However, items (2) – (5) amount to a language reducible to RCM, which is not CF.
  • 37. S-> ( structure & defined_used & used_defined & defined_assigned & assigned_defined ) structure->varsvalsprnt vars->VARS… ; vals->VALS… ; prnt->PRNT… defined_used->VARS check_du check_du-> ( a X vals X a X & acheck_du) | ( b X vals X b X & bcheck_du) | ⋯ | vals X ) X->a X | ⋯ | z X | 0 X | ⋯ | 9 X | = X | ε A (partial) CG for PrintVars Semantic Checks via Syntactic Parsing
  • 38. Linear CG and One-turn SAPDA Linear Conjunctive Grammars (LCG) [Okhotin, 2001] are an interesting sub-class of CG. More efficient parsing [Okhotin, 2003] Equivalent to Trellis Automata [Okhotin, 2004] It is a well known classical result [Ginsburg et.al, 1966] that Linear Grammars are equivalent to one-turn Pushdown Automata. We define a sub-class of SAPDA, one-turn SAPDA, analogously to one-turn PDA.
  • 39. One-turn SAPDA ~ LCG Theorem 2.A language is generated by an LCG if and only if it is accepted by a one-turn SAPDA. This result mirrors the classical equivalence between Linear Grammars and one-turn PDA, strengthening the claim of SAPDA as a natural automaton counterpart for CG. Corollary:One-turn SAPDA are equivalent to Trellis automata.
  • 40. Generative Power Closure Properties Decidability Problems Conjunctive Languages
  • 41. Generative Power CG ⋂CFG LCG ⋂ LG
  • 42. Closure Properties Union, concatenation, intersection, Kleene star Proven quite easily using grammars Homomorphism Inverse homomorphism We’ll touch on the proof of this in the next slide… Linear CL are closed under complement. It is an open question whether general CG are closed under complement.     ?
  • 43.
  • 44. Decidability Problems Linear CG Membership: O(n2) time and O(n) space. General CG Membership: O(n3) time and O(n2) space. Emptiness, finiteness, equivalence, inclusion, regularity   
  • 45. “only if” Proof Sketch Given an CG, we construct an single-state SAPDA using an extension of the classical construction. A simulation of the derivation is run in the stack: If the top stack symbol is a non-terminal, it is replaced with the r.h.s. of one of its rules. If the top stack symbol is a terminal, it is emptied while reading the same terminal symbol from the input. A correlation is achieved between the stack contents and the grammar sentential forms.
  • 46. “only if” Proof Simulation S *wAα w uxv z ⋯  w(uBβ&⋯)α  x ⋯uxCγβ⋯ switch variable with r.h.s of rule empty terminals u C * B γ ⋯ux(v& ⋯&v)γβ⋯ β ⋯ * A ⋯uxv γβ⋯ α
  • 47. “if” Proof Sketch Given an SAPDA we construct an CG. The proof is an extension of the classical one. However, due to the added complexity of the extended models, it is more involved. Therefore, we won’t get into it now…
  • 48. Mildly Context Sensitive Languages Computational Linguistics pursues a computational model which exactly describesnatural languages. Originally, context-free models were considered. However, non-CF natural language structures led to interest in a slightly extended class of languages – Mildly Context-sensitive Languages (MSCL). Several formalisms (e.g., Tree Adjoining Grammars) are known to converge to MCSL. [Vijay-Shanker, 1994]
  • 49. Conjunctive Languages and MCSL We explore the correlation between Conjunctive Languages and MCSL. MCSL are loosely categorized as follows: (1) They contain the context-free languages (2) They contain multiple-agreement, cross-agreement and reduplication (3) They are polynomially parsable (4) They are semi-linear  a CG exists for the language {ba2ba4 ⋯ ba2nb | n∊ℕ}  Not an exact characterization of natural languages, but still with applicative potential.    
  • 50. LR Parsing for Conjunctive Grammars Okhotin presented an extension of Tomita’s Generalized LR parsing algorithm for Conjunctive Grammars, [Okhotin, 2002]. The algorithm runs in polynomial time for all conjunctive grammars. When applied to the boolean closure of deterministic context free languages, it runs in linear time.
  • 51. One-turn SAPDA We introduce a sub-family of SAPDA, one-turn SAPDA, analogously to one-turn PDA. An SAPDA is one-turn if all stack-branches make exactly one turn in all accepting computations. Note:the requirement of a turn is not limiting as we are considering acceptance by empty stack.
  • 52. Single-state SAPDA The “if” proof translates a general SAPDA into a Conjunctive Grammar. The “only if” proof translates a Conjunctive Grammar into a single-stateSAPDA. Corollary:Single-state SAPDA and multi-state SAPDA are equivalent. This characterizes classical PDA as well.
  • 53. Background It is a well known result [Ginsburg et.al, 1966] that Linear Grammars are equivalent to one-turn PDA. A turn is a computation step where the stack height changes from increasing to decreasing. A one-turn PDA is a PDA s.t. all accepting computations, have only one turn.
  • 54. One-turn SAPDA An SAPDA is one-turn if all stack-branches make exactly one turn in all accepting computations. Note: if the automaton is a PDA, then there is only one branch with no second phase and therefore the automaton is a classical one-turn PDA. phase 2 phase 1 phase 3
  • 55. Summary Future Directions Acknowledgments Concluding Remarks
  • 56. Future Directions Broadening the theory of SAPDA Finite-turn Automata LR(k) Grammars Considering possible applications Formal verification Programming Languages / Compilation …
  • 57. Acknowledgments Prof. Michael Kaminski Prof. Nissim Francez Prof. Shmuel Zaks EitanYaakobi, Yaniv Carmeli, Sonya Liberman, Keren Censor My Parents, Nava and Jacob Sivan Bercovici