theory of computation (fall 2014): primitive recursively closed classes & definition by cases;...

Post on 13-Dec-2014

192 Views

Category:

Science

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

Theory of Computation

Primitive Recursively Closed Classes & Definition by Cases, Summations & Products, Bounded

Quantification, Bounded Quantification & Primitive Recursive Predicates

Vladimir Kulyukin

www.vkedco.blogspot.com

Outline

● Primitive Recursively Closed Classes & Definition by Cases● Summations & Products● Bounded Quantification● Bounded Quantification & Primitive Recursive Predicates

Primitive Recursively Closed Classes & Definition by Cases

Theorem 5.4 (Ch. 3): Definition by Cases

.,...,Then

otherwise. ,...,

,..., if ,...,,...,

Let . tobelong predicate theand , ,

functions Let the class. PRC a be Let

1

1

111

Cxxf

xxh

xxPxxgxxf

CPhg

C

n

n

nnn

Proof 5.4 (Ch. 3)

nn

nnn

xxPxxh

xxPxxgxxf

,...,,...,

,...,,...,,...,

11

111

Recall that * and + have been shown to be primitive recursive and a primitive recursive function belongs to every PRC class. This is Theorem 3.3 (Ch. 3).

Interpretation of Theorem 5.4 (Ch. 3)

Theorem 5.4 (Ch. 3) shows that it is possible to write if-then-else statements from the functions that we have defined previously and we know to be in the same PRC class.

if ( P(x1, …, xn) ) { return g(x1, …, xn);

}else {

return h(x1, …, xn);}

Corollary 5.5 (Ch. 3)

.Then

otherwise. ,...,

,..., if ,...,

...

,..., if ,...,

,...,

Let .,..., all and 1 allfor

,0,...,,...,let and , to

belong ,..., predicates and ,,...,

functionsary -let class, PRC a be Let

1

11

1111

1

1

11

11

Cf

xxh

xxPxxg

xxPxxg

xxf

xxmji

xxPxxPC

PPhgg

nC

n

nmnm

nn

n

n

njni

mm

Proof 5.5 (Ch. 3)

otherwise ,...,

,..., if ,...,

...

,..., if ,...,

,...,

.1Consider 3). (Ch. 5.4 Theoremby trueisstatement

the,1 If .on induction by statement thisprove We

1

1111

1111

1

n

nmnm

nn

n

xxh

xxPxxg

xxPxxg

xxf

m

mm

Proof 5.5 (Ch. 3)

induction.by ,,...,Then

otherwise. ,...,

,..., if ,...,

...

,..., if ,...,

,...,

And 3). (Ch. 5.4 Theoremby ,,...,Then

otherwise. ,...,

,..., if ,...,,...,Let

:one as functions last two therewrite We

1

1''

11

1111

1

1''

1

11111

''

Cxxf

xxh

xxPxxg

xxPxxg

xxf

Cxxh

xxh

xxPxxgxxh

n

n

nmnm

nn

n

n

n

nmnmn

Corollary 5.5 (Ch. 3): Practical Interpretation We can write if-then-else-if statements from previously defined functions in the same PRC

class:

if ( P1(x1, …, xn) ) {return g1(x1, …, xn);

}else if ( P2(x1, …, xn) ) {

return g2(x1, …, xn);}…else {

return h(x1, …, xn);}

Summations & Products

Theorem 6.1 (Ch. 3)

.),...,,(),...,,(

and

),...,,(),...,,(

functions thedo sothen

,),...,,( If class. PRC a be Let

011

10

1

1

y

tnn

n

y

tn

n

xxtfxxyh

xxtfxxyg

CxxtfC

Proof 6.1

We can use the definition of the PRC class. We know that C is a PRC class. We know that f is in C. If we can derive g and h from f using composition and recursion, g and h will, by definition, be in C.

Proof 6.1 (Ch. 3)

).,...,,1(),...,,(),...,,1(

);,...,,0(),...,,0(

:,...,,,...,,for srecurrence the writeusLet

111

11

011

nnn

nn

y

tnn

xxtfxxtgxxtg

xxfxxg

xxtfxxyg

Proof 6.1 (Ch. 3)

),...,,1(),...,,(),...,,1(

),...,,0(),...,,0(

:),...,,(),...,,(for srecurrence the writenow usLet

111

11

011

nnn

nn

y

tnn

xxtfxxthxxth

xxfxxh

xxtfxxyh

Starting Summation at 1

),...,,1(),...,,(),...,,1(

0),...,,0(

:srecurrence adjust thecan We

.),...,,(),...,,(

:1at summingstart want to weSuppose

111

1

111

nnn

n

y

tnn

xxtfxxtgxxtg

xxg

xxtfxxyg

Starting Product at 1

),...,,1(),...,,(),...,,1(

1),...,,0(

:follows as srecurrence adjust thecan We

.),...,,(),...,,(

:1at productsstart want to that weSuppose

111

1

111

nnn

n

y

tnn

xxtfxxthxxth

xxh

xxtfxxyh

Corollary 6.2 (Ch. 3)

.),...,,(),...,,(

);,...,,(),...,,(

:functions thesedo sothen

PRC, is and ),...,,( If

111

11

1

1

y

tnn

n

y

tn

n

xxtfxxyh

xxtfxxyg

CCxxtf

Bounded Quantification

Bounded Universal Quantifier: Definition

.0for ,1,...,,

ifonly and if TRUE 1 is ,...,,

1

1

yixxiP

xxtPt

n

ny

Bounded Existential Quantifier: Definition

.,0 oneleast at for ,1,...,,

ifonly and if (TRUE) 1 is ,...,,

1

1

yixxiP

xxtPt

n

ny

Theorem 6.3 (Ch. 3)

).,...,,()( and ),...,,()( predicates thedo so

thenC, class PRC some tobelongs),...,,( predicate some If

11

1

nyny

n

xxtPtxxtPt

xxtP

Proof 6.3 (Ch. 3)

1,...,,),...,,()(

:follows asproduct theof terms

intion quantifica universal bounded definecan We

011

y

tnny xxtPxxtPt

Proof 6.3 (Ch. 3)

0,...,, ),...,,()(

:follows assummation theof terms

intion quantifica lexistentia bounded definecan We

011

y

tnny xxtPxxtPt

Corollary of Theorem 6.3 (Ch. 3)

.),...,,(&)()(),...,,(

;),...,,()(),...,,()(

:follows as

tionquantifica boundedstrict -non of in terms expressed becan it

because tion,quantifica boundedstrict for validis 6.3 Theorem

11

11

nyny

nyny

xxtPyttxxtPt

xxtPyttxxtPt

Bounded Quantification &

Primitive Recursiveness

Bounded Quantification & Primitive Recursiveness

● We can now use the results on bounded quantification to show even more functions to be primitive recursive

● Bounded quantification furnishes us iterative tools that we can use to check if a predicate is true for every number in a range or for some number in a range

● We can also use the negation of a bounded quantified statement to show that there is no number for which some predicate is true

Y | X is Primitive Recursive

recursive primitive

is ) ofdivisor a is or divides ( | that Show xyxyxy

Y | X is Primitive Recursive

xtytxy x |

prime(x) is Primitive Recursive

.|1&1

)prime(

as expressed becan thisFormally, itself.

and 1 other than divisors no hasit and

1an greater th isit if prime isnumber A

xtxtttx

x

x

Longer List of Primitive Recursive Functions

.

8.

,lcm 15. 7.

,gcd 14. 6.

prime 13. 5.

| 12. 4.

11. ! 3.

10. 2.

9. .1

x

yxyx

yxyx

xxp

yxx

yxx

yxyx

yxyx

y

Reading Suggestions

● Ch. 3, Computability, Complexity, and Languages, 2nd Edition, by Davis, Weyuker, Sigal

top related