COMP 4036 Computability
COMP 4036 Computability
COMP 4036 Computability
Computability
Overview
· not all functions are computable
f(4) =?
f(5) =?
Nontermination
f(x:int) = if x = 0 then 0 else x + f(x - 2)
=⇒ partial
Partial Functions
· functions in programming differ from functions in math:
partial vs. total
− f : N → N. f (x) = 3x
− g : N → N. g(x) = x
· Church’s Thesis
− Turing machines
· tape symbols
· computation step:
1. state change
M = (Q, T, I, δ, b, q0, qf )
where
Q set of states
b blank
q0 initial state
qf final state
· computation step: `
Computing Functions with TMs
· input encodes arguments: e.g. x1#x2# . . . #xn#
while (...) {
...
}
... remaining program ...
or