9.7: chomsky hierarchy. turing machine turing machine (ii) unrestricted grammar recognized by turing...

9
9.7: Chomsky Hierarchy

Upload: ernest-mccoy

Post on 18-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 9.7: Chomsky Hierarchy. Turing Machine Turing Machine (II) Unrestricted grammar Recognized by Turing machine It consists of a read-write head that can

9.7: Chomsky Hierarchy

Page 2: 9.7: Chomsky Hierarchy. Turing Machine Turing Machine (II) Unrestricted grammar Recognized by Turing machine It consists of a read-write head that can

Turing Machine

Page 3: 9.7: Chomsky Hierarchy. Turing Machine Turing Machine (II) Unrestricted grammar Recognized by Turing machine It consists of a read-write head that can

Turing Machine (II)

• Unrestricted grammar

• Recognized by Turing machine

• It consists of a read-write head that can be positioned anywhere along an infinite tape.

• It is not a useful class of language for compiler design.

Page 4: 9.7: Chomsky Hierarchy. Turing Machine Turing Machine (II) Unrestricted grammar Recognized by Turing machine It consists of a read-write head that can

Linear-Bounded Automata

Page 5: 9.7: Chomsky Hierarchy. Turing Machine Turing Machine (II) Unrestricted grammar Recognized by Turing machine It consists of a read-write head that can

Linear-Bounded Automata

• Context-sensitive

• Restrictions– Left-hand of each production must have at

least one nonterminal in it– Right-hand side must not have fewer symbols

than the left– There can be no empty productions (N)

Page 6: 9.7: Chomsky Hierarchy. Turing Machine Turing Machine (II) Unrestricted grammar Recognized by Turing machine It consists of a read-write head that can

Push-Down Automata

Page 7: 9.7: Chomsky Hierarchy. Turing Machine Turing Machine (II) Unrestricted grammar Recognized by Turing machine It consists of a read-write head that can

Push-Down Automata (II)

• Context-free• Recognized by push-down automata• Can only read its input tape but has a stack that can

grow to arbitrary depth where it can save information• An automation with a read-only tape and two

independent stacks is equivalent to a Turing machine.• It allows at most a single nonterminal (and no terminal)

on the left-hand side of each production.

Page 8: 9.7: Chomsky Hierarchy. Turing Machine Turing Machine (II) Unrestricted grammar Recognized by Turing machine It consists of a read-write head that can

Finite-State Automata

Page 9: 9.7: Chomsky Hierarchy. Turing Machine Turing Machine (II) Unrestricted grammar Recognized by Turing machine It consists of a read-write head that can

Finite State Automata (II)

• Regular language• Anything that must be remembered about

the context of a symbol on the input tape must be preserved in the state of the machine.

• It allows only one symbol (a nonterminal) on the left-hand, and only one or two symbols on the right.