Prove that the intersection of a CFL and a Regular language is always context free.
I was thinking representing the CFL as a PDA, and the regular language as a DFA, then - if they both accept at the same time, the intersection must be context free?
The intersection of a CFL and regular language is always regular and context free.
A language is regular if and only if it is accepted by some NFA, the complement of a regular language is also regular. Languages are sets. Therefore all the properties of sets are inherited by languages.
A context-free grammar (CFG) is a set of recursive rewriting rules used to generate patterns of strings. A CFG consists of the following components: a set of terminal symbols, which are the characters of the alphabet that appear in the strings generated by the grammar.
A regular language satisfies the following equivalent properties: it is the language of a regular expression it is the language accepted by a nondeterministic finite automaton (NFA) it is the language accepted by a deterministic finite automaton (DFA) it can be generated by a regular grammar.
Get Answers For Free
Most questions answered within 1 hours.