Primitive Recursive Function
Primitive Recursive Function
(Chapter 3)
1
Preliminaries: partial and total functions
The domain of a partial function on set A contains the subset of A.
The domain of a total function on set A contains the entire set A.
computable.
Primitive recursive functions: sum
We have already seen the addition function, which can
be rewritten in LRR as follows:
NB: To prove that a function is primitive recursive you need show that it
can be obtained from the initial functions using only concatenation and 8
recursion.
Primitive recursive functions: multiplication
h( x , 0 ) = 0
h( x , y + 1) = h( x , y ) + x
In LRR this can be written as:
mult(x,0) => 0 ;
mult(x,succ(y)) => sum(mult(x,y),x) ;
10
Primitive recursive functions:
power and predecessor
Power function In LRR the power function can
be expressed as follows:
x0 = 1
x y+1 = x y * x pow(x,0) => succ(null(0)) ;
pow(x,succ(y)) => mult(pow(x,y),x) ;
Predecessor
In LRR the predecessor is as follows:
function
pred(1) => 0 ;
p (0) = 0
p(t+1)=t pred(succ(x)) => x ;
11
Primitive recursive functions:
∸, | x – y | and α
dotsub(x,x) => 0 ;
x∸0=x dotsub(x,succ(y)) => pred(dotsub(x,y)) ;
|x–y| |x–y|=(x∸y)+(y∸x)
α(x) α(x) = 1 ∸ x 13
Bounded quantifiers
Theorem: Let C be a PRC class. If f( t , x1 , … ,
xn) belongs to C then so do the functions
y
g( y , x1 , ... , xn ) = f( t , x1 , …, xn )
t 0 y
g( y , x1 , ... , xn ) = f( t , x1 , …, xn )
t 0
14
Bounded quantifiers
Theorem: Let C be a PRC class. If f( t , x1 , … ,
xn) belongs to C then so do the functions
y
g( y , x1 , ... , xn ) = f( t , x1 , …, xn )
t 0
y
g( y , x1 , ... , xn ) = f( t , x1 , …, xn )
t 0
x≤y α(x∸y)
~P α( P )
P&Q P*Q
PvQ ~ ( ~P & ~Q )
y|x y | x = (∃t)≤x { y * t = x }
u=0 t=0
17
Bounded minimalization
Let P(t, x1, … ,xn) be in some PRC class C and we can define a function g as follows:
18
Bounded minimalization
Let P(t, x1, … ,xn) be in some PRC class C and we can define a function g as follows:
19
Bounded minimalization
Let P(t, x1, … ,xn) be in some PRC class C and we can define a function g as follows:
20
Bounded minimalization
Let P(t, x1, … ,xn) be in some PRC class C and we can define a function g as follows:
21
Bounded minimalization
Let P(t, x1, … ,xn) be in some PRC class C and we can define a function g as follows:
1,.
t =0
22
Bounded minimalization
Let P(t, x1, … ,xn) be in some PRC class C and we can define a function g as follows:
1,.
t =0
23
Bounded minimalization
Let P(t, x1, … ,xn) be in some PRC class C and we can define a function g as follows:
1,.
t= 0
g( y , x1 , ... , xn ) produces the least value for which P is true. Finally the
definition for bounded minimalization can be given as:
min
t y
Pt, x1,. .., xn = g y, x1,. .., xn if t t y Pt, x1,. .., xn
min
t y
Pt, x1,. .., xn = 0otherwise
24
Bounded minimalization
Let P(t, x1, … ,xn) be in some PRC class C and we can define a function g as follows:
1,.
t= 0
g( y , x1 , ... , xn ) produces the least value for which P is true. Finally the
definition for bounded minimalization can be given as:
min
t y
Pt, x1,. .., xn = g y, x1,. .., xn if t t y Pt, x1,. .., xn
min
t y
Pt, x1,. .., xn = 0otherwise
Theorem: If P(t,x1, … ,xn) belongs to some PRC class C and there is function g 25
that does the bounded minimalization for P, then f belongs to C.
Unbounded minimalization
min P ( x1,. .. , x n , y )
y
26
Unbounded minimalization
min P ( x1,. .. , x n , y )
y
27
Unbounded minimalization
min P ( x1,. .. , x n , y )
y
Rx, y = x - y * x / y