Dr. Muhammed Al-Mulhem 1ICS535-101 ICS 535 Design and Implementation of Programming Languages Part 1 Computability (Chapter 2) ICS 535 Design and Implementation.

Slides:



Advertisements
Similar presentations
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 17: ProvingUndecidability.
Advertisements

1 Turing Machines and Equivalent Models Section 13.2 The Church-Turing Thesis.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
1 Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
More Turing Machines Sipser 3.2 (pages ). CS 311 Fall Multitape Turing Machines Formally, we need only change the transition function to.
More Turing Machines Sipser 3.2 (pages ).
CS5371 Theory of Computation
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Operational Semantics ICS.
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Fall 2008.
Fall 2005Costas Busch - RPI1 CSCI-2400 Models of Computation.
Linear Bounded Automata LBAs
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
Programming Languages
CS 390 Introduction to Theoretical Computer Science.
1 Unit 1: Automata Theory and Formal Languages Readings 1, 2.2, 2.3.
Complexity theory and combinatorial optimization Class #2 – 17 th of March …. where we deal with decision problems, finite automata, Turing machines pink.
1 Chapter 1 Automata: the Methods & the Madness Angkor Wat, Cambodia.
CSCI 2670 Introduction to Theory of Computing November 4, 2004.
1 Computability Five lectures. Slides available from my web page There is some formality, but it is gentle,
Alan Turing WWII code-breaker mathematical proof of ‘Turing machines’ …in particular, “Universal Turing machine” laid foundations of computer science father.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
1 Section 13.2 The Church-Turing Thesis The Church-Turing Thesis: Anything that is intuitively computable can be be computed by a Turing machine. It is.
Decidable languages Section 4.1 CSC 4170 Theory of Computation.
Models of Computation. Computation: Computation is a general term for any type of information processing information processing CPU memory.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Lecture # 22. PDA of language {a n b n : n=0,1,2,3, …}
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
D E C I D A B I L I T Y 1. 2 Objectives To investigate the power of algorithms to solve problems. To explore the limits of algorithmic solvability. To.
Computable Functions John Mitchell CS 242 Reading: Chapter 2.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
Lecture 16b Turing Machines Topics: Closure Properties of Context Free Languages Cocke-Younger-Kasimi Parsing Algorithm June 23, 2015 CSCE 355 Foundations.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 5 Reducibility Some slides are in courtesy.
Undecidability and The Halting Problem
Chapter 9 Turing Machines What would happen if we change the stack in Pushdown Automata into some other storage device? Truing Machines, which maintains.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Consider problems with answer YES or NO Examples: Does Machine have three states ? Is string a binary.
Turing Machines- Cont. Theory of Computation Lecture 11 Tasneem Ghnaimat.
Theory of Computation. Introduction to The Course Lectures: Room ( Sun. & Tue.: 8 am – 9:30 am) Instructor: Dr. Ayman Srour (Ph.D. in Computer Science).
Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat.
Finite Automata.
Formal Foundations-II [Theory of Automata]
CIS Automata and Formal Languages – Pei Wang
Introduction to the Theory of Computation
CIS Automata and Formal Languages – Pei Wang
Review : Theory of Computation
Linear Bounded Automata LBAs
Reductions Costas Busch - LSU.
Turing Machines.
G. Pullaiah College of Engineering and Technology
Pumping Lemma Revisited
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Undecidable Problems (unsolvable problems)
CSCE 411 Design and Analysis of Algorithms
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
CSCI-2400 Models of Computation Costas Busch - RPI.
Non-Deterministic Finite Automata
Chapter # 5 by Cohen (Cont…)
CIS Automata and Formal Languages – Pei Wang
Presentation transcript:

Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Computability (Chapter 2) ICS 535 Design and Implementation of Programming Languages Part 1 Computability (Chapter 2)

Dr. Muhammed Al-Mulhem 2ICS Computability From a mathematical point of view, a computer program defines a function. From a mathematical point of view, a computer program defines a function. The output of a program is computed as a function of: The output of a program is computed as a function of: The program input, and The program input, and The state of the machine before the program starts. The state of the machine before the program starts. In practice In practice Some mathematical functions are computable while others are not. Some mathematical functions are computable while others are not. The goal of computability theory is to answer the question: The goal of computability theory is to answer the question: Can we define a formal sense in which we can understand how hard a particular problem is to solve on a computer?

Dr. Muhammed Al-Mulhem 3ICS Computability In order to answer the previous question of computability theory, it is necessary to define in a formal way what a computer is. In order to answer the previous question of computability theory, it is necessary to define in a formal way what a computer is. Models of computation includes: Models of computation includes: Deterministic finite automaton (DFA) Deterministic finite automaton (DFA) Pushdown automaton Pushdown automaton Turing machine Turing machine With these computational models in hand, we can determine what their limits are. That is, what classes of languages can they accept? With these computational models in hand, we can determine what their limits are. That is, what classes of languages can they accept?

Dr. Muhammed Al-Mulhem 4ICS Computability A central question of computer science is to address the limits of computing devices by understanding the problems we can solve using them. A central question of computer science is to address the limits of computing devices by understanding the problems we can solve using them. In all general-purpose programming languages, it is possible to write a program for each function that is computable in principle. In all general-purpose programming languages, it is possible to write a program for each function that is computable in principle. However, the limits of computability also limit the kinds of things that programming language implementation can do. However, the limits of computability also limit the kinds of things that programming language implementation can do.

Dr. Muhammed Al-Mulhem 5ICS Limits Value of an expression may be undefined Value of an expression may be undefined Undefined operation, e.g., division by zero Undefined operation, e.g., division by zero 3/0 has no value 3/0 has no value Implementation may halt with error condition Implementation may halt with error condition Non-termination Non-termination f(x) = if (x == 0) then 1 else f(x-2) f(x) = if (x == 0) then 1 else f(x-2) This is a partial function: not defined on all arguments This is a partial function: not defined on all arguments Cannot be detected at compile-time; this is halting problem Cannot be detected at compile-time; this is halting problem These two cases are “Mathematically” equivalent but “Operationally” different These two cases are “Mathematically” equivalent but “Operationally” different

Dr. Muhammed Al-Mulhem 6ICS Partial and Total Functions Total function: f(x) has a value for every x Total function: f(x) has a value for every x Partial function: g(x) does not have a value for every x Partial function: g(x) does not have a value for every x x g(x) f(x)

Dr. Muhammed Al-Mulhem 7ICS Partial and Total Functions Total function f:A  B is a set of ordered pairs  x,y  satisfying the following conditions: Total function f:A  B is a set of ordered pairs  x,y  satisfying the following conditions: For every x  A, there is some y  B with  x,y   f (total) For every x  A, there is some y  B with  x,y   f (total) If  x,y   f and  x,z   f then y=z (single-valued) If  x,y   f and  x,z   f then y=z (single-valued) Partial function f:A  B is a set of ordered pairs  x,y  satisfying the following condition: Partial function f:A  B is a set of ordered pairs  x,y  satisfying the following condition: If  x,y   f and  x,z   f then y=z (single-valued) If  x,y   f and  x,z   f then y=z (single-valued) Programs define partial functions for two reasons Programs define partial functions for two reasons Undefined operations (like division) Undefined operations (like division) Non-termination Non-termination f(x) = if (x==0) then 1 else f(x-2) f(x) = if (x==0) then 1 else f(x-2)

Dr. Muhammed Al-Mulhem 8ICS Computability Definition Definition Function f is computable if some program P computes it: For any input x, the computation P(x) halts with output f(x)

Dr. Muhammed Al-Mulhem 9ICS Halting function Decide whether program halts on input Decide whether program halts on input Given program P and input x to P, Given program P and input x to P, Halt (P,x) = Halt (P,x) = Fact: There is no program for Halt Fact: There is no program for Halt Halts if P(x) halts Does not halt otherwise

Dr. Muhammed Al-Mulhem 10ICS Undecidability of the halting problem - Proof Read the book Page Read the book Page

Dr. Muhammed Al-Mulhem 11ICS Main points about computability Some functions are computable, some are not Some functions are computable, some are not Halting problem Halting problem Programming language implementation Programming language implementation Can report error if program result is undefined due to division by zero, or other undefined basic operation Can report error if program result is undefined due to division by zero, or other undefined basic operation Cannot report error if program will not terminate Cannot report error if program will not terminate