Академический Документы
Профессиональный Документы
Культура Документы
Abhijit P. Pai
Outline
Computability notions Primitive Recursive Functions Recursive Functions Recursive Functions are Turing-Computable
Computability
Church-Turing thesis states that Turing Machines form a bound on what can be computed. The computational equivalence of the following have been shown:
Turing Machines Recursive functions Post systems Type 0 Grammars Calculus
Terms
Function: A function from I k to I for some k 0; (called a N N k-place function). Primitive Recursive function: Class of functions dened by 3 types of initial functions and two combining rules.
Initial Functions
The 0-place zero function from I 0 to I such that () = 0 N N Let k 1 and 1 i k. The i th k-place projection function ik fom I k toIN such that ik (n1 , ..., nk ) = ni for any N n1 , ..., nk IN The successor function from I to I such that N N (n) = n + 1 for each n I N An initial function is , , or one of the ik
Notation
n represents the sequence n1 , ..., nk where k 0 n will also be used to represent the k-tuple (n1 , ..., nk )
Let l > 0 and k 0 Let g be an l-place function Let h1 , ...hl be k-place functions Let f be the k-place function such that for every n I k , N f (n) = g (h1 (n), ..., hl (n)) Then f is said to be obtained from g , h1 , ...hl by composition
Let k 0, g be a k-place function, h be a (k+2)-place function. Let f be the (k+1)-place function such that for every n IN k , f (n, 0) = g (n) and for every n I k and m I , N N f (n, m + 1) = h(n, m, f (n, m)) Then f is said to be obtained from g and h by primitive recursion
A function is primitive recursive if it is an initial function or can be generated from the intial functions by some sequence of composition and primitive recursion.
Examples
Constant functions
0 0 k = 0 : K0 is , Kj+1 () = (Kj0 ()) for each j 0 k+1 k > 0 : Kj (n, 0) = Kjk (n) k+2 k > 0 : Kjk+1 (n, m + 1) = k+2 (n, m, Kjk+1 (n, m))
Examples
plus(a, m) = a + m
1 plus(a, 0) = 1 (a) 3 plus(a, m + 1) = h(m, n, plus(a, m)), h = 3
mult(a, m) = a m
1 mult(a, 0) = K0 3 3 mult(a, m + 1) = h(m, n, mult(a, m)), h = plus(1 , 3 )
Each primitive recursive function has a nite encoding Generate a list of all possible primitive recursive functions in lexicographic order A1 , A2 , A3 , ... Let fi be the p.r.f. dened by Ai Consider the 1-place function f such that for every n I , f (n) = fn (n, ..., n) + 1 N f is computable. But f must be fi for some i. When evaluated with argument i, f and fi dier by 1.
Unbounded Minimization
Let k 0 and g be a (k+1)-place function. The unbounded minimization of g is that k-place function f N such that, for any n I k , f (n) = { The least m such that g (n, m) = 0, if such m exists f (n) = { 0 otherwise We write f (n) = m[g (n, m) = 0]
Regular Functions
Recursive Functions
Input surrounded by blank on each side, written on leftmost squares of tape Head is initially at the blank just past the input string The TM M computes f if, for all w , if f (w ) = u, then (s, #w #) (h, #u#) M
is computed by a TM that moves its head one square to the right and halts. Initial cong: (s, #) Final cong: (h, ##)
ik is computed by E ki B i1 E ki - #w1 #w2 #...#wk # to #w1 #w2 #...#wi # B i1 transforms this to #wi #
Composition is Turing-computable
Composition
l > 0, k 0, g an l-place function, h1 , ...hl k-place functions f, the k-place function such that for every n IN k , f (n) = g (h1 (n), ..., hl (n))
If g , h1 ...hl are Turing-computable, so is f. Let G , H1 , ..., Hl be TMs that compute g , h1 , ..., hl . The function f is computed by the TM k k k Ck H1 Ck+1 H2 ...Ck+l1 Hl GB k
k Ck H1 - #w1 #w2 #...#wk # to #w1 #w2 #...#wk #w1 #w2 #...#wk # to #w1 #w2 #...#wk #u1 # where ui = 1hi (n) k k After Ck H1 ...Ck+l1 Hl , #w1 #w2 #...#wk #u1 #u2 #...#ul #
Composition is Turing-computable
G makes this into #w1 #w2 #...#wk #v # where v will be 1f (n) B k makes this into #v #
Primitive Recursion
k 0, g, a k-place function, h, a (k+2)-place function f, the (k+1)-place function s.t. for every n IN k , f (n, 0) = g (n) and for every n I k and m I , N N f (n, m + 1) = h(n, m, f (n, m))
If g and h are Turing-computable, so is f. Let G and H be TMs that compute g and h We write w for w1 #w2 #...wk
Now G and H compute successive values f (n, i) for i = 0, ..., m as: $#w #I m1 #w #I m2 #...#w #I 1 #w #I 0 #w # to $#w #I m1 #w #I m2 #...#w #I 1 #w #I 0 #v0 # to $#w #I m1 #w #I m2 #...#w #I 1 #v1 # to $#w #I m1 #vm1 # to $#vm # Now remove the $, and the output value is the value computed by f.
gn1 (0) = gn1 (1) = d1 = a gn1 (3) = d3 = c gn1 (4) = d1 d0 = ad0 gn1 (5) = d1 d1 = aa ...
References
Thank You
Questions