TCS Lect 21 Grammar Introduction
TCS Lect 21 Grammar Introduction
language
Grammar
Grammar G is defined as a quadruple:
GRAMMAR G = ( V, T, S, P )
Where
V – Finite Set of Objects (Variables)
T – Finite Set of Objects (Terminals)
S ∈ V Special Symbol (Start Symbol)
Computa
ble
Type 3: Regular Languages
Languag
e • They can be described using Regular Expression
Context • Languages can be modelled by DFA / NFA
Sensitive
Language
• These automata doesn’t have any device to memorize
Context
Free
Languag
e
Regular
Languag
e
GRAMMAR
Regular
Languag
e
GRAMMAR Type 1: Context Sensitive Languages
Context Sensitive Grammar is used to represent these
languages
Grammar has following rules:
Computa
ble • More than one symbol can be present on left hand side of
Languag production rules
e
Context • Number of symbols on the left hand side of the production
Sensitive
Language should not exceed number of symbols on right hand side of
Context the production
Free
Languag • The rule of the form A → ε unless A is start symbol
e
The machine used is Linear Bounded Automata
Regular Sentential form must always increased after applying
Languag
e production rule
GRAMMAR
Computa
ble Type 1: Unrestricted Languages
Languag
e • No restriction on the grammar rules of these type of
Context languages
Sensitive
Language
• Languages can be modelled using Turing Machine
Context
Free
Languag
e
Regular
Languag
e