Comput Lection 3
Comput Lection 3
Church Thesis Gdelization Universal Turing machine Padding Lemma Models of computation: -calculus
Church-Turing Thesis
The functions computed by an algorithm coincide with the class of functions computable by Turing machines. Recall that f : N N is Turing computable iff there exists a TM A
starting with q0 , x, A halts iff f (x) in that case w0 qa y , where f (x) = y .
Church-Turing Thesis
The functions computed by an algorithm coincide with the class of functions computable by Turing machines. Evidences:
many independent proposals for a precise formulation of
are Turing-computable
the computation of a Turing machine is an example of
algorithm
no one has ever found a computable function that is not
Turing-computable
Computable Functions
To prove that a function f is computable:
write a Turing machine that computes the function give an informal algorithm to compute f and use Churchs
thesis
Godelization
T : TM N
1. 2. 3.
Extract M from T (M ) and check that w is a correct string Simulates M on input w If M on input w enters its accept state, U accept, and if M on input w ever enters its reject state, U reject.
1. 2. 3.
Extract M from T (M ) and check that w is a correct string Simulates M on input w If M on input w enters its accept state, U accept, and if M on input w ever enters its reject state, U reject.
computation.
When U starts (< M >, w) is written on the rst tape and
state on tape 3.
component matches the state written on tape 3 and the second component matches the current symbol on tape 1).
If it is found, change the state on tape 3 and update tape 1
accordingly.
If not found, the nal state has been reached.
Padding Lemma
0 Z0 0 1 Z1 1 2 Z2 2 3 Z3 3 ... is an enumeration of computable functions
Padding Lemma
0 Z0 0 1 Z1 1 2 Z2 2 3 Z3 3 ... is an enumeration of computable functions
-calculus of Alonzo Church Turing machines of Alan Turing Recursive functions of Gdel and Kleene Counter machines of Minsky Normal algorithms of Markov Unrestricted grammars Two stack automata
. .
Church-Turing Thesis
These denitions look very different, but are provably equivalent. The Church-Turing Thesis: The intuitive notion of reasonable models of computation equals Turing machine algorithms.
Church-Turing Thesis
Why is this a thesis and not a theorem? Because the notion of reasonable model of computing is not well dened. In 2008, Nachum Dershowitz (TAU) and Yu. Gurevitch (MSFT) gave an axiomatization of this notion. This axiomatization seems to reasonably capture what a reasonable model of computing is. Under this axiomatization, DG gave a proof of the Church-Turing thesis.
calculus
Why calculus?
A more abstract, machine-independent description of the collection of computable functions than that provided by Turing machines.
Historical Useful for formal semantics of programming languages Its at the core of functional programming languages (LISP,
ML..)
-Terms
are built from a given, countable collection of
variables x, y, z . . .
-Terms
Notational conventions:
(x1 x2 . . . xn .M ) means (x1 .(x2 . . . . (xn .M ) . . . ) (M1 M2 . . . Mn ) means (. . . (M1 M2 ) . . . Mn ), i.e. application
is left-associative
drop outermost parentheses and those enclosing the body
of a -abstraction
-Equivalence M = M
x.M is intended to represent the function f such that f (x) = M,
for all x.
-Equivalence M = M
x.M is intended to represent the function f such that f (x) = M,
for all x.
Hence if M = M [x /x] is the result of taking M and changing all occurrences of x to some variable x that does not appear free in M , then x.M and x .M both represent the same function.
-Equivalence M = M
x.M is intended to represent the function f such that f (x) = M,
for all x.
Hence if M = M [x /x] is the result of taking M and changing all occurrences of x to some variable x that does not appear free in M , then x.M and x .M both represent the same function.
x.M x .M [x /x]
-Equivalence
is the smallest relation on terms satisfying the following rules:
M =M
(ref l)
M = N N = P (trans) M =P
M = M N = N (cong ) M N = M N
y /M ( ) x.M = y.(M {y /x })
-Reduction
The process of evaluating lambda terms by "plugging arguments into functions".
x.M can be seen as a function on -terms via substitution: map each N to M [N/x].
-Reduction
The process of evaluating lambda terms by "plugging arguments into functions".
x.M can be seen as a function on -terms via substitution: map each N to M [N/x].
to the corresponding
-reduct M [N/x]
Substitution M [N/x]
x[N/x] = N y [N/x] = y (if x = y ) y.M [N/x] = y.(M [N/x]) if x = y and y F V (N x) (M1 M2 )[N/x] = M1 [N/x]M2 [N/x]
y fresh
Single-step -reduction
Is the smallest relation on terms satisfying
(x.M )N M [N/x]
( )
M M (cong1 ) M N M N
N N (cong2 ) M N M N
M N ( ) x.M x.N
Church-Rosser
Theorem is conuent, that is, if
M1 M M2
Normal Form
Def. A -term N is in -normal form (nf) if it contains no -redex (i.e. no sub-terms of the form (x.M )M ). M has -nf N if M = N with N a -nf.
Normal Form
Def. A -term N is in -normal form (nf) if it contains no -redex (i.e. no sub-terms of the form (x.M )M ). M has -nf N if M = N with N a -nf. Note that if N is in -nf and N N , then N = N .
Normal Form
Def. A -term N is in -normal form (nf) if it contains no -redex (i.e. no sub-terms of the form (x.M )M ). M has -nf N if M = N with N a -nf. Note that if N is in -nf and N N , then N = N . Corollary: The -nf of M is unique up to -equivalence, if it exists.
Non-termination
Some terms have no -nf
Non-termination
Some terms have no -nf Ex.
:= (x.xx)(x.xx)
F := xy.y
-denable functions
f : N n N is -denable if there is a closed -term F that represents it: for all (x1 , . . . xn ) N n and y N
if f (x1 , . . . xn ) = y then F x1 . . . xn = y if f (x1 , . . . xn ) , then F x1 . . . xn has no -nf
Computable = -denable
Bibliography
Sipser, Introduction to the Theory of Computation, PWS