Download Chomsky Hierarchy Language Operations and Properties

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Turing's proof wikipedia , lookup

Algorithm characterizations wikipedia , lookup

Busy beaver wikipedia , lookup

Computability theory wikipedia , lookup

History of the Church–Turing thesis wikipedia , lookup

Transcript
Chomsky Hierarchy
Language Operations and Properties
The Chomsky Hierarchy
Type
Language
Grammar
Automaton
0
Partially Computable
Unrestricted
DTM - NTM
1
Context Sensitive
Context Sensitive
Linearly Bounded
Automaton
2
Context Free
Context Free
NPDA
3
Regular
right regular,
left regular
DFA, NFA
Type 3  Type 2  Type 1  Type 0
You don’t
have to
know this
The Chomsky Hierarchy
Partially Computable Languages
{M, H(<M>)}
Computable Languages
{an bn cn , n ≥ 0}
Context Free Languages
{an bn , n ≥ 0}
Regular Languages
{am bn , m,n ≥ 0}
Regular Languages
To prove that a language is regular:
• Find a DFA (NFA, NFAε) that recognizes it.
• Find a regular expression that represents is.
• Find a (right or left) regular grammar that
generates it.
Context Free Languages
To prove that a language is context free:
• Find a NPDA that recognizes it.
• Find a context free grammar that generates it.
Computable Languages
To prove that a language is computable you
must find a Turing Machine that decides
membership in the language:
• If the string is in the language then the
machine should accept.
• If the string is not in the language then the
machine should reject.
• The machine shouldn’t loop for any input.
Partially Computable Language
To prove that a language is partially computable:
• Find a Turing Machine that recognizes it:
– if the string is in the language the machine should
accept.
– if the string is not in the language the machine
should loop.
• Give an unrestricted grammar that represents
it (you won’t be asked to do that…)
Closure under operations
• Regular Languages are closed under: Union,
Concatenation, Star, Intersection and
Complement
• Context Free Languages are closed under: Union,
Concatenation, Star. They are not closed under:
Intersection, Complement.
• Computable Languages are closed under: Union,
Concatenation, Star, Intersection, Complement
• Partially Computable Languages are closed under:
Union, Concatenation, Star, Intersection. They are
not closed under Complement.
Computable and Partially Computable
Languages
• Computable languages most of the times are
called Decidable Languages because a Turing
Machine can decide membership in those
languages (it can either accept or reject a string).
They are also called Recursive.
• Partially Computable Languages most of the times
are called Recognizable because a Turing Machine
can recognize a string in the language (accept it)
but it might not be able to decide if a string is not
in the language (it might loop). They are also
called Recursively Enumerable.
Computable Languages are also
Partially Computable
Proof:
If L is Computable then there is a Turing Machine M
that decides membership in L:
– M accepts on x if x is in L
– M rejects on x if x is not in L
Change M to M’ in the following way:
– For all the combinations (q,a) for which the machine
rejects add the transition δ(q,a) = (q, a, S)
Now the new machine M’:
– Accepts on x if x is in L
– Loops on x is x is not in L
So M’ recognizes L.
Properties of Computable and Partially
Computable Languages
• If a language L and its complement are both
partially computable then the language is
computable
Both L and its complement have TMs M and M’ that
recognize them. To decide if x is in L: Run both
machines M and M’ in parallel. Eventually one will
halt. If M halts accept. If M’ halts reject.