Last One Afl
Last One Afl
Difference
Sl. Comparision Recursive Language Recursively Enumerable
No. Base (REC) Languages (RE)
1 Also Known Turing decidable Turing recognizable
as languages languages
2 Definition In Recursive Languages, In Recursively enumerable
the Turing machine languages, the Turing
accepts all valid strings machine accepts all valid
that are part of the strings that are part of the
language and rejects all language and rejects all the
the strings that are not strings that are not part of
part of a given language the given language but do
and halt. not halt and starts an
infinite loop.
3 States i. Halt and accept i. Halt and accept
ii. Halt and Reject ii. Halt and Reject
iii. Never Halt (Infinite
loop)
4 Loop Finite Loop Infinite loops of machine
are possible
5 Halting Halting Turing Machine Non Halting Turing
Machine
context-sensitive RE languages or type-0
language language
1.2 Chomsky Classification of Grammar & Languages.
Chomsky Hierarchy: Different types of rules, allow one to describe different
aspects of natural language. These grammars form a hierarchy.
According to Noam Chomosky, there are four types of grammars − Type 0,
Type 1, Type 2, and Type 3. The following table shows how they differ from
each other:
Type Grammar Language Automation Production Type Examples
Unrestricted Recursively Turing The productions S → ACaB
Grammar enumerable Machine have no restrictions. Bc → acB
(UG) language (TM) α→β CB → DB
where aD → Db
Type-0 α ∈ (V + T)* V (V + T)* ….…………...
i.e. α can not be ε, there L={w|w
must be atleast one describes a
variable.
terminating
β ∈ (V + T)*
turing machine}
V - Variables
T - Termials
Context- Context- Linear- First of all Type 1 AB → AbBc
grammar should be Type 0
Sensitive sensitive Bounded with the restriction- A → bcA
Grammar language Automata α→β B→b
(CSG) (LBA) |α| ≤ |β| ….…………
That is the count of L={anbncn|n>0}
Type-1 symbol in α is less than or
equal to β.
and
α ∈ (V + T)* V (V + T)*
β ∈ (V + T)+
i.e. β can not be ε.
Context-Free Context-free Push Down First of all, it should be S→Xa
Type 1 and The left-hand
Grammar language Automata side of production can X→a
(CFG) (PDA) have only one variable X → aX
(|α|=1) and there is no X → abc
Type-2 restriction on β.
X→ε
α→β
Where, ….………….
α∈V L={anbn|n>0}
β ∈ (V + T)*.