Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
In formal language theory, a language is defined as a set of strings of symbols that may be
constrained by specific rules. Similarly, the written English language is made up of groups of
letters (words) separated by spaces. A valid (accepted) sentence in the language must follow
particular rules, the grammar.
The set of all context-free languages is identical to the set of languages that are accepted by
pushdown automata (PDA).
Union
Concatenation
Union
Let L1 and L2 be two context free languages. Then L1 ∪ L2 is also context free.
Example
Concatenation
If L1 and L2 are context free languages, then L1L2 is also context free.
Example
Kleene Star
Example
Intersection − If L1 and L2 are context free languages, then L1 ∩ L2 is not necessarily context
free.
Complement − If L1 is a context free language, then L1’ may not be context free.
Notational Conventions
The full symbol set V consists of only symbols which appear in the grammar.
All uppercase letters are non-terminals and everything else is a terminal symbol.
The start symbol is the non-terminal on the left hand side of the first production rule listed.
Rules with common left hand sides are combined with right-hand sides separated by "|"
Derivation
A derivation is a sequence of steps which begins with the start symbol, uses the rules to do
replacements, and ends with a terminal string (from which no further steps can be taken).
Example