Title: Computation, Computers, and Programs Recursive functions
1CS20a Models (Nov 5, 2002)
- Turing Machines
- Churchs thesis TM are a general model of
computation - But (almost) everything is undecidable
- Today alternative models
- Primitive recursive functions
- Total recursive functions
- Partial recursive functions
2Primitive recursion
3Primitive recursion (conventional form)
4Arithmetic
5Exponentiation
6Hyper-exponentation
7Ackermans function
8Subtraction
9Equality
10For-programs
11For-loop for y do p done
12Interpretation of for-programs
- Some variables variables are designated as input
- Some are designated as output
- The program defines a function Ninput ? Noutput
13For programs and primitive recursion
14Encoding p.r. functions as for-loops
15Encoding for-loops as p.r. functions
16Partial-recursive functions
17Properties of p.r. programs
- The programs always terminate
- However, does not include all recursive
computations - Can code extremely large functions, but some
functions are not definable (Ackermans) - Well argue later that all tractable computations
are primitive recursive
18Partial recursive functions (Godel)
- To capture r.e. computations, we need more
- A partial recursive computation includes the
prim-rec computations, plus unbounded minimization
19Unbounded minimization
20While-programs
21Enumerating the partial-recursive funs
22Indexing partial recursive funs
23Universal functions
24Godel numbering
25Composition
26Constant functions
27Recursion theorem
28Recursion theorem proof (cont.)
29Rices theorem