CDT314
This presentation is the property of its rightful owner.
Sponsored Links
1 / 129

CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 12 PowerPoint PPT Presentation


  • 89 Views
  • Uploaded on
  • Presentation posted in: General

CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2011. Content Chomsky’s Language Hierarchy Turing Machines Determinism Halting TM Examples Standard TM Computing Functions with TM Combining TMs Turing Thesis. The Language Hierarchy. ?.

Download Presentation

CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 12

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Cdt314 faber formal languages automata and models of computation lecture 12

CDT314

FABER

Formal Languages, Automata and Models of Computation

Lecture 12

Mälardalen University

2011


Cdt314 faber formal languages automata and models of computation lecture 12

ContentChomsky’s Language Hierarchy Turing Machines DeterminismHaltingTM ExamplesStandard TMComputing Functions with TMCombining TMsTuring Thesis


The language hierarchy

The Language Hierarchy

?

?

Context-Free Languages

Regular Languages


Cdt314 faber formal languages automata and models of computation lecture 12

Recursively enumerable languages

Context-free languages

Regular Languages


Cdt314 faber formal languages automata and models of computation lecture 12

Turing Machines

Push-down Automata

Finite Automata


Http www turing org uk turing

http://www.turing.org.uk/turing/

Who was Alan Turing?

Founder of Computability Theory,

mathematician,

philosopher,

codebreaker,

visionary man before his time.

http://www.cs.usfca.edu/www.AlanTuring.net/turing_archive/index.html-Jack Copeland and Diane Proudfoot

http://www.turing.org.uk/turing/ The Alan Turing Home PageAndrew Hodges


Alan turing

1912 (23 June): Birth, London1926-31: Sherborne School1930: Death of friend Christopher Morcom1931-34: Undergraduate at King's College, Cambridge University1932-35: Quantum mechanics, probability, logic1935: Elected fellow of King's College, Cambridge1936: The Turing machine, computability, universal machine1936-38: Princeton University. Ph.D. Logic, algebra, number theory1938-39: Return to Cambridge. Introduced to German Enigma cipher machine1939-40: The Bombe, machine for Enigma decryption1939-42: Breaking of U-boat Enigma, saving battle of the Atlantic

Alan Turing


Alan turing1

1943-45: Chief Anglo-American crypto consultant. Electronic work.1945: National Physical Laboratory, London1946: Computer and software design leading the world.1947-48: Programming, neural nets, and artificial intelligence1948: Manchester University1949: First serious mathematical use of a computer1950: The Turing Test for machine intelligence1951: Elected FRS. Non-linear theory of biological growth1952: Arrested as a homosexual, loss of security clearance1953-54: Unfinished work in biology and physics1954 (7 June): Death (suicide) by cyanide poisoning, Wilmslow, Cheshire.

Alan Turing


Hilbert s program 1900

Hilbert’s Program, 1900

Hilbert’s hope was that mathematics would be reducible to finding proofs (manipulating the strings of symbols) from a fixed system of axioms, axioms that everyone could agree were true.

Can all of mathematics be made algorithmic, or will there always be new problems that outstrip any given algorithm, and so require creative acts of mind to solve?


Cdt314 faber formal languages automata and models of computation lecture 12

Turing Machines and Computability

The question Hilbert raised was whether there could be a general method or process by which one could decide whether a mathematical proposition could be proved. But what exactly was meant by a 'method' or 'process'? People had already used the concept of a 'mechanical' process, and Turing had an idea which made this quite precise: computability. Turing wrote in his first sentences:

“The "computable" numbers may be described briefly as the real numbers whose expressions as a decimal are calculable by finite means... a number is computable if its decimal can be written down by a machine. “

http://www.turing.org.uk/turing/scrapbook/machine.html


Cdt314 faber formal languages automata and models of computation lecture 12

Turing Machines and Computability

The Turing machine concept involves specifying a very restricted set of logical operations, but Turing showed how other more complex mathematical procedures could be built out of these atomic components.

Turing argued that his formalism was sufficiently general to encompass anything that a human being could do when carrying out a definite method.

Turing's famous 1936-7 paper On computable numbers, with an application to the Entscheidungsproblem,  which worked out the theory of Turing machines and the definition of computability, is available as a PDF file on-line:

http://www.cs.ox.ac.uk/activities/ieg/e-library/sources/tp2-ie.pdf


Turing machines

Turing Machines


Turing machines1

Turing Machines

Turing’s "Machines". These machines are humans who calculate. (Wittgenstein)

A man provided with paper, pencil, and rubber, and subject to strict discipline, is in effect a universal machine. (Turing)


Cdt314 faber formal languages automata and models of computation lecture 12

Turing Machine

Tape

......

......

Read-Write head

Control Unit


Cdt314 faber formal languages automata and models of computation lecture 12

The Tape

No boundaries -- infinite length

......

......

Read-Write head

The head moves Left or Right


Cdt314 faber formal languages automata and models of computation lecture 12

......

......

Read-Write head

The head at each time step:

1. Reads a symbol

2. Writes a symbol

3. Moves Left or Right


Cdt314 faber formal languages automata and models of computation lecture 12

Example

Time 0

......

......

Time 1

......

......

1. Reads

2. Writes

3. Moves Left


Cdt314 faber formal languages automata and models of computation lecture 12

Time 1

......

......

Time 2

......

......

1. Reads

2. Writes

3. Moves Right


Cdt314 faber formal languages automata and models of computation lecture 12

The Input String

Input string

Blank symbol

......

......

head

Head starts at the leftmost position

of the input string


Cdt314 faber formal languages automata and models of computation lecture 12

States & Transitions

Write

Read

Move Left

Move Right


Cdt314 faber formal languages automata and models of computation lecture 12

Example

Time 1

......

......

current state


Cdt314 faber formal languages automata and models of computation lecture 12

Time 1

......

......

Time 2

......

......


Cdt314 faber formal languages automata and models of computation lecture 12

Example

Time 1

......

......

Time 2

......

......


Cdt314 faber formal languages automata and models of computation lecture 12

Example

Time 1

......

......

Time 2

......

......


Determinism

Determinism

Turing Machines are deterministic

Not Allowed

Allowed

No lambda transitions allowed in TM!


Determinism1

Determinism

Note the difference between stateindeterminismwhen not even possible future states are known in advance

and choice indeterminismwhen possible future states are known,but we do not know which state will be taken.


Partial transition function

Partial Transition Function

Example

......

......

Allowed

No transition

for input symbol


Halting

Halting

The machine halts if there are

no possible transitions to follow


Cdt314 faber formal languages automata and models of computation lecture 12

Example

......

......

No possible transition

HALT!


Final states

Allowed

Not Allowed

Final States

  • Final states have no outgoing transitions

  • In a final state the machine halts


Acceptance

Acceptance

If machine halts

in a final state

Accept Input

If machine halts

in a non-final state

or

If machine enters

an infinite loop

Reject Input


Turing machine example

A TM that accepts the language

Turing Machine Example


Cdt314 faber formal languages automata and models of computation lecture 12

Time 0


Cdt314 faber formal languages automata and models of computation lecture 12

Time 1


Cdt314 faber formal languages automata and models of computation lecture 12

Time 2


Cdt314 faber formal languages automata and models of computation lecture 12

Time 3


Cdt314 faber formal languages automata and models of computation lecture 12

Time 4

Halt & Accept


Cdt314 faber formal languages automata and models of computation lecture 12

Rejection Example

Time 0


Cdt314 faber formal languages automata and models of computation lecture 12

Time 1

No possible Transition

Halt & Reject


Infinite loop example

Another TM for language

Infinite Loop Example


Cdt314 faber formal languages automata and models of computation lecture 12

Time 0


Cdt314 faber formal languages automata and models of computation lecture 12

Time 1


Cdt314 faber formal languages automata and models of computation lecture 12

Time 2


Cdt314 faber formal languages automata and models of computation lecture 12

Time 2

Time 3

Time 4

Time 5

... infinite loop…


Cdt314 faber formal languages automata and models of computation lecture 12

  • Because of the infinite loop:

    • The final state cannot be reached

    • The machine never halts

    • The input is not accepted


Another turing machine example

Another Turing Machine Example

Turing machine for the language


Cdt314 faber formal languages automata and models of computation lecture 12

Time 0


Cdt314 faber formal languages automata and models of computation lecture 12

Time 1


Cdt314 faber formal languages automata and models of computation lecture 12

Time 2


Cdt314 faber formal languages automata and models of computation lecture 12

Time 3


Cdt314 faber formal languages automata and models of computation lecture 12

Time 4


Cdt314 faber formal languages automata and models of computation lecture 12

Time 5


Cdt314 faber formal languages automata and models of computation lecture 12

Time 6


Cdt314 faber formal languages automata and models of computation lecture 12

Time 7


Cdt314 faber formal languages automata and models of computation lecture 12

Time 8


Cdt314 faber formal languages automata and models of computation lecture 12

Time 9


Cdt314 faber formal languages automata and models of computation lecture 12

Time 10


Cdt314 faber formal languages automata and models of computation lecture 12

Time 11


Cdt314 faber formal languages automata and models of computation lecture 12

Time 12


Cdt314 faber formal languages automata and models of computation lecture 12

Time 13

Halt & Accept


Cdt314 faber formal languages automata and models of computation lecture 12

If we modify the

machine for the language

we can easily construct

a machine for the language

Observation


Formal definitions for turing machines

Formal Definitions for Turing Machines


Cdt314 faber formal languages automata and models of computation lecture 12

Transition Function


Cdt314 faber formal languages automata and models of computation lecture 12

Transition Function


Cdt314 faber formal languages automata and models of computation lecture 12

Turing Machine

Input

alphabet

Tape

alphabet

States

Final

states

Transition

function

Initial

state

blank


Cdt314 faber formal languages automata and models of computation lecture 12

Configuration

Instantaneous description:


Cdt314 faber formal languages automata and models of computation lecture 12

Time 4

Time 5

A move:


Cdt314 faber formal languages automata and models of computation lecture 12

Time 4

Time 5

Time 6

Time 7


Cdt314 faber formal languages automata and models of computation lecture 12

Equivalent notation:


Cdt314 faber formal languages automata and models of computation lecture 12

Initial configuration:

Input string


Cdt314 faber formal languages automata and models of computation lecture 12

The Accepted Language

For any Turing Machine

Initial state

Final state


Standard turing machine

Standard Turing Machine

The machine we described is the standard:

  • Deterministic

  • Infinite tape in both directions

  • Tape is the input/output file


Computing functions with turing machines

Computing FunctionswithTuring Machines


Cdt314 faber formal languages automata and models of computation lecture 12

has:

A function

Domain

(domän):

Range

(värdemängd):


Cdt314 faber formal languages automata and models of computation lecture 12

A function may have many parameters:

Example:

Addition function


Cdt314 faber formal languages automata and models of computation lecture 12

Decimal:

5

Binary:

101

Unary:

11111

Integer Domain

We prefer unary representation:

easier to manipulate


Cdt314 faber formal languages automata and models of computation lecture 12

Definition

A function is computable if

there is a Turing Machine such that:

Final configuration

Initial configuration

final state

initial state

For all

Domain


Cdt314 faber formal languages automata and models of computation lecture 12

A function is computable if

there is a Turing Machine such that

In other words

Initial

Configuration

Final

Configuration

For all

Domain


Example addition

is computable

The function

are integers

Example (Addition)

Turing Machine:

Input string:

unary

Output string:

unary


Cdt314 faber formal languages automata and models of computation lecture 12

Start

initial state

Finish

final state


Cdt314 faber formal languages automata and models of computation lecture 12

Turing machine for function


Cdt314 faber formal languages automata and models of computation lecture 12

Execution Example:

Time 0

(2)

(2)

Final Result


Cdt314 faber formal languages automata and models of computation lecture 12

Time 0


Cdt314 faber formal languages automata and models of computation lecture 12

Time 1


Cdt314 faber formal languages automata and models of computation lecture 12

Time 2


Cdt314 faber formal languages automata and models of computation lecture 12

Time 3


Cdt314 faber formal languages automata and models of computation lecture 12

Time 4


Cdt314 faber formal languages automata and models of computation lecture 12

Time 5


Cdt314 faber formal languages automata and models of computation lecture 12

Time 6


Cdt314 faber formal languages automata and models of computation lecture 12

Time 7


Cdt314 faber formal languages automata and models of computation lecture 12

Time 8


Cdt314 faber formal languages automata and models of computation lecture 12

Time 9


Cdt314 faber formal languages automata and models of computation lecture 12

Time 10


Cdt314 faber formal languages automata and models of computation lecture 12

Time 11


Cdt314 faber formal languages automata and models of computation lecture 12

Time 12

HALT & accept


Another example multiplication

Output string:

unary

Another Example (Multiplication)

The function

is computable

is integer

Turing Machine

Input string:

unary


Cdt314 faber formal languages automata and models of computation lecture 12

Start

initial state

Finish

final state


Cdt314 faber formal languages automata and models of computation lecture 12

Turing Machine Pseudocodefor

  • Replace every 1 with $

  • Repeat:

  • Find rightmost $, replace it with 1

  • Go to right end, insert 1

Until no more $ remain


Cdt314 faber formal languages automata and models of computation lecture 12

Turing Machinefor


Cdt314 faber formal languages automata and models of computation lecture 12

Start

Finish


Cdt314 faber formal languages automata and models of computation lecture 12

Time 0


Cdt314 faber formal languages automata and models of computation lecture 12

Time 1


Cdt314 faber formal languages automata and models of computation lecture 12

Time 2


Cdt314 faber formal languages automata and models of computation lecture 12

Time 3


Cdt314 faber formal languages automata and models of computation lecture 12

Time 4


Cdt314 faber formal languages automata and models of computation lecture 12

Time 5


Cdt314 faber formal languages automata and models of computation lecture 12

Time 6


Cdt314 faber formal languages automata and models of computation lecture 12

Time 7


Cdt314 faber formal languages automata and models of computation lecture 12

Time 8


Cdt314 faber formal languages automata and models of computation lecture 12

Time 9


Cdt314 faber formal languages automata and models of computation lecture 12

Time 10


Cdt314 faber formal languages automata and models of computation lecture 12

Time 11


Cdt314 faber formal languages automata and models of computation lecture 12

Time 12


Cdt314 faber formal languages automata and models of computation lecture 12

Time 13


Cdt314 faber formal languages automata and models of computation lecture 12

Time 14


Another example

if

if

Input:

or

Output:

Another Example

Turing Machine for

The function is computable


Cdt314 faber formal languages automata and models of computation lecture 12

Match a 1 from with a 1 from

Turing Machine Pseudocode

  • Repeat

Until all of or are matched

  • If a 1 from is not matched

  • erase tape, write 1

  • else

  • erase tape, write 0


Combining turing machines

Combining Turing Machines


Cdt314 faber formal languages automata and models of computation lecture 12

Block Diagram

Turing

Machine

input

output


Cdt314 faber formal languages automata and models of computation lecture 12

Example

if

if

Adder

Comparer

Eraser


Turing s thesis

Turing’s Thesis


Cdt314 faber formal languages automata and models of computation lecture 12

Question:

Do Turing machines have

the same power with

a digital computer?

Intuitive answer: Yes

There is no formal answer!


Cdt314 faber formal languages automata and models of computation lecture 12

Turing’s thesis

Any computation carried out

by mechanical means

can be performed by a Turing Machine

(1930)

http://www.engr.uconn.edu/~dqg/papers/myth.pdf The Origins of the Turing Thesis Myth Goldin & Wegner


Cdt314 faber formal languages automata and models of computation lecture 12

And, the other way round:

A computation is mechanical

if and only if

it can be performed by a Turing Machine

Strong Turing Thesis: There is no known model of computation

more powerful than Turing Machines

Wrong! Asynchronous parallel computation is more powerful than TM model, and cannot be reduced to TM.


Cdt314 faber formal languages automata and models of computation lecture 12

An algorithm for function

is a Turing Machine which computes

Definition of Algorithm


Cdt314 faber formal languages automata and models of computation lecture 12

Algorithms are Turing Machines

When we say

There exists an algorithm

It means

There exists a Turing Machine


Cdt314 faber formal languages automata and models of computation lecture 12

Languages, Grammars, Machines

properly inclusive


Cdt314 faber formal languages automata and models of computation lecture 12

Unrestricted grammarlanguages

TURING MACHINES

Context-free languages

PUSH-DOWN AUTOMATA

Regular Languages

FINITE AUTOMATA


Interesting further reading

Interestingfurtherreading

Computational and evolutionary aspects of language

http://www.nature.com/nature/journal/v417/n6889/full/nature00771.html

Turing’sthesis

http://www.ams.org/notices/200610/fea-feferman.pdf

http://www.mathcomp.leeds.ac.uk/turing2012/give-page.php?408

2012 The Alan Turing World

https://sites.google.com/site/naturalcomputingaisbiacap2012 Symposium on Natural/Unconventional Computing AISB/IACAP World Congress


  • Login