1 / 18

Lecture 1-4 Recursive Functions

Lecture 1-4 Recursive Functions. Initial Functions. Zero function ζ (n) = 0. Successor σ (n) = n+1, for n ε N. Projection π i (n 1 ,…,n k ) = n i. k. Composition. Let m, k be two integers. Given functions g: N → N and h i : N → N for I = 1, 2, …, m, define f: N → by

ddifranco
Télécharger la présentation

Lecture 1-4 Recursive Functions

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 1-4 Recursive Functions

  2. Initial Functions • Zero function ζ(n) = 0. • Successor σ(n) = n+1, for n ε N. • Projectionπi (n1,…,nk) = ni. k

  3. Composition • Let m, k be two integers. • Given functions g: N → N and hi: N → N for I = 1, 2, …, m, define f: N → by f(n1,…,nk) = g(h1(n1,…,nk),…,hm(n1,…,nk) • f is called thecompositionof g and h1, …,hm. • f = go(h1,…,hm) m k k

  4. Primitive Recursion k k+2 • Let k > 0. Given g: N → N and h: N → N, (when k=0, g is a constant), define f : N → N by f(n1,…nk,0) = g(n1,…,nk) f(n1,…,nk,m+1) = h(n1,…,nk,m,f(n1,…nk,m) k+1

  5. Primitive Recursive Functions • All initial functions are primitive recursive. • If g and h1, …, hm are primitive recursive, so is go(h1, …, hk). • If g and h are primitive recursive, so is f obtained from g and h by primitive recursion. • Nothing else is primitive recursive.

  6. Add(m, n) = m+n • Add(m,0) = π1 (m) • Add(m, n+1) = σ( π3 (m,n, add(m, n))) 1 3

  7. mult(m, n) = mn • mult(m, 0) = ζ(m) • Mult(m, n+1) = add(π1(m,n,mult(m,n)), π3(m, n, mult(m,n)) 1 3

  8. minus(m,n)= m-n if m > n; 0 if m<n • pred(m) = minus(m,1) pred(0) = ζ(0) pred(m+1) = m = π1 (m, pred(m)) • minus(m,0) = π1 (m) minus(m, n+1) = pred(π3(m,n,minus(m, n)) 2 1 3

  9. Pairing Function • A function f: N → N is a pairing function if it satisfies the following conditions: (1) f is 1-to-1 and onto; (2) f is primitive recursive; (3) f(i, j) < f(i+1, j), f(i, j) < f(i, j+1). • For example,

  10. Two “inverse” functions i = g(f(i,j)) and j = h(f(i, j)) are also primitive recursive. 14 13 9 8 5 12 2 4 7 11 0 1 3 6 10

  11. Bounded minimization K+1 • Given g: N → N, define f by f(n1, …, nk, m) = min {i | g(n1, …, nk, i)=1} if there exists i < m such that g(n1, …, nk, i) =1; = 0, otherwise. • If g is primitive recursive, so is f.

  12. Unbounded minimization K+1 • Given g: N → N, define f by f(n1, …, nk) = min {i | g(n1, …, nk, i)=1} if there exists i such that g(n1, …, nk, i) =1; = ↑, otherwise. • f may not be primitive recursive, even if g is.

  13. Partial Recursive Functions • All initial functions are partial recursive. • If g is a total recursive function, then f obtained from g by unbounded minimization is partial recursive. • If g and h1,…, hk are partial recursive, so is go(h1,…,hk). • If g and h are partial recursive, so is f obtained from g and h by primitive recursion.

  14. Over Σ* • Zero function ζ(x) = ε. • Successor σa(x) = xa for a in Σ. • Projection (no change) • Composition (no change) • Primitive recursion (need a change, m+1 is replaced by ma) • Unbounded minimization (need to give a linear ordering of Σ*)

  15. From Σ* to Γ* for Σ* cΓ* • Zero function ζ(x) = ε. • Successor σa(x) = xa for a in Γ. • N can be considered as a subset of {0, 1}* if we represent n by 1…1 n

  16. Theorem • A function is partial recursive iff it is Turing-computable.

  17. Theorem The following are equivalent: • A is r.e. • A is Turing-acceptable. • A is the range of a primitive recursive function. • A is the domain of a partial recursive function.

  18. Pairing function on Σ* • Let π(i, j) be a pairing function on N. • Let φ be a 1-to-1 onto mapping from N to Σ*. • Let μ be a 1-to-1 onto mapping from Σ* to N. • Then p(x, y) = φ(π(μ(x), μ(y)) is a pairing function on Σ*.

More Related