introduction to theory of computability€¦ · the intuitive notion of effective computability for...

105
Introduction to Theory of Computability Nikolaj Popov and Tudor Jebelean Research Institute for Symbolic Computation, Linz {popov,jebelean}@risc.uni-linz.ac.at

Upload: others

Post on 17-Jul-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Introduction to Theory of Computability

Nikolaj Popov and Tudor Jebelean

Research Institute for Symbolic Computation, Linz

{popov,jebelean}@risc.uni-linz.ac.at

Page 2: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Outline

IntroductionMathematical Preliminaries

ComputabilityPrimitive Recursive FunctionsPartial FunctionsEnumeration of the Computable FunctionsDecidable and Semidecidable Sets

Conclusion and Discussions

Page 3: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Outline

IntroductionMathematical Preliminaries

ComputabilityPrimitive Recursive FunctionsPartial FunctionsEnumeration of the Computable FunctionsDecidable and Semidecidable Sets

Conclusion and Discussions

Page 4: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

IntroductionVarious notions of computation developed by Godel, Church,Turing and Kleene

The three computational models (recursion, λ-calculus, and Turingmachine) were shown to be equivalent (1934).

Church-Turing thesisAny real-world computation can be translated into an equivalentcomputation involving a Turing machine (or a program in anyreasonable programming language).

The intuitive notion of effective computability for functions andalgorithms is formally expressed by Turing machines or the lambdacalculus.

A function is computable, in the intuitive sense, if and only if it isTuring-computable.

Page 5: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

IntroductionVarious notions of computation developed by Godel, Church,Turing and Kleene

The three computational models (recursion, λ-calculus, and Turingmachine) were shown to be equivalent (1934).

Church-Turing thesisAny real-world computation can be translated into an equivalentcomputation involving a Turing machine (or a program in anyreasonable programming language).

The intuitive notion of effective computability for functions andalgorithms is formally expressed by Turing machines or the lambdacalculus.

A function is computable, in the intuitive sense, if and only if it isTuring-computable.

Page 6: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

IntroductionVarious notions of computation developed by Godel, Church,Turing and Kleene

The three computational models (recursion, λ-calculus, and Turingmachine) were shown to be equivalent (1934).

Church-Turing thesisAny real-world computation can be translated into an equivalentcomputation involving a Turing machine (or a program in anyreasonable programming language).

The intuitive notion of effective computability for functions andalgorithms is formally expressed by Turing machines or the lambdacalculus.

A function is computable, in the intuitive sense, if and only if it isTuring-computable.

Page 7: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

IntroductionVarious notions of computation developed by Godel, Church,Turing and Kleene

The three computational models (recursion, λ-calculus, and Turingmachine) were shown to be equivalent (1934).

Church-Turing thesisAny real-world computation can be translated into an equivalentcomputation involving a Turing machine (or a program in anyreasonable programming language).

The intuitive notion of effective computability for functions andalgorithms is formally expressed by Turing machines or the lambdacalculus.

A function is computable, in the intuitive sense, if and only if it isTuring-computable.

Page 8: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

IntroductionVarious notions of computation developed by Godel, Church,Turing and Kleene

The three computational models (recursion, λ-calculus, and Turingmachine) were shown to be equivalent (1934).

Church-Turing thesisAny real-world computation can be translated into an equivalentcomputation involving a Turing machine (or a program in anyreasonable programming language).

The intuitive notion of effective computability for functions andalgorithms is formally expressed by Turing machines or the lambdacalculus.

A function is computable, in the intuitive sense, if and only if it isTuring-computable.

Page 9: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Mathematical Preliminaries

Natural NumbersN = {0,1, . . . }

Sets{a1,a2, . . . ,an} the order of the elements is irrelevant

n-tuples(a1,a2, . . . ,an) = (b1,b2, . . . ,bn)iffa1 = b1, . . . ,an = bn

Operations on SetsA ∪ B = {a | a ∈ A or a ∈ B}A ∩ B = {a | a ∈ A and a ∈ B}A \ B = {a | a ∈ A and a 6∈ B}A = Nn \ A

Page 10: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Mathematical Preliminaries

Natural NumbersN = {0,1, . . . }

Sets{a1,a2, . . . ,an} the order of the elements is irrelevant

n-tuples(a1,a2, . . . ,an) = (b1,b2, . . . ,bn)iffa1 = b1, . . . ,an = bn

Operations on SetsA ∪ B = {a | a ∈ A or a ∈ B}A ∩ B = {a | a ∈ A and a ∈ B}A \ B = {a | a ∈ A and a 6∈ B}A = Nn \ A

Page 11: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Mathematical Preliminaries

Natural NumbersN = {0,1, . . . }

Sets{a1,a2, . . . ,an} the order of the elements is irrelevant

n-tuples(a1,a2, . . . ,an) = (b1,b2, . . . ,bn)iffa1 = b1, . . . ,an = bn

Operations on SetsA ∪ B = {a | a ∈ A or a ∈ B}A ∩ B = {a | a ∈ A and a ∈ B}A \ B = {a | a ∈ A and a 6∈ B}A = Nn \ A

Page 12: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Mathematical Preliminaries

Natural NumbersN = {0,1, . . . }

Sets{a1,a2, . . . ,an} the order of the elements is irrelevant

n-tuples(a1,a2, . . . ,an) = (b1,b2, . . . ,bn)iffa1 = b1, . . . ,an = bn

Operations on SetsA ∪ B = {a | a ∈ A or a ∈ B}A ∩ B = {a | a ∈ A and a ∈ B}A \ B = {a | a ∈ A and a 6∈ B}A = Nn \ A

Page 13: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Mathematical Preliminaries

Domain of a functionDom[f ] = {x | f [x ] is defined}

Range of a functionRan[f ] = {y | ∃x ∈ Dom[f ] ∧ f [x ] = y}

Graph of a functionGraph[f ] = {(x , y) | ∃x ∈ Dom[f ] ∧ f [x ] = y}

Partial equalityf [x ] ' y ⇔ (x , y) ∈ Graph[f ]

Page 14: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Mathematical Preliminaries

Domain of a functionDom[f ] = {x | f [x ] is defined}

Range of a functionRan[f ] = {y | ∃x ∈ Dom[f ] ∧ f [x ] = y}

Graph of a functionGraph[f ] = {(x , y) | ∃x ∈ Dom[f ] ∧ f [x ] = y}

Partial equalityf [x ] ' y ⇔ (x , y) ∈ Graph[f ]

Page 15: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Mathematical Preliminaries

Domain of a functionDom[f ] = {x | f [x ] is defined}

Range of a functionRan[f ] = {y | ∃x ∈ Dom[f ] ∧ f [x ] = y}

Graph of a functionGraph[f ] = {(x , y) | ∃x ∈ Dom[f ] ∧ f [x ] = y}

Partial equalityf [x ] ' y ⇔ (x , y) ∈ Graph[f ]

Page 16: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Mathematical Preliminaries

Domain of a functionDom[f ] = {x | f [x ] is defined}

Range of a functionRan[f ] = {y | ∃x ∈ Dom[f ] ∧ f [x ] = y}

Graph of a functionGraph[f ] = {(x , y) | ∃x ∈ Dom[f ] ∧ f [x ] = y}

Partial equalityf [x ] ' y ⇔ (x , y) ∈ Graph[f ]

Page 17: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Mathematical Preliminaries

f is definedf [x ] ↓ ⇔ (x , y) ∈ Graph[f ]

Partial equality 'f [x ] ' g[x ]ifff [x ] ↓ ⇔ g[x ] ↓f [x ] ↓ ⇒ f [x ] = g[x ]

f is computablef is computable function iffthere exists a program P which computes it

Page 18: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Mathematical Preliminaries

f is definedf [x ] ↓ ⇔ (x , y) ∈ Graph[f ]

Partial equality 'f [x ] ' g[x ]ifff [x ] ↓ ⇔ g[x ] ↓f [x ] ↓ ⇒ f [x ] = g[x ]

f is computablef is computable function iffthere exists a program P which computes it

Page 19: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Mathematical Preliminaries

f is definedf [x ] ↓ ⇔ (x , y) ∈ Graph[f ]

Partial equality 'f [x ] ' g[x ]ifff [x ] ↓ ⇔ g[x ] ↓f [x ] ↓ ⇒ f [x ] = g[x ]

f is computablef is computable function iffthere exists a program P which computes it

Page 20: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Outline

IntroductionMathematical Preliminaries

ComputabilityPrimitive Recursive FunctionsPartial FunctionsEnumeration of the Computable FunctionsDecidable and Semidecidable Sets

Conclusion and Discussions

Page 21: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Superposition

h is a superposition of f ,g1, . . . ,gk

h[x ] ' f [g1[x ], . . . ,gk [x ]]

TheoremGiven the computable functions f ,g1, . . . ,gk , thenh[x ] ' f [g1[x ], . . . ,gk [x ]] is computable function.

Superposition preserves computability.

Page 22: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Superposition

h is a superposition of f ,g1, . . . ,gk

h[x ] ' f [g1[x ], . . . ,gk [x ]]

TheoremGiven the computable functions f ,g1, . . . ,gk , thenh[x ] ' f [g1[x ], . . . ,gk [x ]] is computable function.

Superposition preserves computability.

Page 23: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Superposition

h is a superposition of f ,g1, . . . ,gk

h[x ] ' f [g1[x ], . . . ,gk [x ]]

TheoremGiven the computable functions f ,g1, . . . ,gk , thenh[x ] ' f [g1[x ], . . . ,gk [x ]] is computable function.

Superposition preserves computability.

Page 24: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Primitive Recursion

h is obtained by weak primitive recursion from g and a

h[x ] '{

a ⇐ x = 0g[x − 1,h[x − 1]] ⇐ o.w.

h is obtained by primitive recursion from f and g

h[x , y ] '{

f [x ] ⇐ y = 0g[x , y − 1,h[x , y − 1]] ⇐ o.w.

Primitive recursion preserves computability.

Page 25: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Primitive Recursion

h is obtained by weak primitive recursion from g and a

h[x ] '{

a ⇐ x = 0g[x − 1,h[x − 1]] ⇐ o.w.

h is obtained by primitive recursion from f and g

h[x , y ] '{

f [x ] ⇐ y = 0g[x , y − 1,h[x , y − 1]] ⇐ o.w.

Primitive recursion preserves computability.

Page 26: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Primitive Recursion

h is obtained by weak primitive recursion from g and a

h[x ] '{

a ⇐ x = 0g[x − 1,h[x − 1]] ⇐ o.w.

h is obtained by primitive recursion from f and g

h[x , y ] '{

f [x ] ⇐ y = 0g[x , y − 1,h[x , y − 1]] ⇐ o.w.

Primitive recursion preserves computability.

Page 27: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Primitive Recursive Functions

The basic functions are primitive recursiveO[x ] ' 0S[x ] ' x + 1Ini [x ] ' xi

The superposition is primitive recursiveIf f ,g1, . . . ,gk are primitive recursive, thenh[x ] ' f [g1[x ], . . . ,gk [x ]]

is primitive recursive.

The primitive recursion is primitive recursiveIf f and g are primitive recursive, then

h[x , y ] '{

f [x ] ⇐ y = 0g[x , y − 1,h[x , y − 1]] ⇐ o.w.

is primitive recursive.

Page 28: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Primitive Recursive Functions

The basic functions are primitive recursiveO[x ] ' 0S[x ] ' x + 1Ini [x ] ' xi

The superposition is primitive recursiveIf f ,g1, . . . ,gk are primitive recursive, thenh[x ] ' f [g1[x ], . . . ,gk [x ]]

is primitive recursive.

The primitive recursion is primitive recursiveIf f and g are primitive recursive, then

h[x , y ] '{

f [x ] ⇐ y = 0g[x , y − 1,h[x , y − 1]] ⇐ o.w.

is primitive recursive.

Page 29: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Primitive Recursive Functions

The basic functions are primitive recursiveO[x ] ' 0S[x ] ' x + 1Ini [x ] ' xi

The superposition is primitive recursiveIf f ,g1, . . . ,gk are primitive recursive, thenh[x ] ' f [g1[x ], . . . ,gk [x ]]

is primitive recursive.

The primitive recursion is primitive recursiveIf f and g are primitive recursive, then

h[x , y ] '{

f [x ] ⇐ y = 0g[x , y − 1,h[x , y − 1]] ⇐ o.w.

is primitive recursive.

Page 30: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Primitive Recursion

TheoremAll the primitive recursive functions are computable.

TheoremAll the primitive recursive functions are total.

Page 31: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Primitive Recursion

TheoremAll the primitive recursive functions are computable.

TheoremAll the primitive recursive functions are total.

Page 32: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Examples

Addition is primitive recursivef1[x , y ] ' x + y

f1[x , y ] '{

x ⇐ y = 0S[f1[x , y − 1]] ⇐ o.w.

Multiplication is primitive recursivef2[x , y ] ' x .y

f2[x , y ] '{

0 ⇐ y = 0x + f2[x , y − 1] ⇐ o.w.

Page 33: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Examples

Addition is primitive recursivef1[x , y ] ' x + y

f1[x , y ] '{

x ⇐ y = 0S[f1[x , y − 1]] ⇐ o.w.

Multiplication is primitive recursivef2[x , y ] ' x .y

f2[x , y ] '{

0 ⇐ y = 0x + f2[x , y − 1] ⇐ o.w.

Page 34: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Examples

Addition is primitive recursivef1[x , y ] ' x + y

f1[x , y ] '{

x ⇐ y = 0S[f1[x , y − 1]] ⇐ o.w.

Multiplication is primitive recursivef2[x , y ] ' x .y

f2[x , y ] '{

0 ⇐ y = 0x + f2[x , y − 1] ⇐ o.w.

Page 35: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Examples

Addition is primitive recursivef1[x , y ] ' x + y

f1[x , y ] '{

x ⇐ y = 0S[f1[x , y − 1]] ⇐ o.w.

Multiplication is primitive recursivef2[x , y ] ' x .y

f2[x , y ] '{

0 ⇐ y = 0x + f2[x , y − 1] ⇐ o.w.

Page 36: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

ExamplesPower is primitive recursivef3[x , y ] ' xy

f3[x , y ] '{

1 ⇐ y = 0x .f3[x , y − 1]] ⇐ o.w.

Subtraction-dot-one is primitive recursive

f4[x ] ' x−1 '{

0 ⇐ x = 0x − 1 ⇐ o.w.

f4[x ] '{

0 ⇐ x = 0I21 [x − 1, f4[x − 1]] ⇐ o.w.

Page 37: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

ExamplesPower is primitive recursivef3[x , y ] ' xy

f3[x , y ] '{

1 ⇐ y = 0x .f3[x , y − 1]] ⇐ o.w.

Subtraction-dot-one is primitive recursive

f4[x ] ' x−1 '{

0 ⇐ x = 0x − 1 ⇐ o.w.

f4[x ] '{

0 ⇐ x = 0I21 [x − 1, f4[x − 1]] ⇐ o.w.

Page 38: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

ExamplesPower is primitive recursivef3[x , y ] ' xy

f3[x , y ] '{

1 ⇐ y = 0x .f3[x , y − 1]] ⇐ o.w.

Subtraction-dot-one is primitive recursive

f4[x ] ' x−1 '{

0 ⇐ x = 0x − 1 ⇐ o.w.

f4[x ] '{

0 ⇐ x = 0I21 [x − 1, f4[x − 1]] ⇐ o.w.

Page 39: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

ExamplesPower is primitive recursivef3[x , y ] ' xy

f3[x , y ] '{

1 ⇐ y = 0x .f3[x , y − 1]] ⇐ o.w.

Subtraction-dot-one is primitive recursive

f4[x ] ' x−1 '{

0 ⇐ x = 0x − 1 ⇐ o.w.

f4[x ] '{

0 ⇐ x = 0I21 [x − 1, f4[x − 1]] ⇐ o.w.

Page 40: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

ExamplesSubtraction-dot is primitive recursive

f5[x , y ] ' x−y '{

0 ⇐ x < yx − y ⇐ o.w.

f5[x , y ] '{

x ⇐ y = 0f5[x , y − 1]−1 ⇐ o.w.

Factorial is primitive recursivef6[x ] ' x!

f6[x ] '{

1 ⇐ x = 0x .f6[x − 1]] ⇐ o.w.

Page 41: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

ExamplesSubtraction-dot is primitive recursive

f5[x , y ] ' x−y '{

0 ⇐ x < yx − y ⇐ o.w.

f5[x , y ] '{

x ⇐ y = 0f5[x , y − 1]−1 ⇐ o.w.

Factorial is primitive recursivef6[x ] ' x!

f6[x ] '{

1 ⇐ x = 0x .f6[x − 1]] ⇐ o.w.

Page 42: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

ExamplesSubtraction-dot is primitive recursive

f5[x , y ] ' x−y '{

0 ⇐ x < yx − y ⇐ o.w.

f5[x , y ] '{

x ⇐ y = 0f5[x , y − 1]−1 ⇐ o.w.

Factorial is primitive recursivef6[x ] ' x!

f6[x ] '{

1 ⇐ x = 0x .f6[x − 1]] ⇐ o.w.

Page 43: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

ExamplesSubtraction-dot is primitive recursive

f5[x , y ] ' x−y '{

0 ⇐ x < yx − y ⇐ o.w.

f5[x , y ] '{

x ⇐ y = 0f5[x , y − 1]−1 ⇐ o.w.

Factorial is primitive recursivef6[x ] ' x!

f6[x ] '{

1 ⇐ x = 0x .f6[x − 1]] ⇐ o.w.

Page 44: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

ExamplesSign is primitive recursive

sg[x ] '{

0 ⇐ x = 01 ⇐ o.w.

sg[x ] '{

0 ⇐ x = 0O[sg[x − 1]] + 1 ⇐ o.w.

Opposite-sign is primitive recursive

sg[x ] '{

1 ⇐ x = 00 ⇐ o.w.

sg[x ] '{

1 ⇐ x = 0O[sg[x − 1]] ⇐ o.w.

Page 45: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

ExamplesSign is primitive recursive

sg[x ] '{

0 ⇐ x = 01 ⇐ o.w.

sg[x ] '{

0 ⇐ x = 0O[sg[x − 1]] + 1 ⇐ o.w.

Opposite-sign is primitive recursive

sg[x ] '{

1 ⇐ x = 00 ⇐ o.w.

sg[x ] '{

1 ⇐ x = 0O[sg[x − 1]] ⇐ o.w.

Page 46: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

ExamplesSign is primitive recursive

sg[x ] '{

0 ⇐ x = 01 ⇐ o.w.

sg[x ] '{

0 ⇐ x = 0O[sg[x − 1]] + 1 ⇐ o.w.

Opposite-sign is primitive recursive

sg[x ] '{

1 ⇐ x = 00 ⇐ o.w.

sg[x ] '{

1 ⇐ x = 0O[sg[x − 1]] ⇐ o.w.

Page 47: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

ExamplesSign is primitive recursive

sg[x ] '{

0 ⇐ x = 01 ⇐ o.w.

sg[x ] '{

0 ⇐ x = 0O[sg[x − 1]] + 1 ⇐ o.w.

Opposite-sign is primitive recursive

sg[x ] '{

1 ⇐ x = 00 ⇐ o.w.

sg[x ] '{

1 ⇐ x = 0O[sg[x − 1]] ⇐ o.w.

Page 48: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Examples

Absolute value is primitive recursivemod [x , y ] ' |x − y |

mod [x , y ] ' (x−y) + (y−x)

Minimum is primitive recursivemin[x , y ]

min[x , y ] ' x−(x−y)

Maximum is primitive recursivemax [x , y ]

max [x , y ] ' x + (y−x)

Page 49: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Examples

Absolute value is primitive recursivemod [x , y ] ' |x − y |

mod [x , y ] ' (x−y) + (y−x)

Minimum is primitive recursivemin[x , y ]

min[x , y ] ' x−(x−y)

Maximum is primitive recursivemax [x , y ]

max [x , y ] ' x + (y−x)

Page 50: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Examples

Absolute value is primitive recursivemod [x , y ] ' |x − y |

mod [x , y ] ' (x−y) + (y−x)

Minimum is primitive recursivemin[x , y ]

min[x , y ] ' x−(x−y)

Maximum is primitive recursivemax [x , y ]

max [x , y ] ' x + (y−x)

Page 51: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Examples

Absolute value is primitive recursivemod [x , y ] ' |x − y |

mod [x , y ] ' (x−y) + (y−x)

Minimum is primitive recursivemin[x , y ]

min[x , y ] ' x−(x−y)

Maximum is primitive recursivemax [x , y ]

max [x , y ] ' x + (y−x)

Page 52: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Examples

Absolute value is primitive recursivemod [x , y ] ' |x − y |

mod [x , y ] ' (x−y) + (y−x)

Minimum is primitive recursivemin[x , y ]

min[x , y ] ' x−(x−y)

Maximum is primitive recursivemax [x , y ]

max [x , y ] ' x + (y−x)

Page 53: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Examples

Absolute value is primitive recursivemod [x , y ] ' |x − y |

mod [x , y ] ' (x−y) + (y−x)

Minimum is primitive recursivemin[x , y ]

min[x , y ] ' x−(x−y)

Maximum is primitive recursivemax [x , y ]

max [x , y ] ' x + (y−x)

Page 54: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Primitive recursion. Properties

Theorem If then elseLet f0, f1,g be primitive recursive.Then

h[x ] '{

f0[x ] ⇐ g[x ] = 0f1[x ] ⇐ o.w.

is primitive recursive.

proof:h[x ] ' sg[g[x ]].f0[x ] + sg[g[x ]].f1[x ]

Page 55: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Primitive recursion. Properties

Theorem If then elseLet f0, f1,g be primitive recursive.Then

h[x ] '{

f0[x ] ⇐ g[x ] = 0f1[x ] ⇐ o.w.

is primitive recursive.

proof:h[x ] ' sg[g[x ]].f0[x ] + sg[g[x ]].f1[x ]

Page 56: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Primitive recursion. Properties

Theorem If then1 . . . thenk elseLet f0, . . . , fk ,g0, . . . ,gk−1 be primitive recursive.Then

h[x ] '

f0[x ] ⇐ g0[x ] = 0f1[x ] ⇐ g0[x ] 6= 0 ∧ g1[x ] = 0. . .. . .fk [x ] ⇐ o.w.

is primitive recursive.

Page 57: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Partial Functions

While loopinput [x ]y := 0while f [x , y ] > 0 do y := y + 1return[y ]

g is obtained by minimization from fg[x ] ' yiff∀z < y(f [x , z] ↓ ∧ f [x , z] > 0)

f [x , y ] ' 0

g is obtained by minimization from fg[x ] ' µy [f [x , y ] = 0]

Page 58: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Partial Functions

While loopinput [x ]y := 0while f [x , y ] > 0 do y := y + 1return[y ]

g is obtained by minimization from fg[x ] ' yiff∀z < y(f [x , z] ↓ ∧ f [x , z] > 0)

f [x , y ] ' 0

g is obtained by minimization from fg[x ] ' µy [f [x , y ] = 0]

Page 59: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Partial Functions

While loopinput [x ]y := 0while f [x , y ] > 0 do y := y + 1return[y ]

g is obtained by minimization from fg[x ] ' yiff∀z < y(f [x , z] ↓ ∧ f [x , z] > 0)

f [x , y ] ' 0

g is obtained by minimization from fg[x ] ' µy [f [x , y ] = 0]

Page 60: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Partial Functions

The basic functions are partialO[x ] ' 0S[x ] ' x + 1Ini [x ] ' xi

The superposition is partialIf f ,g1, . . . ,gk are partial, thenh[x ] ' f [g1[x ], . . . ,gk [x ]]

is partial.

Page 61: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Partial Functions

The basic functions are partialO[x ] ' 0S[x ] ' x + 1Ini [x ] ' xi

The superposition is partialIf f ,g1, . . . ,gk are partial, thenh[x ] ' f [g1[x ], . . . ,gk [x ]]

is partial.

Page 62: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Partial Functions

The primitive recursion is partialIf f and g are partial, then

h[x , y ] '{

f [x ] ⇐ y = 0g[x , y ,h[x , y − 1]] ⇐ o.w.

is partial.

The minimization is partialIf f is partial, theng[x ] ' µy [f [x , y ] = 0]

is partial.

Page 63: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Partial Functions

The primitive recursion is partialIf f and g are partial, then

h[x , y ] '{

f [x ] ⇐ y = 0g[x , y ,h[x , y − 1]] ⇐ o.w.

is partial.

The minimization is partialIf f is partial, theng[x ] ' µy [f [x , y ] = 0]

is partial.

Page 64: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Partial Functions

TheoremAll the partial functions are computable.

Alternative DefinitionPartial functions = Computable functions.

Page 65: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Partial Functions

TheoremAll the partial functions are computable.

Alternative DefinitionPartial functions = Computable functions.

Page 66: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Examples

Subtraction is partial

f [x , y ] '{

x − y ⇐ x ≥ y↑ ⇐ o.w.

f [x , y ] ' µz[x + y = z]

Division is partial

g[x , y ] '{

x/y ⇐ ∃k(y .k = x)↑ ⇐ o.w.

g[x , y ] ' µk [k .y = x ]

Page 67: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Examples

Subtraction is partial

f [x , y ] '{

x − y ⇐ x ≥ y↑ ⇐ o.w.

f [x , y ] ' µz[x + y = z]

Division is partial

g[x , y ] '{

x/y ⇐ ∃k(y .k = x)↑ ⇐ o.w.

g[x , y ] ' µk [k .y = x ]

Page 68: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Examples

Subtraction is partial

f [x , y ] '{

x − y ⇐ x ≥ y↑ ⇐ o.w.

f [x , y ] ' µz[x + y = z]

Division is partial

g[x , y ] '{

x/y ⇐ ∃k(y .k = x)↑ ⇐ o.w.

g[x , y ] ' µk [k .y = x ]

Page 69: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Examples

Subtraction is partial

f [x , y ] '{

x − y ⇐ x ≥ y↑ ⇐ o.w.

f [x , y ] ' µz[x + y = z]

Division is partial

g[x , y ] '{

x/y ⇐ ∃k(y .k = x)↑ ⇐ o.w.

g[x , y ] ' µk [k .y = x ]

Page 70: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Enumeration of the computable functions

Enumeration = Encoding = Effective codding

I Uniqueness: each object has a unique codeI Totality: each natural number is a code of an objectI Effectiveness: For each object one can find algorithmically its

code and for each code (number) one can find its object.

Page 71: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Enumeration of the computable functions

Enumeration = Encoding = Effective codding

I Uniqueness: each object has a unique codeI Totality: each natural number is a code of an objectI Effectiveness: For each object one can find algorithmically its

code and for each code (number) one can find its object.

Page 72: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Enumeration of the computable functions

Enumeration = Encoding = Effective codding

I Uniqueness: each object has a unique codeI Totality: each natural number is a code of an objectI Effectiveness: For each object one can find algorithmically its

code and for each code (number) one can find its object.

Page 73: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Enumeration of the computable functions

Enumeration = Encoding = Effective codding

I Uniqueness: each object has a unique codeI Totality: each natural number is a code of an objectI Effectiveness: For each object one can find algorithmically its

code and for each code (number) one can find its object.

Page 74: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Enumeration of the computable functions

Enumeration = Encoding = Effective codding

I Uniqueness: each object has a unique codeI Totality: each natural number is a code of an objectI Effectiveness: For each object one can find algorithmically its

code and for each code (number) one can find its object.

Page 75: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Enumeration of the computable functions

I Let P0,P1, . . . ,Pn, . . .be a list of all the programs (on one variable), and0,1, . . . ,n, . . . be an effective codding of these programs.

I Each program corresponds to a computable function ϕ

I Let ϕ0, ϕ1, . . . , ϕn, . . .be a list of all the computable functions (on one variable), and0,1, . . . ,n, . . . be an effective codding of these functions.

Page 76: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Enumeration of the computable functions

I Let P0,P1, . . . ,Pn, . . .be a list of all the programs (on one variable), and0,1, . . . ,n, . . . be an effective codding of these programs.

I Each program corresponds to a computable function ϕ

I Let ϕ0, ϕ1, . . . , ϕn, . . .be a list of all the computable functions (on one variable), and0,1, . . . ,n, . . . be an effective codding of these functions.

Page 77: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Enumeration of the computable functions

I Let P0,P1, . . . ,Pn, . . .be a list of all the programs (on one variable), and0,1, . . . ,n, . . . be an effective codding of these programs.

I Each program corresponds to a computable function ϕ

I Let ϕ0, ϕ1, . . . , ϕn, . . .be a list of all the computable functions (on one variable), and0,1, . . . ,n, . . . be an effective codding of these functions.

Page 78: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Example

Total function which is not computable

f [x ] '{ϕx [x ] + 1 ⇐ ϕx [x ] ↓0 ⇐ o.w.

Assume f is computable. Then f = ϕa for some a.If a ∈ Dom[ϕa] then ϕa[a] ↓. Hence, f [a] = ϕa[a] = ϕa[a] + 1If a 6∈ Dom[ϕa] then ϕa[a] ↑. Hence, f [a] = ϕa[a] = 0, but ϕa[a] ↑

Page 79: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Example

Total function which is not computable

f [x ] '{ϕx [x ] + 1 ⇐ ϕx [x ] ↓0 ⇐ o.w.

Assume f is computable. Then f = ϕa for some a.If a ∈ Dom[ϕa] then ϕa[a] ↓. Hence, f [a] = ϕa[a] = ϕa[a] + 1If a 6∈ Dom[ϕa] then ϕa[a] ↑. Hence, f [a] = ϕa[a] = 0, but ϕa[a] ↑

Page 80: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Kleene’s S-m-n Theorem

S-m-n Theorem

For any n,m exists a primitive recursive function Smn , such that

for any a, x , y

ϕ(m+n)a [x , y ] ' ϕ(n)

Smn [a,x ][y ]

Property

Let F be a computable function. Then there exists a number e, suchthat,

F [e, x ] ' ϕe[x ]

Property

There exists a number e, such that,

e ' ϕe[x ]

Page 81: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Kleene’s S-m-n Theorem

S-m-n Theorem

For any n,m exists a primitive recursive function Smn , such that

for any a, x , y

ϕ(m+n)a [x , y ] ' ϕ(n)

Smn [a,x ][y ]

Property

Let F be a computable function. Then there exists a number e, suchthat,

F [e, x ] ' ϕe[x ]

Property

There exists a number e, such that,

e ' ϕe[x ]

Page 82: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Kleene’s S-m-n Theorem

S-m-n Theorem

For any n,m exists a primitive recursive function Smn , such that

for any a, x , y

ϕ(m+n)a [x , y ] ' ϕ(n)

Smn [a,x ][y ]

Property

Let F be a computable function. Then there exists a number e, suchthat,

F [e, x ] ' ϕe[x ]

Property

There exists a number e, such that,

e ' ϕe[x ]

Page 83: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Universal FunctionUniversal Function Theorem

The universal function

Φn[a, x ] ' ϕ(n)a [x ]

is computable.

Property

The class of all the total functions on n-variables does not have acomputable universal function.

proofAssume Φ[a, x ] is an universal function for the class of all the totalfunctions on one variable.

Let ϕ[x ] ' Φ[x , x ] + 1.

Since Φ is total, ϕ is also total and hence, there exists a, such that

ϕ[x ] ' Φ[a, x ].

ϕ[a] ' Φ[a,a], and also ϕ[a] ' Φ[a,a] + 1.

Page 84: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Universal FunctionUniversal Function Theorem

The universal function

Φn[a, x ] ' ϕ(n)a [x ]

is computable.

Property

The class of all the total functions on n-variables does not have acomputable universal function.

proofAssume Φ[a, x ] is an universal function for the class of all the totalfunctions on one variable.

Let ϕ[x ] ' Φ[x , x ] + 1.

Since Φ is total, ϕ is also total and hence, there exists a, such that

ϕ[x ] ' Φ[a, x ].

ϕ[a] ' Φ[a,a], and also ϕ[a] ' Φ[a,a] + 1.

Page 85: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Universal FunctionUniversal Function Theorem

The universal function

Φn[a, x ] ' ϕ(n)a [x ]

is computable.

Property

The class of all the total functions on n-variables does not have acomputable universal function.

proofAssume Φ[a, x ] is an universal function for the class of all the totalfunctions on one variable.

Let ϕ[x ] ' Φ[x , x ] + 1.

Since Φ is total, ϕ is also total and hence, there exists a, such that

ϕ[x ] ' Φ[a, x ].

ϕ[a] ' Φ[a,a], and also ϕ[a] ' Φ[a,a] + 1.

Page 86: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Universal FunctionUniversal Function Theorem

The universal function

Φn[a, x ] ' ϕ(n)a [x ]

is computable.

Property

The class of all the total functions on n-variables does not have acomputable universal function.

proofAssume Φ[a, x ] is an universal function for the class of all the totalfunctions on one variable.

Let ϕ[x ] ' Φ[x , x ] + 1.

Since Φ is total, ϕ is also total and hence, there exists a, such that

ϕ[x ] ' Φ[a, x ].

ϕ[a] ' Φ[a,a], and also ϕ[a] ' Φ[a,a] + 1.

Page 87: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Decidable and Semidecidable Sets A ⊆ Nn

Characteristic function of a set χA

χA[x ] '{

1 ⇐ x ∈ A0 ⇐ o.w.

Decidable SetA set A is decidable iff χA is computable.

Page 88: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Decidable and Semidecidable Sets A ⊆ Nn

Characteristic function of a set χA

χA[x ] '{

1 ⇐ x ∈ A0 ⇐ o.w.

Decidable SetA set A is decidable iff χA is computable.

Page 89: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Decidable and Semidecidable Sets A ⊆ Nn

Characteristic function of a set χA

χA[x ] '{

1 ⇐ x ∈ A0 ⇐ o.w.

Decidable SetA set A is decidable iff χA is computable.

Page 90: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Decidable and Semidecidable Sets A ⊆ Nn

Semicharacteristic function of a set CA

CA[x ] '{

1 ⇐ x ∈ A↑ ⇐ o.w.

Semidecidable SetA set A is semidecidable iff CA is computable.

Page 91: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Decidable and Semidecidable Sets A ⊆ Nn

Semicharacteristic function of a set CA

CA[x ] '{

1 ⇐ x ∈ A↑ ⇐ o.w.

Semidecidable SetA set A is semidecidable iff CA is computable.

Page 92: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Decidable and Semidecidable Sets A ⊆ Nn

TheoremIf A is decidable then it is also semidecidable.

TheoremIf A is decidable then A is also decidable.

TheoremIf A and B are decidable thenA ∪ B, A ∩ B and A\B are decidable.

TheoremIf A and B are semidecidable thenA ∪ B and A ∩ B are semidecidable.

Page 93: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Decidable and Semidecidable Sets A ⊆ Nn

TheoremIf A is decidable then it is also semidecidable.

TheoremIf A is decidable then A is also decidable.

TheoremIf A and B are decidable thenA ∪ B, A ∩ B and A\B are decidable.

TheoremIf A and B are semidecidable thenA ∪ B and A ∩ B are semidecidable.

Page 94: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Decidable and Semidecidable Sets A ⊆ Nn

TheoremIf A is decidable then it is also semidecidable.

TheoremIf A is decidable then A is also decidable.

TheoremIf A and B are decidable thenA ∪ B, A ∩ B and A\B are decidable.

TheoremIf A and B are semidecidable thenA ∪ B and A ∩ B are semidecidable.

Page 95: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Decidable and Semidecidable Sets A ⊆ Nn

TheoremIf A is decidable then it is also semidecidable.

TheoremIf A is decidable then A is also decidable.

TheoremIf A and B are decidable thenA ∪ B, A ∩ B and A\B are decidable.

TheoremIf A and B are semidecidable thenA ∪ B and A ∩ B are semidecidable.

Page 96: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Decidable and Semidecidable Sets A ⊆ Nn

TheoremA set A is semidecidable iff there exists a computable function ϕ,such that,A = Dom[ϕ]

Post TheoremA set A is decidable iff A and A are semidecidable.

Kleene Set KThe set K = {x | ϕx [x ] ↓} is called Kleene set.

TheoremK is semidecidable but not decidable.

Page 97: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Decidable and Semidecidable Sets A ⊆ Nn

TheoremA set A is semidecidable iff there exists a computable function ϕ,such that,A = Dom[ϕ]

Post TheoremA set A is decidable iff A and A are semidecidable.

Kleene Set KThe set K = {x | ϕx [x ] ↓} is called Kleene set.

TheoremK is semidecidable but not decidable.

Page 98: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Decidable and Semidecidable Sets A ⊆ Nn

TheoremA set A is semidecidable iff there exists a computable function ϕ,such that,A = Dom[ϕ]

Post TheoremA set A is decidable iff A and A are semidecidable.

Kleene Set KThe set K = {x | ϕx [x ] ↓} is called Kleene set.

TheoremK is semidecidable but not decidable.

Page 99: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Decidable and Semidecidable Sets A ⊆ Nn

TheoremA set A is semidecidable iff there exists a computable function ϕ,such that,A = Dom[ϕ]

Post TheoremA set A is decidable iff A and A are semidecidable.

Kleene Set KThe set K = {x | ϕx [x ] ↓} is called Kleene set.

TheoremK is semidecidable but not decidable.

Page 100: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Outline

IntroductionMathematical Preliminaries

ComputabilityPrimitive Recursive FunctionsPartial FunctionsEnumeration of the Computable FunctionsDecidable and Semidecidable Sets

Conclusion and Discussions

Page 101: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Conclusions and Discussion

Halting ProblemThere is no program P which may decide for an arbitrary program Qexecuted on arbitrary input x , whether Q will terminate on x or not.

P[Q, x ] '{

1 ⇐ Q[x ] ↓0 ⇐ o.w.

P[a, x ] '{

1 ⇐ ϕa[x ] ↓0 ⇐ o.w.

a ∈ K ⇔ ϕa[a] ↓ ⇔ P[a,a] = 1

a ∈ K ⇔ ϕa[a] ↑ ⇔ P[a,a] = 0Thus K is decidable, which is a contradiction.

Page 102: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Conclusions and Discussion

Halting ProblemThere is no program P which may decide for an arbitrary program Qexecuted on arbitrary input x , whether Q will terminate on x or not.

P[Q, x ] '{

1 ⇐ Q[x ] ↓0 ⇐ o.w.

P[a, x ] '{

1 ⇐ ϕa[x ] ↓0 ⇐ o.w.

a ∈ K ⇔ ϕa[a] ↓ ⇔ P[a,a] = 1

a ∈ K ⇔ ϕa[a] ↑ ⇔ P[a,a] = 0Thus K is decidable, which is a contradiction.

Page 103: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Conclusions and Discussion

Halting ProblemThere is no program P which may decide for an arbitrary program Qexecuted on arbitrary input x , whether Q will terminate on x or not.

P[Q, x ] '{

1 ⇐ Q[x ] ↓0 ⇐ o.w.

P[a, x ] '{

1 ⇐ ϕa[x ] ↓0 ⇐ o.w.

a ∈ K ⇔ ϕa[a] ↓ ⇔ P[a,a] = 1

a ∈ K ⇔ ϕa[a] ↑ ⇔ P[a,a] = 0Thus K is decidable, which is a contradiction.

Page 104: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Conclusions and Discussion

Halting ProblemThere is no program P which may decide for an arbitrary program Qexecuted on arbitrary input x , whether Q will terminate on x or not.

P[Q, x ] '{

1 ⇐ Q[x ] ↓0 ⇐ o.w.

P[a, x ] '{

1 ⇐ ϕa[x ] ↓0 ⇐ o.w.

a ∈ K ⇔ ϕa[a] ↓ ⇔ P[a,a] = 1

a ∈ K ⇔ ϕa[a] ↑ ⇔ P[a,a] = 0Thus K is decidable, which is a contradiction.

Page 105: Introduction to Theory of Computability€¦ · The intuitive notion of effective computability for functions and algorithms is formally expressed by Turing machines or the lambda

Conclusions and Discussion

Halting ProblemThere is no program P which may decide for an arbitrary program Qexecuted on arbitrary input x , whether Q will terminate on x or not.

P[Q, x ] '{

1 ⇐ Q[x ] ↓0 ⇐ o.w.

P[a, x ] '{

1 ⇐ ϕa[x ] ↓0 ⇐ o.w.

a ∈ K ⇔ ϕa[a] ↓ ⇔ P[a,a] = 1

a ∈ K ⇔ ϕa[a] ↑ ⇔ P[a,a] = 0Thus K is decidable, which is a contradiction.