42
CS_226 Computability Theory http://www.cs.swan.ac.uk/csetzer/lectures/computability/ 06/index.html Course Notes, Lent Term 2007 Anton Setzer (Dept. of Computer Science, Swansea) http://www.cs.swan.ac.uk/csetzer/index.html Lent Term 2007 CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-1

CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

  • Upload
    others

  • View
    7

  • Download
    9

Embed Size (px)

Citation preview

Page 1: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

CS_226 Computability Theoryhttp://www.cs.swan.ac.uk/∼csetzer/lectures/computability/

06/index.html

Course Notes, Lent Term 2007

Anton Setzer(Dept. of Computer Science, Swansea)

http://www.cs.swan.ac.uk/∼csetzer/index.html

Lent Term 2007

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-1

Page 2: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

The Topic of Computability TheoryA

:::::::::::::::

computable::::::::::::

function is a function

f : A → B

such that there is a mechanical procedure forcomputing for every a ∈ A the result f(a) ∈ B.

::::::::::::::::::

Computability:::::::::

theory is the study of computablefunctions.

In computablitity theory we explore the limits of thenotion of computability.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-2

Page 3: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

ExamplesDefine exp

:::

: N → N, exp(n) := 2n,

where N = {0, 1, 2, . . .}.exp is computable.However, can we really computeexp(10000000000000000000000000000000000)?

Let String:::::::

be the set of strings of ASCII symbols.

Define a function check::::::

: String → {0, 1} by

check(p) :=

1 if p is a syntactically correctJava program,

0 otherwise.

Is check computable or not?

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-3

Page 4: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Remark on VariablesIn this lecture I will often use i, j, k, l, m, n for variablesdenoting natural numbers.

I will often use p, q and some others for variablesdenoting programs.

I will use z for integers.

Other letters might be used as well for variables.

These conventions are not treated very strictly.Especially when running out of letters.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-4

Page 5: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Examples (Cont.)Define a function terminate

:::::::::::: String → {0, 1},

terminate(p) :=

1 if p is a syntactically correctJava program with no input and outputs,which terminates;

0 otherwise.

Is terminate computable?

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-5

Page 6: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Examples (Cont.)Define a function issortingfun

::::::::::::::

: String → {0, 1},

issortingfun(p) :=

1 if p is a syntactically correctJava program, which has as inputa list and returns a sorted list,

0 otherwise.

Is issortingfun computable?

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-6

Page 7: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

ExplanationAssume issortingfun were computable.

Then we can construct (compute) a program whichcomputes terminate as follows:

Assume as input a string p.Check whether it is a syntactically correct Javaprogram with no input and outputs.If no, terminate(p) = 0, so return 0.Otherwise, create a program which is a potentialsorting function as follows:

It takes as input a list l.Then this program runs p.If p has terminated, then it runs a known sortingfunction on l, and returns the result.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-6a

Page 8: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

ExplanationLet the resulting program (which depends on p) beq(p).If p terminates, then q(p) will be a sorting function, soissortingfun(q(p)) = 1 = terminate(p).If p does not terminate, then q(p) does not terminateon any input, so issortingfun(q(p)) = 0 = terminate(p).Our program returns now issortingfun(q(p)) which isthe result of terminate(p).

So we have obtained by using a program for issortingfun

a program which computes terminate.

But terminate is non-computable, therefore issortingfun

cannot be computable.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-6b

Page 9: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Problems in ComputabilityIn order to understand and answer the questions we have to

Give a precise definition of what computable means.That will be a mathematical definition .Such a notion is particularly important for showingthat certain functions are non-computable.

Then provide evidence that the definition of“computable” is the correct one.

That will be a philosophical argument .

Develop methods for proving that certain functions arecomputable or non-computable.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-7

Page 10: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Three AreasThree Areas are involved in computability theory.

Mathematics.Precise definition of computability.Analysis of the concept.

Philosophy.Validation that notions found are the correct ones.

Computer science.Study of relationship between these concepts andcomputing in the real world.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-8

Page 11: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Questions Related to The AboveGiven a function f : A → B, which can be computed,can it be done effectively?(Complexity theory .)

Can the task of deciding a given problem P1 bereduced to deciding another problem P2?(Reducibility theory ).

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-9

Page 12: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

More Advanced QuestionsThe following is beyond the scope of this module.

Can the notion of computability be extended tocomputations on infinite objects(e.g. streams of data, real numbers,higher typeoperations)?(Higher and abstract computability theory ).

What is the relationship between computing (producingactions, data etc.) and proving.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-10

Page 13: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

IdealisationIn computability theory, one usually abstracts fromlimitations on

time and

space.

A problem will be computable, if it can be solved on an ide-

alised computer, even if it the computation would take longer

than the life time of the universe.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-11

Page 14: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

History of Computability TheoryGottfried Wilhelmvon Leibnitz (1646 – 1716)

Built a first mechanicalcalculator.

Was thinking about amachine formanipulating symbols inorder to determine truthvalues of mathematicalstatements.

Noticed that this requiresthe definition of a preciseformal language.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-12

Page 15: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

History of Computability Theory

David Hilbert(1862 – 1943)

Poses 1900 in hisfamous list “Math-ematical Problems”as 10th problem todecide Diophantineequations.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-13

Page 16: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

History of Computability TheoryHilbert (1928)

Poses the “Entscheidungsproblem” (German fordecision problem).

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-14

Page 17: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

EntscheidungsproblemHilbert refers to a theory developed by him forformalising mathematical proofs.

Assumes that it is complete and sound, i.e. that itshows exactly all “true” formulae.

Hilbert asks, whether there is an algorithm, whichdecides whether a mathematical formula is aconsequence of his theory.

Assuming his theory is complete and sound, such analgorithm would decide the truth of allmathematical formulae.

So we can say that Hilbert asked, whether there is analgorithm which decides the truth of all mathematicalformulae.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-15

Page 18: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

EntscheidungsproblemThe question, whether there is an algorithm for decidingthe truth of mathematical formulae is later called the“Entscheidungsproblem” (or “decision problem”).

Entscheidungsproblem became one of the few Germanwords which have entered the English language.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-16

Page 19: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

History of Computability TheoryGödel, Kleene, Post, Turing (1930s)Introduce different models of computation and provethat they all define the same class of computablefunctions.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-17

Page 20: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

History of Computability Theory

Kurt Gödel (1906 – 1978)Introduced the recursive functionsin his 1933 - 34 Princeton lectures.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-18

Page 21: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

History of Computability Theory

Stephen Cole Kleene(1909 – 1994)Probably the most influentialcomputability theoretist up to now.Introduced the partial recursivefunctions.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-19

Page 22: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

History of Computability Theory

Emil Post(1897 – 1954)Introduced the Post problems.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-20

Page 23: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

History of Computability Theory

Alan Mathison Turing(1912 – 1954)Introduced the Turing machine.Proved the undecidabilityof the Turing-Halting problem.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-21

Page 24: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

History of Computability TheoryGödel (1931) proves in his first incompletenesstheorem:

Every reasonable primitive-recursive theory (thetheorem generalises to recursive i.e. computabletheories) is incomplete, i.e. there is a formulas.t. neither the formula nor its negation is provable.Therefore no such theory proves all true formulae.

Recursive functions will be later shown to be thecomputable functions.

Once this is established, it follows that the“Entscheidungsproblem” is unsolvable – an algorithmfor deciding the truth of mathematical formulae wouldgive rise to a complete and sound theory fulfillingGödel’s conditions.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-22

Page 25: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

History of Computability TheoryChurch, Turing (1936) postulate that the models ofcomputation established above define exactly the set ofall computable functions (Church-Turing thesis).

Both established undecidable problems and concludedthat the Entscheidungsproblem is unsolvable evenfor a class of very simple formulae .

Church shows the undecidability of equality in theλ-calculus.Turing shows the unsolvability of the halting problem.

It is undecidable whether a Turing machine (andby the Church-Turing thesis equivalently anynon-interactive computer program) eventuallystops.That problem turns out to be the most importantundecidable problem.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-23

Page 26: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

History of Computability Theory

Alonzo Church (1903 - 1995)

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-24

Page 27: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

History of Computability TheoryPost (1944) studies degrees of unsolvability. This is thebirth of degree theory.

In degree theory one devides problems into groups(“

::::::::::

degrees ”) of problems, which are reducible to eachother.

:::::::::::::

Reducible means essentially “relative computable”.

Degrees can be ordered by using reducibility asordering.

The question in degree theory is: what is the structureof degrees?

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-25

Page 28: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Degrees

computable

Degree

Reducible to

problems

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-26

Page 29: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

History of Computability Theory

Yuri VladimirovichMatiyasevich ( ∗ 1947)

Solves 1970 Hilbert’s10th problem nega-tively: The solvabilityof Diophantine equa-tions is undecidable.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-27

Page 30: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

History of Computability Theory

Stephen Cook(Toronto)

Cook (1971) intro-duces the complexityclasses P and NPand formulates theproblem, whetherP 6= NP.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-28

Page 31: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Current StateThe problem P 6= NP is still open. Complexity theoryhas become a big research area.

Intensive study of computability on infinite objects (e.g.real numbers, higher type functionals) is carried out(e.g. U. Berger, Jens Blanck and J. Tucker in Swansea).

Computability on inductive and co-inductive data typesis studied.

Research on program synthesis from formal proofs (e.g.U. Berger and M. Seisenberger in Swansea).

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29

Page 32: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Current StateConcurrent and game-theoretic models of computationare developed (e.g. Prof. Moller in Swansea).

Automata theory further developed.

Alternative models of computation are studied(quantum computing, genetic algorithms).

· · ·

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-30

Page 33: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Name “Computability Theory”The original name was recursion theory, since themathematical concept claimed to cover exactly thecomputable functions is called “recursive function”.

This name was changed to computability theory duringthe last 10 years.

Many books still have the title “recursion theory”.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-31

Page 34: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Administrative IssuesLecturer :Dr. A. SetzerDept. of Computer ScienceUniversity of Wales SwanseaSingleton ParkSA2 8PPUKRoom: Room 211, Faraday BuildingTel.: (01792) 513368

Fax: (01792) 295651

Email: [email protected]

Home page: http://www.cs.swan.ac.uk/∼csetzer/index.html

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-32

Page 35: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Assessment:80% Exam.

20% Coursework.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-33

Page 36: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Course Home PageLocated athttp://www.cs.swan.ac.uk/∼csetzer/lectures/computability/06/index.html

There is an open version,

and a password protected version.

The password is _____________.

Errors in the notes will be corrected on the slides andnoted on the list of errata.

In order to reduce plagarism, coursework and solutionsto coursework will not be made available in electronicform (e.g. on this web site).

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-34

Page 37: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Plan for this Module1. Introduction.

2. Encoding of data types into N.

3. The Unlimited Register Machine (URM) andthe halting problem.

4. Turing machines.

5. The primitive recursive functions.

6. The recursive functions and the equivalence theorem.

7. The recursion theorem.

8. Semi computable predicates.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-35

Page 38: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Aims of this ModuleTo become familiar with fundamental models ofcomputation and the relationship between them.

To develop an appreciation for the limits of computationand to learn techniques for recognising unsolvable orunfeasible computational problems.

To understand the historic and philosophicalbackground of computability theory.

To be aware of the impact of the fundamental results ofcomputability theory to areas of computer science suchas software engineering and artificial intelligence.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-36

Page 39: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

Aims of this ModuleTo understand the close connection betweencomputability theory and logic.

To be aware of recent concepts and advances incomputability theory.

To learn fundamental proving techniques like inductionand diagonalisation.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-37

Page 40: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

LiteratureCutland: Computability. Cambridge University Press,1980.

Main text book.

Thomas A. Sudkamp: Languages and machines.Addison-Wesley 2006.

George S. Boolos, Richard C. Jeffrey, John Burgess:Computability and logic. 4th Ed. Cambridge Univ.Press, 2002

Lewis/Papadimitriou:Elements of the Theory of Computation. Prentice Hall,1981.

Sipser: Introduction to the Theory of Computation.PWS Publishing, 1997.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-38

Page 41: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

LiteratureMartin: Introduction to Languages and the Theory ofComputation. 3rd Edition, McGraw Hill, 2003.

Criticized in Amazon Reviews. But several editions.

John E. Hopcroft, R. Motwani and J. Ullman:Introduction to Automata Theory, Languages, andComputation. Addison Wesley, 2nd Ed, 2001.

Excellent book, mainly on automata theory contextfree grammars.But covers Turing machines, decidability questionsas well.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-39

Page 42: CS 226 Computability Theorycsetzer/lectures/computability/06/cpslidesdraft… · CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-29. Current State Concurrent and game-theoretic

LiteratureVelleman: How To Prove It. Cambridge UniversityPress, 1994.

Book on basic mathematics.Useful if you need to fresh up your mathematicalknowledge.

Griffor (Ed.): Handbook of Computability Theory. NorthHolland, 1999.

Expensive. Postgraduate level.

CS 226 Computability Theory, Lent Term 2007, Sect. 1 1-40