Conjunctive grammars generate non-regular unary languages Artur Je˙ z August 21, 2007 Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 1 / 21
History Conjunctive grammars introduced in 2001 by A. Okhotin. Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 2 / 21
History Conjunctive grammars introduced in 2001 by A. Okhotin. Extension of Context-free grammars by an intersection in a rule body. Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 2 / 21
History Conjunctive grammars introduced in 2001 by A. Okhotin. Extension of Context-free grammars by an intersection in a rule body. Productions of the form for α i ∈ ( Σ ∪ N ) ∗ . A → α 1 & α 2 & . . . & α k , Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 2 / 21
History Conjunctive grammars introduced in 2001 by A. Okhotin. Extension of Context-free grammars by an intersection in a rule body. Productions of the form for α i ∈ ( Σ ∪ N ) ∗ . A → α 1 & α 2 & . . . & α k , Intuition of the semantics: Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 2 / 21
History Conjunctive grammars introduced in 2001 by A. Okhotin. Extension of Context-free grammars by an intersection in a rule body. Productions of the form for α i ∈ ( Σ ∪ N ) ∗ . A → α 1 & α 2 & . . . & α k , Intuition of the semantics: ◮ w is derived such production iff it is derived by each α i Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 2 / 21
History Conjunctive grammars introduced in 2001 by A. Okhotin. Extension of Context-free grammars by an intersection in a rule body. Productions of the form for α i ∈ ( Σ ∪ N ) ∗ . A → α 1 & α 2 & . . . & α k , Intuition of the semantics: ◮ w is derived such production iff it is derived by each α i ◮ w is derived from α i = N 1 · N 2 · . . . · N k iff w = w 1 w 2 . . . w k and w j is derived from N j for each j Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 2 / 21
Example Example = { a , b , c } , Σ N = { S , B , C , E , A } S → ( AE )&( BC ) A → aA | ǫ B → aBb | ǫ C → cC | ǫ E → bEc | ǫ Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 3 / 21
Example Example = { a , b , c } , Σ N = { S , B , C , E , A } { a n b n c n : n ∈ N } S → ( AE )&( BC ) a ∗ A → aA | ǫ { a n b n : n ∈ N } B → aBb | ǫ c ∗ C → cC | ǫ { b n c n : n ∈ N } E → bEc | ǫ Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 3 / 21
Motivation natural extension of CFG Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 4 / 21
Motivation natural extension of CFG very close connection to language equations Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 4 / 21
Motivation natural extension of CFG very close connection to language equations from possible extensions of CFG this keeps the meaning of language equations Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 4 / 21
Motivation natural extension of CFG very close connection to language equations from possible extensions of CFG this keeps the meaning of language equations good parsing properties Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 4 / 21
Formal syntax Definition A conjunctive grammar is a � Σ, N , S , P � where Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 5 / 21
Formal syntax Definition A conjunctive grammar is a � Σ, N , S , P � where Σ is a finite alphabet Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 5 / 21
Formal syntax Definition A conjunctive grammar is a � Σ, N , S , P � where Σ is a finite alphabet N —set of non-terminal symbols Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 5 / 21
Formal syntax Definition A conjunctive grammar is a � Σ, N , S , P � where Σ is a finite alphabet N —set of non-terminal symbols S —starting symbol Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 5 / 21
Formal syntax Definition A conjunctive grammar is a � Σ, N , S , P � where Σ is a finite alphabet N —set of non-terminal symbols S —starting symbol P —set of productions of a form α i ∈ ( Σ ∪ N ) ∗ A → α 1 & α 2 & . . . & α k , Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 5 / 21
Rewriting Semantics By term rewriting. Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 6 / 21
Rewriting Semantics By term rewriting. Generalizes the Chomsky rewriting. Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 6 / 21
Rewriting Semantics By term rewriting. Generalizes the Chomsky rewriting. Drawbacks Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 6 / 21
Rewriting Semantics By term rewriting. Generalizes the Chomsky rewriting. Drawbacks There are more generalizations. Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 6 / 21
Rewriting Semantics By term rewriting. Generalizes the Chomsky rewriting. Drawbacks There are more generalizations. Slightly problematic to handle. Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 6 / 21
Language equations Semantics With each nonterminal A we associate a language L A . Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 7 / 21
Language equations Semantics With each nonterminal A we associate a language L A . The rule A → B & CD | a is replaced by L A = ( L B ∩ L A · L D ) ∪ { a } Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 7 / 21
Language equations Semantics With each nonterminal A we associate a language L A . The rule A → B & CD | a is replaced by L A = ( L B ∩ L A · L D ) ∪ { a } The language corresponding to the component L S in the least solution of the system is a language of the grammar. Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 7 / 21
Language equations Semantics With each nonterminal A we associate a language L A . The rule A → B & CD | a is replaced by L A = ( L B ∩ L A · L D ) ∪ { a } The language corresponding to the component L S in the least solution of the system is a language of the grammar. Remark In the CFG case the only allowed operations are ∪ and · . Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 7 / 21
Example revisited Example = { a , b , c } , Σ N = { S , B , C , E , A } S → ( AE )&( BC ) A → aA | ǫ B → aBb | ǫ C → cC | ǫ E → bEc | ǫ Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 8 / 21
Example revisited Example = { a , b , c } , Σ N = { S , B , C , E , A } S → ( AE )&( BC ) L S = ( L A · L E ) ∩ ( L B · L C ) A → aA | ǫ L A = { a } · L A ∪ { ǫ } B → aBb | ǫ L B = { a } · L B · { b } ∪ { ǫ } C → cC | ǫ L C = { c } · L C ∪ { ǫ } E → bEc | ǫ L E = { b } · L E · { c } ∪ { ǫ } Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 8 / 21
Example revisited Example = { a , b , c } , Σ N = { S , B , C , E , A } { a n b n c n : n ∈ N } S → ( AE )&( BC ) L S = ( L A · L E ) ∩ ( L B · L C ) a ∗ A → aA | ǫ L A = { a } · L A ∪ { ǫ } { a n b n : n ∈ N } B → aBb | ǫ L B = { a } · L B · { b } ∪ { ǫ } c ∗ C → cC | ǫ L C = { c } · L C ∪ { ǫ } { b n c n : n ∈ N } E → bEc | ǫ L E = { b } · L E · { c } ∪ { ǫ } Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 8 / 21
Basic results Positive results Resolved language equations with ∪ , ∩ and · Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 9 / 21
Basic results Positive results Resolved language equations with ∪ , ∩ and · Chomsky’s normal form Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 9 / 21
Basic results Positive results Resolved language equations with ∪ , ∩ and · Chomsky’s normal form Efficient parsing by CYK Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 9 / 21
Basic results Positive results Resolved language equations with ∪ , ∩ and · Chomsky’s normal form Efficient parsing by CYK High expressive power Example { wcw : w ∈ { a , b } ∗ } Artur Je˙ z Conjunctive grammars generate non-regular unary languages August 21, 2007 9 / 21
Recommend
More recommend