advanced topics in theoretical computer science
play

Advanced Topics in Theoretical Computer Science Part 3: Recursive - PowerPoint PPT Presentation

Advanced Topics in Theoretical Computer Science Part 3: Recursive Functions (1) 21.11.2018 Viorica Sofronie-Stokkermans Universit at Koblenz-Landau e-mail: sofronie@uni-koblenz.de 1 Contents Recapitulation: Turing machines and Turing


  1. Advanced Topics in Theoretical Computer Science Part 3: Recursive Functions (1) 21.11.2018 Viorica Sofronie-Stokkermans Universit¨ at Koblenz-Landau e-mail: sofronie@uni-koblenz.de 1

  2. Contents • Recapitulation: Turing machines and Turing computability • Register machines (LOOP, WHILE, GOTO) • Recursive functions • The Church-Turing Thesis • Computability and (Un-)decidability • Complexity • Other computation models: e.g. B¨ uchi Automata, λ -calculus 2

  3. 3. Recursive functions • Introduction/Motivation • Primitive recursive functions �→ P • P = LOOP • µ -recursive functions �→ F µ • F µ = WHILE • Summary 3

  4. Recursive functions Motivation Functions as model of computation (without an underlying machine model) Idea • Simple (“atomic”) functions are computable • “Combinations” of computable functions are computable (We consider functions f : N k → N , k ≥ 0) 4

  5. Recursive functions Motivation Functions as model of computation (without an underlying machine model) Idea • Simple (“atomic”) functions are computable • “Combinations” of computable functions are computable (We consider functions f : N k → N , k ≥ 0) Questions • Which are the atomic functions? • Which combinations are possible? 5

  6. Recursive functions: Atomic functions The following functions are primitive recursive and µ -recursive: 6

  7. Recursive functions: Atomic functions The following functions are primitive recursive and µ -recursive: The constant null 0 : N 0 → N with 0() = 0 7

  8. Recursive functions: Atomic functions The following functions are primitive recursive and µ -recursive: The constant null 0 : N 0 → N with 0() = 0 Successor function +1 : N 1 → N with + 1( n ) = n + 1 for all n ∈ N 8

  9. Recursive functions: Atomic functions The following functions are primitive recursive and µ -recursive: The constant null 0 : N 0 → N with 0() = 0 Successor function +1 : N 1 → N with + 1( n ) = n + 1 for all n ∈ N Projection function i : N k → N with π k π k i ( n 1 , . . . , n k ) = n i 9

  10. Recursive functions Notation: We will write n for the tuple ( n 1 , . . . , n k ), k ≥ 0. 10

  11. Recursive functions: Composition Composition: g : N r → N If the functions: r ≥ 1 h 1 : N k → N , . . . , h r : N k → N k ≥ 0 are primitive recursive resp. µ -recursive, then f : N k → N defined for every n ∈ N k by: f ( n ) = g ( h 1 ( n ), . . . , h r ( n )) is also primitive recursive resp. µ -recursive. Notation without arguments: f = g ◦ ( h 1 , . . . , h r ) 11

  12. Primitive recursive functions Until now: • Atomic functions (Null, Successor, Projections) • Composition Next: • Primitive recursion Definition of primitive recursive functions 12

  13. Primitive recursive functions Primitive recursion If the functions g : N k → N ( k ≥ 0) h : N k +2 → N are primitive recursive, then the function f : N k +1 → N with f ( n , 0) = g ( n ) f ( n , m + 1) = h ( n , m , f ( n , m )) is also primitive recursive. 13

  14. Primitive recursive functions Primitive recursion If the functions g : N k → N ( k ≥ 0) h : N k +2 → N are primitive recursive, then the function f : N k +1 → N with f ( n , 0) = g ( n ) f ( n , m + 1) = h ( n , m , f ( n , m )) is also primitive recursive. Notation without arguments: f = PR [ g , h ] 14

  15. Primitive recursive functions Definition (Primitive recursive functions) • Atomic functions: The functions – Null 0 – Successor +1 π k – Projection (1 ≤ i ≤ k ) i are primitive recursive. • Composition: The functions obtained by composition from primitive recursive functions are primitive recursive. • Primitive recursion: The functions obtained by primitive recursion from primitive recursive functions are primitive recursive. 15

  16. Primitive recursive functions Definition (Primitive recursive functions) • Atomic functions: The functions – Null 0 – Successor +1 π k – Projection (1 ≤ i ≤ k ) i are primitive recursive. • Composition: The functions obtained by composition from primitive recursive functions are primitive recursive. • Primitive recursion: The functions obtained by primitive recursion from primitive recursive functions are primitive recursive. 16

  17. Primitive recursive functions Definition (Primitive recursive functions) • Atomic functions: The functions – Null 0 – Successor +1 π k – Projection (1 ≤ i ≤ k ) i are primitive recursive. • Composition: The functions obtained by composition from primitive recursive functions are primitive recursive. • Primitive recursion: The functions obtained by primitive recursion from primitive recursive functions are primitive recursive. Notation: P = The set of all primitive recursive functions 17

  18. Arithmetical functions: definitions f ( n ) = n + c f ( n ) = n f ( n , m ) = n + m f ( n , m ) = n − 1 f ( n , m ) = n − m f ( n , m ) = n ∗ m 18

  19. Arithmetical functions: definitions f ( n ) = n + c , for c ∈ N , c > 0 19

  20. Arithmetical functions: definitions f ( n ) = n + c , for c ∈ N , c > 0 f ( n ) = (+1)(...((+1) ( n ))) � �� � c times 20

  21. Arithmetical functions: definitions f ( n ) = n + c , for c ∈ N , c > 0 f = (+1) ◦ · · · ◦ (+1) � �� � c times 21

  22. Arithmetical functions: definitions f ( n ) = n + c , for c ∈ N , c > 0 f = (+1) ◦ · · · ◦ (+1) � �� � c times Identity f : N → N , with f ( n ) = n 22

  23. Arithmetical functions: definitions f ( n ) = n + c , for c ∈ N , c > 0 f = (+1) ◦ · · · ◦ (+1) � �� � c times Identity f = π 1 1 23

  24. Arithmetical functions: definitions f ( n ) = n + c , for c ∈ N , c > 0 f = (+1) ◦ · · · ◦ (+1) � �� � c times Identity f = π 1 1 f ( n , m ) = n + m 24

  25. Arithmetical functions: definitions f ( n ) = n + c , for c ∈ N , c > 0 f = (+1) ◦ · · · ◦ (+1) � �� � c times Identity f = π 1 1 f ( n , m ) = n + m f ( n , 0) = n f ( n , m + 1) = (+1)( f ( n , m )) 25

  26. Arithmetical functions: definitions f ( n ) = n + c , for c ∈ N , c > 0 f = (+1) ◦ · · · ◦ (+1) � �� � c times Identity f = π 1 1 f ( n , m ) = n + m g = π 1 f ( n , 0) = n g ( n ) = n 1 h = (+1) ◦ π 3 f ( n , m + 1) = (+1)( f ( n , m )) h ( n , m , k ) = +1( k ) 3 26

  27. Arithmetical functions: definitions f ( n ) = n + c , for c ∈ N , c > 0 f = (+1) ◦ · · · ◦ (+1) � �� � c times Identity f = π 1 1 f ( n , m ) = n + m g = π 1 f ( n , 0) = n g ( n ) = n 1 h = (+1) ◦ π 3 f ( n , m + 1) = (+1)( f ( n , m )) h ( n , m , k ) = +1( k ) 3 f = PR [ π 1 1 , (+1) ◦ π 3 3 ] 27

  28. Arithmetical functions: definitions f ( n ) = n + c , for c ∈ N , c > 0 f = (+1) ◦ · · · ◦ (+1) � �� � c times Identity f = π 1 1 f ( n , m ) = n + m f = PR [ π 1 1 , (+1) ◦ π 3 3 ] 28

  29. Arithmetical functions: definitions f ( n ) = n − 1 29

  30. Arithmetical functions: definitions f ( n ) = n − 1 f (0) = 0 f ( n + 1) = n 30

  31. Arithmetical functions: definitions f ( n ) = n − 1 f (0) = 0 g () = 0 g = 0 h = π 2 f ( n + 1) = n h ( n , k ) = n 1 f = PR [0, π 2 1 ] 31

  32. Arithmetical functions: definitions f ( n ) = n − 1 f = PR [0, π 2 1 ] f ( n , m ) = n − m 32

  33. Arithmetical functions: definitions f ( n ) = n − 1 f = PR [0, π 2 1 ] f ( n , m ) = n − m g = π 1 f ( n , 0) = n g ( n ) = n 1 h = ( − 1) ◦ π 3 f ( n , m + 1) = f ( n , m ) − 1 h ( n , m , k ) = k − 1 3 f = PR [ π 1 1 , ( − 1) ◦ π 3 3 ] 33

  34. Arithmetical functions: definitions f ( n ) = n − 1 f = PR [0, π 2 1 ] f ( n , m ) = n − m f = PR [ π 1 1 , ( − 1) ◦ π 3 3 ] f ( n , m ) = n ∗ m 34

  35. Arithmetical functions: definitions f ( n ) = n − 1 f = PR [0, π 2 1 ] f ( n , m ) = n − m f = PR [ π 1 1 , ( − 1) ◦ π 3 3 ] f ( n , m ) = n ∗ m f ( n , 0) = 0 g ( n ) = 0 g = 0 h = + ◦ ( π 3 3 , π 3 f ( n , m + 1) = f ( n , m ) + n h ( n , m , k ) = k + n 1 ) f = PR [0, + ◦ ( π 3 3 , π 3 1 )] 35

  36. Arithmetical functions: definitions f ( n ) = n − 1 f = PR [0, π 2 1 ] f ( n , m ) = n − m f = PR [ π 1 1 , ( − 1) ◦ π 3 3 ] f ( n , m ) = n ∗ m f = PR [0, + ◦ ( π 3 3 , π 3 1 )] 36

  37. Re-ordering/Omitting/Repeating Arguments Lemma The set of primitive recursive functions is closed under: • Re-ordering • Omitting • Repeating of arguments when composing functions. 37

  38. Re-ordering/Omitting/Repeating Arguments Lemma The set of primitive recursive functions is closed under: • Re-ordering • Omitting • Repeating of arguments when composing functions. Proof: (Idea) A tuple of arguments n ′ = ( n i 1 , . . . , n i k ) obtained from n = ( n 1 , . . . , n k ) by re-ordering, omitting or repeating components can be represented as: n ′ = ( π k i 1 ( n ), . . . , π k i k ( n )) 38

  39. Additional Arguments Lemma. Assume f : N k → N is primitive recursive. Then, for every p ∈ N , the function f ′ : N k × N p → N defined for every n ∈ N k and every m ∈ N p by: f ′ ( n , m ) = f ( n ) is primitive recursive. 39

Recommend


More recommend