Presented By : Abhinav Aggarwal CSI-IDD, V th yr Indian Institute of Technology Roorkee. Joint work with: Prof. Padam Kumar

Similar documents
Lecture 5: The Halting Problem. Michael Beeson

TURING S ORACLE : FROM ABSOLUTE TO RELATIVE COMPUTABILITY--AND BACK. Solomon Feferman Logic Seminar, Stanford, April 10, 2012

COMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS

MATH Iris Loeb.

Theory of Programming Languages COMP360

Lecture 9: More Lambda Calculus / Types

- M ::= v (M M) λv. M - Impure versions add constants, but not necessary! - Turing-complete. - true = λ u. λ v. u. - false = λ u. λ v.

CS 275 Automata and Formal Language Theory. First Problem of URMs. (a) Definition of the Turing Machine. III.3 (a) Definition of the Turing Machine

Introduction to the Lambda Calculus. Chris Lomont

5. Introduction to the Lambda Calculus. Oscar Nierstrasz

From the λ-calculus to Functional Programming Drew McDermott Posted

CSCI 270: Introduction to Algorithms and Theory of Computing Fall 2017 Prof: Leonard Adleman Scribe: Joseph Bebel

SECTION A (40 marks)

Programming Language Pragmatics

The Turing Machine. Unsolvable Problems. Undecidability. The Church-Turing Thesis (1936) Decision Problem. Decision Problems

Recursive Definitions, Fixed Points and the Combinator

Computer Sciences Department

Functional Languages. Hwansoo Han

05. Turing Machines and Spacetime. I. Turing Machines and Classical Computability.

MATHEMATICAL STRUCTURES FOR COMPUTER SCIENCE

Chapter 11 :: Functional Languages

Introduction to the Theory of Computation, Sipser, PWS, ISBN X, 1996

One of a number of approaches to a mathematical challenge at the time (1930): Constructibility

CISC 4090 Theory of Computation

(a) Give inductive definitions of the relations M N and M N of single-step and many-step β-reduction between λ-terms M and N. (You may assume the

CS 6110 S14 Lecture 1 Introduction 24 January 2014

Introduction to the λ-calculus

CS402 - Theory of Automata Glossary By

SOFTWARE ARCHITECTURE 6. LISP

ALGORITHMIC DECIDABILITY OF COMPUTER PROGRAM-FUNCTIONS LANGUAGE PROPERTIES. Nikolay Kosovskiy

Chapter 12. Computability Mechanizing Reasoning

Introduction to the l-calculus

Chapter 2 The Language PCF

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages. Lambda calculus

COMP 382: Reasoning about algorithms

Foundations. Yu Zhang. Acknowledgement: modified from Stanford CS242

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

Consider a description of arithmetic. It includes two equations that define the structural types of digit and operator:

Programs with infinite loops: from primitive recursive predicates to the arithmetic hierarchy

dynamically typed dynamically scoped

Material from Recitation 1

Source of Slides: Introduction to Automata Theory, Languages, and Computation By John E. Hopcroft, Rajeev Motwani and Jeffrey D.

Computer Science 21b: Structure and Interpretation of Computer Programs (Spring Term, 2004)

Theory of Languages and Automata

1.3. Conditional expressions To express case distinctions like

Recursion. Tjark Weber. Functional Programming 1. Based on notes by Sven-Olof Nyström. Tjark Weber (UU) Recursion 1 / 37

λ-calculus Lecture 1 Venanzio Capretta MGS Nottingham

Computability, Cantor s diagonalization, Russell s Paradox, Gödel s s Incompleteness, Turing Halting Problem.

CS 531: Notes II. January 31, 2014

Lecture T4: Computability

The Diagonal Method and Hypercomputation

Kurt Gödel and Computability Theory

CS 242. Fundamentals. Reading: See last slide

n λxy.x n y, [inc] [add] [mul] [exp] λn.λxy.x(nxy) λmn.m[inc]0 λmn.m([add]n)0 λmn.n([mul]m)1

We ve studied the main models and concepts of the theory of computation:

11/6/17. Outline. FP Foundations, Scheme. Imperative Languages. Functional Programming. Mathematical Foundations. Mathematical Foundations

CS21 Decidability and Tractability

What computers just cannot do. COS 116: 2/28/2008 Sanjeev Arora

A Theory of Parallel Computation The π-calculus

UNIT 14C The Limits of Computing: Non computable Functions. Problem Classifications

Theory of Computer Science. D2.1 Introduction. Theory of Computer Science. D2.2 LOOP Programs. D2.3 Syntactic Sugar. D2.

Functions as data. Massimo Merro. 9 November Massimo Merro The Lambda language 1 / 21

Formal Systems and their Applications

Simple Lisp. Alonzo Church. John McCarthy. Turing. David Hilbert, Jules Richard, G. G. Berry, Georg Cantor, Bertrand Russell, Kurt Gödel, Alan

The Eval/Apply Cycle Eval. Evaluation and universal machines. Examining the role of Eval. Eval from perspective of language designer

Organization of Programming Languages CS3200/5200N. Lecture 11

Introduction to the Lambda Calculus

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

Functional Programming. Big Picture. Design of Programming Languages

Course notes for Data Compression - 2 Kolmogorov complexity Fall 2005

CS61A Lecture 38. Robert Huang UC Berkeley April 17, 2013

Register Machines. Connecting evaluators to low level machine code

arxiv: v2 [cs.lo] 29 Sep 2015

λ calculus Function application Untyped λ-calculus - Basic Idea Terms, Variables, Syntax β reduction Advanced Formal Methods

Polymorphism and Type Inference

The Formal Semantics of Programming Languages An Introduction. Glynn Winskel. The MIT Press Cambridge, Massachusetts London, England

Computability Theory

axiomatic semantics involving logical rules for deriving relations between preconditions and postconditions.

Lambda Calculus and Computation

Last class. CS Principles of Programming Languages. Introduction. Outline

Functional Programming and λ Calculus. Amey Karkare Dept of CSE, IIT Kanpur

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016

COMP80 Lambda Calculus Programming Languages Slides Courtesy of Prof. Sam Guyer Tufts University Computer Science History Big ideas Examples:

Lambda Calculus. Variables and Functions. cs3723 1

Diagonalization. The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets?

Algorithm Analysis. Applied Algorithmics COMP526. Algorithm Analysis. Algorithm Analysis via experiments

Welcome to. Instructor Marc Pomplun CS 470/670. Introduction to Artificial Intelligence 1/26/2016. Spring Selectivity in Complex Scenes

Reducibilities relations with applications to symbolic dynamics

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

CS558 Programming Languages

COMP 4161 NICTA Advanced Course. Advanced Topics in Software Verification. Toby Murray, June Andronick, Gerwin Klein

Homework. Lecture 7: Parsers & Lambda Calculus. Rewrite Grammar. Problems

Typing Control. Chapter Conditionals

Functional Languages and Higher-Order Functions

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

Denotational Semantics. Domain Theory

Recursion. Lecture 6: More Lambda Calculus Programming. Fixed Points. Recursion

FUNKCIONÁLNÍ A LOGICKÉ PROGRAMOVÁNÍ 1. ÚVOD DO PŘEDMĚTU, LAMBDA CALCULUS

(Refer Slide Time: 1:36)

Part I. Historical Origins

Transcription:

Presented By : Abhinav Aggarwal CSI-IDD, V th yr Indian Institute of Technology Roorkee Joint work with: Prof. Padam Kumar A Seminar Presentation on Recursiveness, Computability and The Halting Problem

2 A quick glance ü Nature of computation ü Classical Recursion Theory Theory of functions and sets of natural numbers ü Goes back to Dedekind defining functions using recurrence ü Recursiveness Church, Gödel, Kleene, Turing, Post ü Effectively computable functions = Recursive functions ü Development of programming languages ü Termination of Programs

3 Recursiveness Primary references : [1] Odifreddi, P., Classical Recursion Theory: The Theory of Functions and Sets of Natural Numbers, Elsevier Science, 1980 [2] Post, Absolutely unsolvable problems and relatively undecidable propositions, The Undecidable, Raven Press, 1965, pp. 265 283 [3] Gödel, On undecidable propositions of formal mathematical systems, The Undecidable, Raven Press, 1965, pp. 41 81 [4] Kleene, General recursive functions of natural numbers, The Undecidable, Raven Press, 1965, pp. 237 252 [5] Turing, A. M., On computable numbers with an application to the Entscheidungsproblem, Proc. London Math. Soc. 42, 1936, pp. 230 265

4 A new word ü Recursion, recurrence perhaps they were already taken ü Closer look at functions from ω to ω ω = { 0,1,2,3,... } ü Characterization of natural numbers Dedekind s formalization 0, S(0), S(S(0)), S(S(S(0))), ü Formal arithmetic models loads of axioms Initial Functions

5 Where does it take us? ü Dedekind s Induction Principle ü Least Number Principle ü Primitive Recursive functions ü µ-recursive functions ü Class of recursive functions

6 Examples ü Commonly encountered functions are recursive bounded sum, bounded product, factorial, prime number generation f(x,y) = x + y ü Coding (numbering) of the entities of a set Countability is recursive Cantor s coding of the plane of ordered pairs

7 Curious Bob ü Is every function recursive? No ü What about mathematical functions? - Yes ü But where is the re-occurrence? - In the initial functions ü OK. But why can t I compute them directly, instead of using recursion? Formal arithmetic ü How is it useful at all? Doesn t it complicate things? It gives them a structure Facilitates generalization ü Fine. But how do I know if this will work? Do you have a magic wand? - Computability

8 Computability Primary references : [1] Odifreddi, P., Classical Recursion Theory: The Theory of Functions and Sets of Natural Numbers, Elsevier Science, 1980 [2] Soare, R. I., Computability and Recursion, 10 th Int. Cong. for Logic, Methodology and Philosophy of Science, Sec. 3 : Recursion Theory and Constructivism, 1995

9 A function is computable (also called effectively calculable or simply calculable ) if it can be calculated by a finite mechanical procedure. f ( x) = f 1 x = 0 ( ) +1 x > 0 x 1 g( x) = g x +1 1 x = 0 ( ) +1 x > 0 Can we devise an algorithm for the given function (task) and check if it can be implemented using the resources (theoretical or practical) available at that time? Code C/C++, Java, PASCAL, Haskell, Scheme, LISP Algorithm Flowcharts, Pseudocode, Textual Description Mathematical Models Turing Machine, Lambda expression

10 The first thought ü Written Calculations on a sheet of paper ü Perceive what is written by reading it ü Make a decision for what to write next ü Read, Think, Write Turing Machine A function is Turing Machine Computable if there is a Turing Machine which reaches a final configuration with f(x) represented in unary notation on its tape, when started with only x in unary notation on the tape. ü Machine-dependent languages

11 I 1 1 ( x) = x

12 The next step ü Machine independent abstract core ü Emphasis on sequence of steps for a general input ü Making a flowchart for the process involved Flowchart Program A function is Flowchart Computable if there exists a flowchart which modifies the input variables x and exits (halts) when the output variable takes the value f(x). ü General Purpose Simulation Systems ü For-programs and While-programs ü Algol, Pascal, Basic, Fortran

13

14 A higher vision ü Can functions act as arguments? First class citizens ü No distinction between functions and data λ - abstractions ü Any other evidence? Gödel Numbering Enter Church n λ f.λx.f ( n) ( x) Church Numerals A function f is λ-definable if there is a λ-term F such that f(a) = b holds if and only if F(a) = b is true, upto β-reductions. Functional Programming Languages LISP, Scheme, Haskell, SML, Scala

15 Putting it all together ü Church s Thesis Every computable function is recursive ü Post - General recusiveness = Effective computability ü Absolute unsolvability of functions ü Restricted versions of computability Polynomial Time Computability ü Complexity Classes ü Equivalence and Inclusion relations between complexity classes ü Effective optimized computability

16 Extending a little ü Defining functions for only some inputs Partial Recursive Functions ü Kleene Recursive functions are exactly the partial recursive functions which happen to be total ü Index e to every p.r.f Enumeration Theorem ü Data can be effectively incorporated into a program and can effectively code programs as well Parametrization (Smn) Theorem ü Kleene Universal Partial Recursive Function, f(e,x) = g(x) ü Universal Turing Machine computes f ü Recursively enumerable relations domain of a p.r.f ü f(e) = e - Quines (Kleene s Fixpoint Theorem such an e exists) eval s= print eval s= ;p s

17 Curious Bob II ü Wait a minute! So many definitions? They are all equivalent ü How can if there exists be verified? No general way ü Is there any way? Write programs! Hire coders! Google! ü What if my code never stops running? :P ü Can I check if this would happen? Sometimes ü Come on! Sometimes won t suffice. In general? No ü Who says that? Alan Turing ü Is he the authority here? Yes, he is known as the Father of Computer Science

18 The Halting Problem Primary references : [1] Floyd, R. W., Assigning meaning to programs, American Math. Soc. 1967, pp. 19 32 [2] Aho, A. V., Ullman J. D., The theory of parsing, translation and compiling, Vol. 2, Prentice Hall, 1973 [3] Katz, S., Manna, Z., A closer look at termination, Acta Informatica 5, 1975, pp. 333 352 [4] Manna Z., Dershowitz, N., Proving termination with multiset orderings, Memo AIM-310, Stanford Intelligence Laboratory, 1978 [5] Blass, A., Gurevich, Y., Proving termination and well-partial orderings, ACM Transactions on computational logic, 2006, pp. 1 26

19 The actual problem ü Optimized resource management and determinism of events ü Program must halt for a given set of inputs ü Existence of infinite computations in a program ü Generalized Halting Problem is algorithmically unsolvable Undecidable ü Solving restricted instances

20 Known approaches ü Floyd s approach No infinitely-descending-chain ü Loop Approach ü Exit Approach ü Burstall s Approach ü Well-partial orderings ü Multiset orderings

21 Floyd s Approach

22 Loop Approach

23 Exit Approach

24 Structural Induction

25 Multiset Ordering Using well-founded set ω Using multiset theory

26