SlideShare une entreprise Scribd logo
1  sur  44
Two Non Context-Free Languages (We will prove them later if we have time)
Regular languages Context-free languages Non Context-free languages
Positive Properties of  Context-Free languages
Context-free languages  are closed under: Union is context free is context free is context-free Union
Example Union Language Grammar
In general: The grammar of the  union   has new start variable and additional production For  context-free languages with context-free grammars and start variables
Context-free languages  are closed under: Concatenation is context free is context free is context-free Concatenation
In general: The grammar of the  concatenation   has new start variable and additional production For  context-free languages with context-free grammars and start variables
Example Concatenation Language Grammar
Context-free languages  are closed under: Star-operation is context free is context-free Star Operation
In general: The grammar of the  star operation   has new start variable and additional production For  context-free language with context-free grammar and start variable
Example Language Grammar Star Operation
Context-free languages  are closed under: reversal is context free is context-free Reversal
In general: The grammar of the  reversal operation   has production For  context-free language with context-free grammar and every production
Example Language Grammar Reversal Operation
Negative Properties of  Context-Free Languages
Context-free languages are  not  closed under: intersection is context free is context free not  necessarily context-free Intersection
Example Context-free: Context-free: NOT  context-free Intersection
Context-free languages are  not  closed under: complement is context free not  necessarily context-free Complement
NOT  context-free Example Context-free: Context-free: Complement
Is the complement of context free?  Hw #1  p.219 For  n a ( w ) >  n b ( w )   : |  cS 1  | S 1 c   | cE | Ec This language is not context free (ref. Ex.8.8 p.217), but its complement is CF.
Intersection of  Context-free languages and  Regular Languages
The intersection of a context-free language and a regular language is a context-free language  context free regular context-free
for for  NPDA DFA Construct a new NPDA machine that accepts  Machine Machine context-free regular simulates in parallel  and  i.e. whenever a symbol is read from input,  M  simultaneously executes the moves of  M 1  and  M 2
transition transition NPDA DFA transition NPDA
initial state initial state NPDA DFA Initial state NPDA
final state final states NPDA DFA final states NPDA
simulates in parallel  and  accepts string  if and only if accepts string  and  accepts string
Therefore: (since  is NPDA)  is context-free is context-free
Applications  of  Regular Closure HW # 1, 7, 12, 17, 18, 21   (  8.2   p.220)
The intersection of a context-free language and a regular language is a context-free language  context free regular context-free Regular Closure
An Application of Regular Closure Prove that: is context-free
We know: is context-free
is regular is regular We also know:
regular context-free is context-free is context-free (regular closure)
Another Application of Regular Closure Prove that: is  not  context-free
context-free regular context-free If is context-free Then Impossible!!! (regular closure) Therefore,  is  not  context free
Consider set difference:  L 1 -  L 2 Is it closed for context free languages? It is context free if  L 2  is regular.
Two Non Context-Free Languages and Properties of Context-Free Languages
Two Non Context-Free Languages and Properties of Context-Free Languages
Two Non Context-Free Languages and Properties of Context-Free Languages
Two Non Context-Free Languages and Properties of Context-Free Languages
Two Non Context-Free Languages and Properties of Context-Free Languages
Two Non Context-Free Languages and Properties of Context-Free Languages

Contenu connexe

Tendances

Embracing diversity searching over multiple languages
Embracing diversity  searching over multiple languagesEmbracing diversity  searching over multiple languages
Embracing diversity searching over multiple languagesSuneel Marthi
 
New c sharp4_features_part_iv
New c sharp4_features_part_ivNew c sharp4_features_part_iv
New c sharp4_features_part_ivNico Ludwig
 
Automatic Transcription Of English Connected Speech Phenomena
Automatic Transcription Of English Connected Speech PhenomenaAutomatic Transcription Of English Connected Speech Phenomena
Automatic Transcription Of English Connected Speech PhenomenaITIIIndustries
 
Utilize Jericho HTML Parser to Resolve NCR Problem
Utilize Jericho HTML Parser to Resolve NCR ProblemUtilize Jericho HTML Parser to Resolve NCR Problem
Utilize Jericho HTML Parser to Resolve NCR ProblemGuo Albert
 
Lecture 7: Definite Clause Grammars
Lecture 7: Definite Clause GrammarsLecture 7: Definite Clause Grammars
Lecture 7: Definite Clause GrammarsCS, NcState
 
Implementing DSLs in practice
Implementing DSLs in practiceImplementing DSLs in practice
Implementing DSLs in practiceMikhail Barash
 
P4 P Update January 2009
P4 P Update January 2009P4 P Update January 2009
P4 P Update January 2009vsainteluce
 
Learning to Translate with Joey NMT
Learning to Translate with Joey NMTLearning to Translate with Joey NMT
Learning to Translate with Joey NMTJulia Kreutzer
 
Pré Descobrimento Do Brasil
Pré Descobrimento Do BrasilPré Descobrimento Do Brasil
Pré Descobrimento Do Brasilecsette
 
AINL 2016: Bastrakova, Ledesma, Millan, Zighed
AINL 2016: Bastrakova, Ledesma, Millan, ZighedAINL 2016: Bastrakova, Ledesma, Millan, Zighed
AINL 2016: Bastrakova, Ledesma, Millan, ZighedLidia Pivovarova
 
Grooming with Groovy
Grooming with GroovyGrooming with Groovy
Grooming with GroovyDhaval Dalal
 
Modern Programming Languages classification Poster
Modern Programming Languages classification PosterModern Programming Languages classification Poster
Modern Programming Languages classification PosterSaulo Aguiar
 
Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)lennartkats
 

Tendances (20)

Embracing diversity searching over multiple languages
Embracing diversity  searching over multiple languagesEmbracing diversity  searching over multiple languages
Embracing diversity searching over multiple languages
 
Go programing language
Go programing languageGo programing language
Go programing language
 
New c sharp4_features_part_iv
New c sharp4_features_part_ivNew c sharp4_features_part_iv
New c sharp4_features_part_iv
 
Automatic Transcription Of English Connected Speech Phenomena
Automatic Transcription Of English Connected Speech PhenomenaAutomatic Transcription Of English Connected Speech Phenomena
Automatic Transcription Of English Connected Speech Phenomena
 
ANTLR4 in depth
ANTLR4 in depthANTLR4 in depth
ANTLR4 in depth
 
Lexical1
Lexical1Lexical1
Lexical1
 
Utilize Jericho HTML Parser to Resolve NCR Problem
Utilize Jericho HTML Parser to Resolve NCR ProblemUtilize Jericho HTML Parser to Resolve NCR Problem
Utilize Jericho HTML Parser to Resolve NCR Problem
 
Elixir and OTP
Elixir and OTPElixir and OTP
Elixir and OTP
 
Lecture 7: Definite Clause Grammars
Lecture 7: Definite Clause GrammarsLecture 7: Definite Clause Grammars
Lecture 7: Definite Clause Grammars
 
Implementing DSLs in practice
Implementing DSLs in practiceImplementing DSLs in practice
Implementing DSLs in practice
 
P4 P Update January 2009
P4 P Update January 2009P4 P Update January 2009
P4 P Update January 2009
 
Ebay News 2001 4 19 Earnings
Ebay News 2001 4 19 EarningsEbay News 2001 4 19 Earnings
Ebay News 2001 4 19 Earnings
 
Ebay News 2000 10 19 Earnings
Ebay News 2000 10 19 EarningsEbay News 2000 10 19 Earnings
Ebay News 2000 10 19 Earnings
 
Intro to NLP. Lecture 2
Intro to NLP.  Lecture 2Intro to NLP.  Lecture 2
Intro to NLP. Lecture 2
 
Learning to Translate with Joey NMT
Learning to Translate with Joey NMTLearning to Translate with Joey NMT
Learning to Translate with Joey NMT
 
Pré Descobrimento Do Brasil
Pré Descobrimento Do BrasilPré Descobrimento Do Brasil
Pré Descobrimento Do Brasil
 
AINL 2016: Bastrakova, Ledesma, Millan, Zighed
AINL 2016: Bastrakova, Ledesma, Millan, ZighedAINL 2016: Bastrakova, Ledesma, Millan, Zighed
AINL 2016: Bastrakova, Ledesma, Millan, Zighed
 
Grooming with Groovy
Grooming with GroovyGrooming with Groovy
Grooming with Groovy
 
Modern Programming Languages classification Poster
Modern Programming Languages classification PosterModern Programming Languages classification Poster
Modern Programming Languages classification Poster
 
Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)
 

Similaire à Two Non Context-Free Languages and Properties of Context-Free Languages

Deep Learning for Machine Translation - A dramatic turn of paradigm
Deep Learning for Machine Translation - A dramatic turn of paradigmDeep Learning for Machine Translation - A dramatic turn of paradigm
Deep Learning for Machine Translation - A dramatic turn of paradigmMeetupDataScienceRoma
 
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
 
Csr2011 june17 15_15_kaminski
Csr2011 june17 15_15_kaminskiCsr2011 june17 15_15_kaminski
Csr2011 june17 15_15_kaminskiCSR2011
 
Presentation (5).pdf
Presentation (5).pdfPresentation (5).pdf
Presentation (5).pdfGaurav447273
 
replacement grammars
replacement grammarsreplacement grammars
replacement grammarsRajendran
 
Closure properties of context free grammar
Closure properties of context free grammarClosure properties of context free grammar
Closure properties of context free grammarAfshanKhan51
 
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...Codemotion
 
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...Codemotion
 
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmmUnit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmmDhruvKushwaha12
 
Evolution or stagnation programming languages
Evolution or stagnation programming languagesEvolution or stagnation programming languages
Evolution or stagnation programming languagesDaniele Esposti
 
From Programming to Modeling And Back Again
From Programming to Modeling And Back AgainFrom Programming to Modeling And Back Again
From Programming to Modeling And Back AgainMarkus Voelter
 
MOLTO poster for ACL 2010, Uppsala Sweden
MOLTO poster for ACL 2010, Uppsala SwedenMOLTO poster for ACL 2010, Uppsala Sweden
MOLTO poster for ACL 2010, Uppsala SwedenOlga Caprotti
 
G2 pil a grapheme to-phoneme conversion tool for the italian language
G2 pil a grapheme to-phoneme conversion tool for the italian languageG2 pil a grapheme to-phoneme conversion tool for the italian language
G2 pil a grapheme to-phoneme conversion tool for the italian languageijnlc
 
Lecture Notes-Are Natural Languages Regular.pdf
Lecture Notes-Are Natural Languages Regular.pdfLecture Notes-Are Natural Languages Regular.pdf
Lecture Notes-Are Natural Languages Regular.pdfDeptii Chaudhari
 
Context Free Grammar
Context Free GrammarContext Free Grammar
Context Free GrammarAkhil Kaushik
 
Computational model language and grammar bnf
Computational model language and grammar bnfComputational model language and grammar bnf
Computational model language and grammar bnfTaha Shakeel
 
Introduction to the theory of computation
Introduction to the theory of computationIntroduction to the theory of computation
Introduction to the theory of computationprasadmvreddy
 
Learning to Pronounce as Measuring Cross Lingual Joint Orthography Phonology ...
Learning to Pronounce as Measuring Cross Lingual Joint Orthography Phonology ...Learning to Pronounce as Measuring Cross Lingual Joint Orthography Phonology ...
Learning to Pronounce as Measuring Cross Lingual Joint Orthography Phonology ...IJITE
 

Similaire à Two Non Context-Free Languages and Properties of Context-Free Languages (20)

Deep Learning for Machine Translation - A dramatic turn of paradigm
Deep Learning for Machine Translation - A dramatic turn of paradigmDeep Learning for Machine Translation - A dramatic turn of paradigm
Deep Learning for Machine Translation - A dramatic turn of paradigm
 
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
 
Csr2011 june17 15_15_kaminski
Csr2011 june17 15_15_kaminskiCsr2011 june17 15_15_kaminski
Csr2011 june17 15_15_kaminski
 
Presentation (5).pdf
Presentation (5).pdfPresentation (5).pdf
Presentation (5).pdf
 
Unit2 Toc.pptx
Unit2 Toc.pptxUnit2 Toc.pptx
Unit2 Toc.pptx
 
replacement grammars
replacement grammarsreplacement grammars
replacement grammars
 
SS UI Lecture 6
SS UI Lecture 6SS UI Lecture 6
SS UI Lecture 6
 
Closure properties of context free grammar
Closure properties of context free grammarClosure properties of context free grammar
Closure properties of context free grammar
 
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
 
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
 
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmmUnit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
 
Evolution or stagnation programming languages
Evolution or stagnation programming languagesEvolution or stagnation programming languages
Evolution or stagnation programming languages
 
From Programming to Modeling And Back Again
From Programming to Modeling And Back AgainFrom Programming to Modeling And Back Again
From Programming to Modeling And Back Again
 
MOLTO poster for ACL 2010, Uppsala Sweden
MOLTO poster for ACL 2010, Uppsala SwedenMOLTO poster for ACL 2010, Uppsala Sweden
MOLTO poster for ACL 2010, Uppsala Sweden
 
G2 pil a grapheme to-phoneme conversion tool for the italian language
G2 pil a grapheme to-phoneme conversion tool for the italian languageG2 pil a grapheme to-phoneme conversion tool for the italian language
G2 pil a grapheme to-phoneme conversion tool for the italian language
 
Lecture Notes-Are Natural Languages Regular.pdf
Lecture Notes-Are Natural Languages Regular.pdfLecture Notes-Are Natural Languages Regular.pdf
Lecture Notes-Are Natural Languages Regular.pdf
 
Context Free Grammar
Context Free GrammarContext Free Grammar
Context Free Grammar
 
Computational model language and grammar bnf
Computational model language and grammar bnfComputational model language and grammar bnf
Computational model language and grammar bnf
 
Introduction to the theory of computation
Introduction to the theory of computationIntroduction to the theory of computation
Introduction to the theory of computation
 
Learning to Pronounce as Measuring Cross Lingual Joint Orthography Phonology ...
Learning to Pronounce as Measuring Cross Lingual Joint Orthography Phonology ...Learning to Pronounce as Measuring Cross Lingual Joint Orthography Phonology ...
Learning to Pronounce as Measuring Cross Lingual Joint Orthography Phonology ...
 

Plus de issbp

Ch11 input output systems
Ch11 input output systemsCh11 input output systems
Ch11 input output systemsissbp
 
Os10 2
Os10 2Os10 2
Os10 2issbp
 
Os10
Os10Os10
Os10issbp
 
Os9 2
Os9 2Os9 2
Os9 2issbp
 
Os8 2
Os8 2Os8 2
Os8 2issbp
 
Os7 2
Os7 2Os7 2
Os7 2issbp
 
Os6 2
Os6 2Os6 2
Os6 2issbp
 
Os5 2
Os5 2Os5 2
Os5 2issbp
 
Os4 2
Os4 2Os4 2
Os4 2issbp
 
Os3 2
Os3 2Os3 2
Os3 2issbp
 
Os2 2
Os2 2Os2 2
Os2 2issbp
 
Class8
 Class8 Class8
Class8issbp
 

Plus de issbp (20)

Ch11 input output systems
Ch11 input output systemsCh11 input output systems
Ch11 input output systems
 
Os10 2
Os10 2Os10 2
Os10 2
 
Os10
Os10Os10
Os10
 
Os9 2
Os9 2Os9 2
Os9 2
 
Os9
Os9Os9
Os9
 
Os8 2
Os8 2Os8 2
Os8 2
 
Os8
Os8Os8
Os8
 
Os7 2
Os7 2Os7 2
Os7 2
 
Os7
Os7Os7
Os7
 
Os6 2
Os6 2Os6 2
Os6 2
 
Os6
Os6Os6
Os6
 
Os5 2
Os5 2Os5 2
Os5 2
 
Os5
Os5Os5
Os5
 
Os4 2
Os4 2Os4 2
Os4 2
 
Os4
Os4Os4
Os4
 
Os3 2
Os3 2Os3 2
Os3 2
 
Os3
Os3Os3
Os3
 
Os2 2
Os2 2Os2 2
Os2 2
 
Os2
Os2Os2
Os2
 
Class8
 Class8 Class8
Class8
 

Two Non Context-Free Languages and Properties of Context-Free Languages

Notes de l'éditeur

  1. Fall 2007
  2. Fall 2007 This language is not context free (ref. Ex.8.8 p.217), but its complement is CF.