chapter 3
play

Chapter 3: Chapter 3: Primitive Recursive Primitive Recursive - PowerPoint PPT Presentation

Computer Science Theory (Master Course) Yazd Univ. Chapter 3: Chapter 3: Primitive Recursive Primitive Recursive Functions Functions M. Farshi Composition- Mohammad Farshi Recursion Recursion Department of Computer Science PRC Classes


  1. Computer Science Theory (Master Course) Yazd Univ. Chapter 3: Chapter 3: Primitive Recursive Primitive Recursive Functions Functions M. Farshi Composition- Mohammad Farshi Recursion Recursion Department of Computer Science PRC Classes Yazd University Some Prim. Rec. Functions Prim. Rec. Predicates 1395-1 Iterated Oper. and Bounded Quantifiers Minimalization Pairing Functions 1 / 26 and Gödel

  2. Composition Definition: Let f be a function of k variables and let g 1 , . . . , g k be functions of n variables. Let h ( x 1 , . . . , x n ) = f ( g 1 ( x 1 , . . . , x n ) , . . . , g k ( x 1 , . . . , x n )) . Yazd Univ. Then h is said to be obtained from f and g 1 , . . . , g k Chapter 3: Primitive by composition. Recursive Functions Theorem 1.1. If h is obtained from the (partially) M. Farshi computable functions f, g 1 , . . . , g k by composition, Composition- then h is (partially) computable. Recursion Recursion Proof. PRC Classes The following program obviously computes h : Some Prim. Rec. Functions Z 1 ← g 1 ( X 1 , . . . , X n ) Prim. Rec. . Predicates . . Iterated Oper. and Bounded ← g k ( X 1 , . . . , X n ) Z k Quantifiers Y ← f ( Z 1 , . . . , Z k ) Minimalization Pairing Functions 2 / 26 and Gödel

  3. Recursion Yazd Univ. Definition: Let g : a total function of two variables Chapter 3: Primitive k : a fixed number Recursive Functions Then h is said to be obtained from g by primitive M. Farshi recursion, or simply recursion if Composition- h (0) = k, Recursion Recursion h ( t + 1) = g ( t, h ( t )) . PRC Classes Theorem 2.1. If g is computable, then h is also Some Prim. Rec. Functions computable. Prim. Rec. Predicates Iterated Oper. and Bounded Quantifiers Minimalization Pairing Functions 3 / 26 and Gödel

  4. Recursion Theorem 2.1. If g is computable, then h is computable. Proof. Yazd Univ. The constant function f ( x ) = k is computable (by a Chapter 3: program with k statement Y ← Y + 1 ). So we have Primitive Recursive macro Y ← k . Functions The following program computes h : M. Farshi Y ← k Composition- Recursion [ A ] IF X = 0 GOTO E Recursion Y ← g ( Z, Y ) PRC Classes Z ← Z + 1 Some Prim. Rec. X ← X − 1 Functions GOTO A Prim. Rec. Predicates Iterated Oper. and Bounded Quantifiers Minimalization Pairing Functions 4 / 26 and Gödel

  5. Recursion Yazd Univ. Definition: Let f : a total function of n variables Chapter 3: Primitive g : a total function of n + 2 variables Recursive Functions Then h is said to be obtained from g by primitive M. Farshi recursion, or simply recursion if Composition- h ( x 1 , . . . , x n , 0) = f ( x 1 , . . . , x n ) , Recursion Recursion h ( x 1 , . . . , x n , t + 1) = g ( t, h ( x 1 , . . . , x n , t ) , x 1 , . . . , x n ) . PRC Classes Theorem 2.1. If g is computable, then h is also Some Prim. Rec. Functions computable. Prim. Rec. Predicates Iterated Oper. and Bounded Quantifiers Minimalization Pairing Functions 5 / 26 and Gödel

  6. Recursion Theorem 2.1. If g is computable, then h is computable. Proof. Yazd Univ. The following program computes h : Chapter 3: Y ← f ( X 1 , . . . , X n ) Primitive [ A ] IF X n +1 = 0 GOTO E Recursive Functions Y ← g ( Z, Y, X 1 , . . . , X n ) M. Farshi Z ← Z + 1 Composition- X n +1 ← X n +1 − 1 Recursion GOTO A Recursion PRC Classes Some Prim. Rec. Functions Prim. Rec. Predicates Iterated Oper. and Bounded Quantifiers Minimalization Pairing Functions 6 / 26 and Gödel

  7. PRC Classes Primitive Recursively Closed Initial Function Yazd Univ. s ( x ) = x + 1 n ( x ) = 0 Chapter 3: Primitive Recursive (projection functions) for each 1 ≤ i ≤ n , Functions u n i ( x 1 , . . . , x n ) = x i M. Farshi Composition- Recursion A PRC class: Recursion A class φ of total functions is called a PRC class if PRC Classes The initial functions belongs to φ , Some Prim. Rec. Functions It is closed under composition and recursion. Prim. Rec. Predicates Iterated Oper. and Bounded Quantifiers Minimalization Pairing Functions 7 / 26 and Gödel

  8. PRC Classes Primitive Recursively Closed Theorem 3.1. The class of computable functions is a PRC class. Yazd Univ. Proof. By Theorems 1.1, 2.1, and 2.2, we need only verify that the initial functions are computable. Chapter 3: Primitive s ( x ) = x + 1 is computed by Y ← X + 1 . Recursive Functions n ( x ) is computed by the empty program. M. Farshi u n i ( x 1 , . . . , x n ) is computed by the program Y ← X i . Composition- Recursion Recursion Definition: primitive recursive function PRC Classes A function is called primitive recursive if it can be Some Prim. Rec. Functions obtained from the initial functions by a finite number of Prim. Rec. composition and recursion. Predicates Iterated Oper. and Bounded Corollary 3.2. Quantifiers Minimalization The class of primitive recursive functions is a PRC class. Pairing Functions 8 / 26 and Gödel

  9. PRC Classes Primitive Recursively Closed Theorem 3.3. A function f is primitive recursive if and only if f belongs to every PRC class. Yazd Univ. Proof. ( ⇐ ) If f belongs to every PRC class, then, in particular, by Corollary 3.2, it belongs to the class of Chapter 3: Primitive primitive recursive functions. Recursive Functions ( ⇒ ) Let f be a primitive recursive function and let φ be M. Farshi some PRC class. We want to show that f belongs to φ . Composition- Since f is a primitive recursive function, there is a list Recursion f 1 , f 2 , . . . , f n of functions such that f n = f and each f i is Recursion either an initial function or can be obtained from PRC Classes preceding functions in the list by composition or Some Prim. Rec. Functions recursion. Prim. Rec. Now the initial functions certainly belong to the PRC class Predicates φ . Moreover φ is closed under composition and recursion. Iterated Oper. and Bounded Hence each function in the list f 1 , . . . , f n belongs to φ . Quantifiers Since f n = f , f belongs to φ . Minimalization Pairing Functions 9 / 26 and Gödel Corollary 3.2.

  10. PRC Classes Primitive Recursively Closed Corollary 3.4. Yazd Univ. Every primitive recursive function is computable. Chapter 3: Primitive In Chapter 4 we shall show how to obtain a computable Recursive Functions function that is not primitive recursive. Hence it will follow M. Farshi that the set of primitive recursive functions is a proper subset of the set of computable functions. Composition- Recursion Recursion PRC Classes Some Prim. Rec. Functions Prim. Rec. Predicates Iterated Oper. and Bounded Quantifiers Minimalization Pairing Functions 10 / 26 and Gödel

  11. Some Primitive Recursive Functions f ( x, y ) = x + y We have to show how to obtain f from the initial functions using composition and recursion. Yazd Univ. Initial Functions Chapter 3: s ( x ) = x + 1 , n ( x ) = 0 , u n i ( x 1 , . . . , x n ) = x i , ( 1 ≤ i ≤ n ) Primitive Recursive Functions Step 1: Define f recursively: M. Farshi f ( x, 0) = x Composition- Recursion f ( x, y + 1) = f ( x, y ) + 1 Recursion Step 2: Use initial functions : PRC Classes u 1 Some Prim. Rec. f ( x, 0) = 1 ( x ) Functions f ( x, y + 1) = g ( y, f ( x, y ) , x ) , Prim. Rec. Predicates where g ( x 1 , x 2 , x 3 ) = s ( u 3 2 ( x 1 , x 2 , x 3 )) . Iterated Oper. and Bounded So, f ( x, y ) = x + y is a primitive recursive function. Quantifiers Minimalization Pairing Functions 11 / 26 and Gödel

  12. Some Primitive Recursive Functions h ( x, y ) = x × y We have to show how to obtain h from the initial functions using composition and recursion. Yazd Univ. Initial Functions Chapter 3: s ( x ) = x + 1 , n ( x ) = 0 , u n i ( x 1 , . . . , x n ) = x i , ( 1 ≤ i ≤ n ) Primitive Recursive Functions Step 1: Define h recursively: M. Farshi h ( x, 0) = 0 Composition- Recursion h ( x, y + 1) = h ( x, y ) + x Recursion Step 2: Use initial functions : PRC Classes h ( x, 0) = n ( x ) Some Prim. Rec. Functions h ( x, y + 1) = g ( y, h ( x, y ) , x ) , Prim. Rec. Predicates where g ( x 1 , x 2 , x 3 ) = f ( u 3 2 ( x 1 , x 2 , x 3 ) , u 3 3 ( x 1 , x 2 , x 3 )) Iterated Oper. and and f ( x 1 , x 2 ) = x 1 + x 2 . Bounded Quantifiers So, h ( x, y ) = x × y is a primitive recursive function. Minimalization Pairing Functions 12 / 26 and Gödel

  13. Some Primitive Recursive Functions h ( x ) = x ! We have to show how to obtain h from the initial functions using composition and recursion. Yazd Univ. Initial Functions Chapter 3: s ( x ) = x + 1 , n ( x ) = 0 , u n i ( x 1 , . . . , x n ) = x i , ( 1 ≤ i ≤ n ) Primitive Recursive Functions Step 1: Define h recursively: M. Farshi h (0) = 0! = 1 Composition- Recursion h ( x + 1) = ( x + 1)! = x ! × s ( x ) Recursion Step 2: Use initial functions : PRC Classes h (0) = 1 Some Prim. Rec. Functions h ( t + 1) = g ( t, h ( t )) , Prim. Rec. Predicates where Iterated Oper. and g ( x 1 , x 2 ) = s ( x 1 ) × x 2 = s ( u 2 1 ( x 1 , x 2 )) × u 2 2 ( x 1 , x 2 )) . Bounded Quantifiers So, h ( x ) = x ! is a primitive recursive function. Minimalization Pairing Functions 13 / 26 and Gödel

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend