RegularGrammars
RegularGrammars
Definition
A Regular Grammar is a tuple (N, Σ, R, S) with:
• R is the set of production rules. These rules have one of the following forms:
N → α, N→ αN, or N → where N is a single non-terminal symbol and α
is a single alphabet symbol (α ∈ Σ).
Derivation of a Word
The rules of a grammar can be used to derive or generate a word in a formal
language. Any derivation starts with the only the start symbol, S , of the grammar.
Each single step of a derivation modifies the current sequence of symbols by using
one single production rule of the grammar. The production rule replaces some
single occurrence of a non-terminal symbol N with the symbols on the right hand
side of the rule producing a new current sequence of symbols.
A sequence of symbols which contains any symbols in N is a partial deriva-
tion. If the sequence of symbols contains only symbols in Σ then the derivation
is complete. The result of a complete derivation is a valid word in the formal
language generated by the grammar.
1
Example Word Derivations
Consider the grammar (N, Σ, R, S) where:
• N = {S}
• Σ = {a, b, c}
• R = {S → aS, S → }
• N = {S}
• Σ = {a, b, c}
• R = {S → aS, S → bS, S → }