Objective and Subjective Specifications

Size: px
Start display at page:

Download "Objective and Subjective Specifications"

Transcription

1 Objective and Subjective Specifications Eric C.R. Hehner Department of Computer Science, University of Toronto hehner@cs.utoronto.ca Abstract: We examine specifications for dependence on the agent that performs them. We look at the consequences for the Church-Turing Thesis and for the Halting Problem. Introduction The specifications considered in this paper are specifications of behavior, or activity. I include human behavior, computer behavior, and other behavior. To keep the examples simple, I will use specifications that say what the output, or final state, of the behavior should be. And I will use specifications that relate input, or initial state, to output, or final state. The conclusions apply also to specifications that say what the interactions during the behavior should be, but my examples will not be that complicated. A specification may have the form of a question, for example What is two plus two?. Or it may have the form of a command, for example Tell me what is two plus two.. The question and the command are equivalent because they invoke the same behavior. A specification may describe the desired behavior, for example, saying what is two plus two. Definitions A specification is objective if the specified behavior does not vary depending on the agent that performs it. For examples: (0) Given a natural number, what is its square? (1) What is the number of words in this question? (2) What is the name of the first Turing Award winner? For all three questions, the correct answer does not depend on who or what is answering. A specification is subjective if the specified behavior varies depending on the agent that performs it. For examples: (3) What is your name? (4) What is your IP address? The correct answer to question (3) depends on whom you ask. In this paper, subjective does not mean that the answer is a matter of disagreement, debate, doubt, or dishonesty. If we ask Alice what her name is, the answer Alice is correct, and all other answers are wrong. If we ask Bob the same question, the correct answer is different. Question (4) is similar to question (3), but applies to a computer rather than a human. Subjectively and Objectively Inconsistent Now consider this example: (5) Lift Bob. I am not interested in the variety of lifting techniques; I am interested only in the specified result: the agent lifts Bob. If we ask Hercules, who is very strong, to lift Bob, he can do so without difficulty. If we ask Alice, who is much smaller than Bob, she is not strong enough. The result is different, depending on who is trying to lift Bob. So it may seem that (5) is subjective. But the definition of subjective specification says the specified behavior varies depending on the agent. When we ask Alice to lift Bob, we are asking for the same behavior

2 1 Eric Hehner (lifting Bob) as when we ask Hercules. So it may seem that (5) is objective. But suppose we ask Bob to lift Bob. He cannot do so, but not due to lack of strength. He cannot do so because the specification does not make sense when we ask Bob to lift himself. The specification makes sense for some agent (anyone other than Bob), and makes no sense for some agent (Bob). For that reason, (5) is subjective. If we restrict the set of agents to exclude Bob, then (5) is objective. (6) Can Carol correctly answer no to this question? Let's ask Carol. If she says yes, she's saying that no is the correct answer for her, so yes is incorrect. If she says no, she's saying that she cannot correctly answer no, which is her answer. So both answers are incorrect. Carol cannot answer the question correctly. Now let's ask Dave. He says no, and he is correct because Carol cannot correctly answer no. So (6) is subjective because it is a consistent, satisfiable specification for some agent (anyone other than Carol), and an inconsistent, unsatisfiable specification for some agent (Carol). (7) Can any man correctly answer no to this question? Let's ask Ed, who is a man. Suppose Ed says no. Ed is saying that no man can correctly answer no, and Ed, a man, is answering no, so Ed is saying that his answer is incorrect. Suppose Ed says yes. Ed is saying that some man, let's call him Frank, can correctly answer no. But if Frank answers no, he is saying that his own answer is incorrect. So Frank cannot say no correctly. So Ed's yes answer is incorrect. And the same goes for every man. But Gloria, who is not a man, can correctly say no. Specification (7) is subjective because it is a consistent, satisfiable specification for some agent (anyone who is not a man), and an inconsistent, unsatisfiable specification for some agent (any man). (8) Can anyone correctly answer no to this question? If we ask Harry and he says no, he is saying that his answer is incorrect. If he says yes, he is saying that someone, let's say Irene, can correctly answer no. But if Irene answers no, she is saying that her answer is incorrect. So Harry can neither say no nor yes correctly. And the same goes for anyone else we ask. The correct answer to the question is therefore no, but no-one can correctly say so (oops, I just did). I meant: no-one who is a possible agent can say so. I exclude myself from the set of possible agents just so that I can tell you that no possible agent can correctly answer no. Specification (8) is objectively inconsistent. Specifications (6), (7), and (8) are examples of twisted self-reference. The self-reference occurs when the specification talks about the agent who will perform the specification. The twist, in these examples, is the word no. If we replace no with yes in these three specifications, then everyone can correctly answer yes to all of them, making them objectively consistent. Church-Turing Thesis If a specification can be computed by any one of: a Turing Machine (a kind of computer) [2] the lambda-calculus (a mathematical formalism) [0] general recursive functions (another mathematical formalism) [1] then it can be computed by all of them; they all have the same computing power. The Church- Turing Thesis [3] says that each of these formalisms compute all that is computable. In a more modern version, the Church-Turing Thesis says that if a specification can be computed, then it can be computed by a program in any general-purpose programming language. All generalpurpose programming languages provide the same computing power; they are Turing-Machine- Equivalent (TME).

3 Objective and Subjective Specifications 2 Church and Turing were thinking of specifications of mathematical functions, like (0). It seems reasonable to me that the Church-Turing Thesis can be extended to all objective specifications. But its extension to subjective specifications comes up against a problem. Reconsider subjective specification (7), but replace man with L-program, meaning a program written in TME-language L. (L can be Pascal, or Python, or any other programming language.) (9) Can any L-program correctly answer no to this question? It's easy to write an L-program that prints no. If that is the answer to (9), it is saying that there isn't an L-program that correctly answers no to the question, so in particular, the L- program that prints no doesn't give the correct answer. It's just as easy to write an L-program that prints yes. If that program is the answer to (9), it says that no is the correct answer, so the L-program that prints yes doesn't give the correct answer either. In fact, the correct answer to (9) is no, but no L-program can correctly say so. We can write a program in language M (which is another TME-language) that prints no in answer to (9), and that answer is correct. No matter whether the agents are people or programs, the result is the same: one agent can satisfy the specification, but another can't. The Church-Turing Thesis, in the version stated earlier, does not apply to subjective specifications. Specification (9) can be computed by a program in TME-language M, but not by a program in TME-language L. Another version of the Church-Turing Thesis is that any program in any TME-language can be translated to a program in any other TME-language. We'll look at program translation in a moment, but first, here is a non-programming example to illustrate the translation problem. (10) Is this question in French? The correct answer is no. The question is easily translated into French. (11) Cette question est-elle en français? The correct answer is now oui. Before translation, when the question is put to someone who understands the language the question is in, it invokes one behavior: saying no. After an accurate translation, when the question is put to someone who understands the language the question is now in, it invokes a different behavior: saying oui. Specifications (10) and (11) refer to a language, and changing the language of the question affects the answer. Similarly, when we write a program to compute a subjective specification, then translate it to another language, it may invoke different behavior. This can occur when the specification refers to a programming language. First, here's an objective specification that refers to a programming language. (12) Is text p an L-program? Every compiler answers the question whether its input text is a program in the language that it compiles. Whether we write the program that computes (12) in language L or in language M, for the same input p we should get the same answer. Specification (12) is objective, and the Church-Turing Thesis applies. Now replace the input with a self-reference. (13) Is the program answering this question an L-program? There are two ways to write an M-program to compute (13). The hard way is to give the program access to its own text, perform the lexical analysis and parsing and type checking and so on, just as a compiler would do, and then print the answer, which is no. The easy way is just to print no because that's the right answer. Now we translate our M-program to language L. If we programmed the hard way, the translated program accesses its own text, does the analysis, and prints the correct answer, which is yes. If we programmed the easy way, the translated program prints no, which is incorrect. Specification (13) is subjective, and the Church-Turing Thesis does not apply. Either the translation prints the correct answer by exhibiting different behavior, or the translation exhibits the same behavior and the answer is incorrect.

4 3 Eric Hehner The same choice, whether to preserve the behavior or to preserve the specification, can occur without translation, simply by renaming. For example, (14) Given a text p representing a program, determine whether p calls the determining program. Let's name the determining program DoYouCallMe. Given program p, it searches within p for a calling occurrence of DoYouCallMe, reporting yes if one is found, and no if not. Now let's rename the determining program DoYouCallMe2. If we just change the name of the program without changing what it is searching for, this name change preserves behavior, but the program no longer satisfies the specification (14). If we change both the program name and what it is searching for, the program still satisfies the specification (14), but its behavior changes: given the same input, DoYouCallMe and DoYouCallMe2 may give different answers. If a program has access to its own name, then changing its name automatically changes what it is searching for; the result still satisfies (14), but has different behavior. Yet another version of the Church-Turing Thesis is that in any TME-language, you can write an interpreter for programs in any other TME-language. Interpretation is the same as executing a translation, and it is similarly limited to programs that satisfy objective specifications. Given a program that computes a subjective specification, its interpretation may produce behavior that differs from execution of the given program. Halting Problem, Language-Based When Alan Turing laid the foundation for computation in 1936 [2], he wanted to show what computation can do, and what it cannot do. For the latter, he invented a problem that we now call the Halting Problem. Without loss of generality and without changing the character of the problem, I consider halting for programs with no input (input to a program can always be replaced by a definition within the program). In modern terms, it is as follows. (15) Given a text p representing an L-program that requires no input, report stops if execution of p terminates, and loops if execution of p does not terminate. The input p represents a program in TME-language L. The agent that performs specification (15) must be a program, written in a TME-language, running on a computer. (In fact, Turing used the word machine for the combination of program and computer.) I am excluding distributed computations so that I can identify the agent. First, let's ask for a program written in language L to perform (15), and let's call it halts. If there is such a program, then there is also a program in language L, let's call it diag, whose execution is as follows: diag calls halts ( diag ) to determine if its own ( diag 's) execution will terminate. If halts reports that diag 's execution will terminate, then diag 's execution becomes a nonterminating loop; otherwise diag 's execution terminates. We assume there is a dictionary of function and procedure definitions that is accessible to halts, so that the call halts ( diag ) allows halts to look up diag and halts in the dictionary, and retrieve their texts for analysis. When programmed in language L, specification (15) is another twisted self-reference. The selfreference is indirect: halts applies to diag, and diag calls halts. The twist is supplied by diag. If halts reports that diag 's execution will terminate, then diag 's execution is a nonterminating loop. If halts reports that diag 's execution will not terminate, then diag 's execution terminates. Whatever halts reports about diag, it is wrong. Therefore specification (15) is inconsistent when we ask for a program written in language L to perform it.

5 Objective and Subjective Specifications 4 Now let's ask for a program written in TME-language M to perform (15), where M is such that programs written in L cannot call programs written in M. Can this M-program be written? Since L-programs cannot call M-programs, we cannot rule it out by a twisted self-reference. I present two possible answers to the question. Answer O: Specification (15) is objective, like specification (12). But unlike (12), it is an inconsistent specification, no matter what language we use. If we could write an M-program to compute halting for all L-programs, we could translate it into L (or interpret it by an L- program), and because (15) is objective, the translation (or interpretation) would also compute halting correctly for all L-programs. But there is no L-program to compute halting for all L- programs. So there is no program in any language to compute halting for all L-programs. Answer S: Specification (15) is subjective. Like specification (13), (15) refers to a programming language L. When programmed in L there is a twisted self-reference; when programmed in M there is no self-reference. There is an M-program to compute halting for all L-programs. Because (15) is subjective, its translation to L (or interpretation in L) does not compute halting for all L-programs. Perhaps the M-program says correctly that diag 's execution terminates, and its translation to L (or interpretation in L), which we call halts, says incorrectly that diag 's execution does not terminate, and that is why it terminates. Answer O has been almost unanimously accepted by computer scientists, but its acceptance is premature because (15) has never been shown to be objective, and Answer S has never been ruled out. I favor Answer S for the weak reason that I cannot see any inconsistency in asking for an M-program to compute halting for all L-programs. Halting Problem, Machine-Based The preceding discussion of halting is language-based. Here is a similar discussion that is computer-based. Suppose there are two identical disconnected computers C and D, and all programs are written in the same TME-language, and all programs can run on either computer. Both computers have enough memory so that memory limitation is not an issue. (16) Given a text p representing a program that requires no input, loaded on computer C, report stops if execution of p terminates, and loops if execution of p does not terminate. The agent that performs specification (16) must be a program running on either C or D. Once again, I exclude distributed computing so that I can identify the agent, and once again I assume there is a dictionary of function and procedure definitions on each computer. First, let's ask for a program running on computer C to perform (16), and let's call it halts. If there is such a program, then we can write another program, let's call it diag, exactly as before, and we can load this program onto computer C. As before, diag calls halts to report on diag, and then diag does the opposite; so whatever halts reports, it is wrong. Specification (16) is inconsistent when we ask for a program running on computer C to perform it. Now let's ask for a program running on computer D to perform (16). Can this program be written? Since programs on C cannot call programs on D, we cannot rule it out by a twisted self-reference. As in the language-based case, we have the same two possible answers to the question: Answer O and Answer S. Answer O: Specification (16) is objective. It is an inconsistent specification, no matter what computer we use. There is no program on any computer to compute halting for programs on computer C.

6 5 Eric Hehner Answer S: Specification (16) is subjective. There is a program on computer D, and again let's call it halts, to compute halting for all programs on computer C. We can carry the halts program from D to C and run it there. But when we run it on C, it does not compute halting for all programs on C. This is quite counter-intuitive. When halts applies to diag, and diag calls halts, it matters whether the halts that applies (the first occurrence of halts in this sentence) is the same instance as the halts that is called (the second occurrence of halts in this sentence). In one case, there is a twisted self-reference, and in the other, there isn't, and that can affect the computation. Conclusion A specification is objective if the specified behavior does not depend on the agent that performs it, and subjective if it does. The Church-Turing Thesis applies to objective specifications, not to subjective ones. The Halting Problem may be a subjective specification. It is inconsistent to ask for an X-program to compute halting for all X-programs, but it may be consistent and satisfiable to ask a Y-program to compute halting for all X-programs, where X and Y can be two programming languages, or two computers. At least it has not yet been proven impossible. Acknowledgement I thank Bill Stoddart for stimulating discussions. References [0] A.Church: the Calculi of Lambda Conversion, Princeton University Press, 1941 [1] K.Gödel, reported by S.C.Kleene: Introduction to Metamathematics, North-Holland, 1951 [2] A.M.Turing: on Computable Numbers with an Application to the Entscheidungsproblem, Proceedings of the London Mathematical Society s.2 v.42 p , 1936; correction s.2 v.43 p , 1937 [3] A.M.Turing: Systems of Logic Based on Ordinals, p.8, Ph.D. thesis, Princeton University, 1939 other papers on halting

How to Compute Halting

How to Compute Halting 2015-1-2 0 How to Compute Halting Eric C.R. Hehner Department of Computer Science, University of Toronto hehner@cs.utoronto.ca Abstract: A consistently specified halting function may be computed. Halting

More information

the Computability Hierarchy

the Computability Hierarchy 2013 0 the Computability Hierarchy Eric Hehner Department of Computer Science, University of Toronto hehner@cs.utoronto.ca Abstract A computability hierarchy cannot be constructed by halting oracles. Introduction

More information

Epimenides, Gödel, Turing: an Eternal Gölden Tangle [0]

Epimenides, Gödel, Turing: an Eternal Gölden Tangle [0] 2014-10-6 0 Epimenides, Gödel, Turing: an Eternal Gölden Tangle [0] Eric C.R. Hehner Department of Computer Science, University of Toronto hehner@cs.utoronto.ca Abstract: The Halting Problem is a version

More information

What is a Procedure?

What is a Procedure? 2015-12-10 0 Question and Answers What is a Procedure? Eric C.R. Hehner Department of Computer Science, University of Toronto hehner@cs.utoronto.ca What is the meaning of a procedure? This question is

More information

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 [talking head] This lecture we study theory design and implementation. Programmers have two roles to play here. In one role, they

More information

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

The Eval/Apply Cycle Eval. Evaluation and universal machines. Examining the role of Eval. Eval from perspective of language designer Evaluation and universal machines What is the role of evaluation in defining a language? How can we use evaluation to design a language? The Eval/Apply Cycle Eval Exp & env Apply Proc & args Eval and Apply

More information

Introduction to the Lambda Calculus

Introduction to the Lambda Calculus Introduction to the Lambda Calculus Overview: What is Computability? Church s Thesis The Lambda Calculus Scope and lexical address The Church-Rosser Property Recursion References: Daniel P. Friedman et

More information

Trombone players produce different pitches partly by varying the length of a tube.

Trombone players produce different pitches partly by varying the length of a tube. Trombone players produce different pitches partly by varying the length of a tube. 7 Variables A variable is a connection between a name and a value.* That sounds simple enough, but some complexities arise

More information

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5 Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5 [talking head] Formal Methods of Software Engineering means the use of mathematics as an aid to writing programs. Before we can

More information

5. Introduction to the Lambda Calculus. Oscar Nierstrasz

5. Introduction to the Lambda Calculus. Oscar Nierstrasz 5. Introduction to the Lambda Calculus Oscar Nierstrasz Roadmap > What is Computability? Church s Thesis > Lambda Calculus operational semantics > The Church-Rosser Property > Modelling basic programming

More information

Notes on Turing s Theorem and Computability

Notes on Turing s Theorem and Computability Notes on Turing s Theorem and Computability Walter Neumann About 60 years ago there was a revolution in mathematics and philosophy. First Gödel and then Turing showed that there are impossible problems

More information

(Refer Slide Time: 02.06)

(Refer Slide Time: 02.06) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 27 Depth First Search (DFS) Today we are going to be talking

More information

Computer Security module

Computer Security module Computer Security module Revision notes Mark D. Ryan June 2010 There won't be a revision lecture for the Computer Security module. Instead, these notes are provided to help you prepare for the exam. Revision

More information

Chapter 12. Computability Mechanizing Reasoning

Chapter 12. Computability Mechanizing Reasoning Chapter 12 Computability Gödel s paper has reached me at last. I am very suspicious of it now but will have to swot up the Zermelo-van Neumann system a bit before I can put objections down in black & white.

More information

Denotational semantics

Denotational semantics 1 Denotational semantics 2 What we're doing today We're looking at how to reason about the effect of a program by mapping it into mathematical objects Specifically, answering the question which function

More information

(Refer Slide Time: 06:01)

(Refer Slide Time: 06:01) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 28 Applications of DFS Today we are going to be talking about

More information

Nano-Lisp The Tutorial Handbook

Nano-Lisp The Tutorial Handbook Nano-Lisp The Tutorial Handbook Francis Sergeraert March 4, 2006 1 Various types of Nano-Lisp objects. There are several type notions and in this documentation only the notion of implementation type (itype

More information

Artificial Intelligence Lecture 1

Artificial Intelligence Lecture 1 Artificial Intelligence Lecture 1 istrative Matters Webpage: www.aass.oru.se/~mbl/ai Examiner: Mathias Broxvall Assistant: Lia Susana d.c. Silva Lopez Schedule 20 hours/week on this course. 4 hours lectures,

More information

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

CS61A Lecture 38. Robert Huang UC Berkeley April 17, 2013 CS61A Lecture 38 Robert Huang UC Berkeley April 17, 2013 Announcements HW12 due Wednesday Scheme project, contest out Review: Program Generator A computer program is just a sequence of bits It is possible

More information

Material from Recitation 1

Material from Recitation 1 Material from Recitation 1 Darcey Riley Frank Ferraro January 18, 2011 1 Introduction In CSC 280 we will be formalizing computation, i.e. we will be creating precise mathematical models for describing

More information

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

UNIT 14C The Limits of Computing: Non computable Functions. Problem Classifications UNIT 14C The Limits of Computing: Non computable Functions 1 Problem Classifications Tractable Problems Problems that have reasonable, polynomialtime solutions Intractable Problems Problems that may have

More information

THE HALTING PROBLEM. Joshua Eckroth Chautauqua Nov

THE HALTING PROBLEM. Joshua Eckroth Chautauqua Nov THE HALTING PROBLEM Joshua Eckroth Chautauqua Nov 10 2015 The year is 1928 Sliced bread is invented. Calvin Coolidge is President. David Hilbert challenged mathematicians to solve the Entscheidungsproblem:

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security Outline ZKIP Other IP CPSC 467b: Cryptography and Computer Security Lecture 19 Michael J. Fischer Department of Computer Science Yale University March 31, 2010 Michael J. Fischer CPSC 467b, Lecture 19

More information

Post Experiment Interview Questions

Post Experiment Interview Questions Post Experiment Interview Questions Questions about the Maximum Problem 1. What is this problem statement asking? 2. What is meant by positive integers? 3. What does it mean by the user entering valid

More information

Lecture 5: The Halting Problem. Michael Beeson

Lecture 5: The Halting Problem. Michael Beeson Lecture 5: The Halting Problem Michael Beeson Historical situation in 1930 The diagonal method appears to offer a way to extend just about any definition of computable. It appeared in the 1920s that it

More information

MITOCW watch?v=4dj1oguwtem

MITOCW watch?v=4dj1oguwtem MITOCW watch?v=4dj1oguwtem PROFESSOR: So it's time to examine uncountable sets. And that's what we're going to do in this segment. So Cantor's question was, are all sets the same size? And he gives a definitive

More information

Register Machines. Connecting evaluators to low level machine code

Register Machines. Connecting evaluators to low level machine code Register Machines Connecting evaluators to low level machine code 1 Plan Design a central processing unit (CPU) from: wires logic (networks of AND gates, OR gates, etc) registers control sequencer Our

More information

Introduction to Scratch

Introduction to Scratch Introduction to Scratch Familiarising yourself with Scratch The Stage Sprites Scripts Area Sequence of Instructions Instructions and Controls If a computer is a box think of a program as a man inside the

More information

14.1 Encoding for different models of computation

14.1 Encoding for different models of computation Lecture 14 Decidable languages In the previous lecture we discussed some examples of encoding schemes, through which various objects can be represented by strings over a given alphabet. We will begin this

More information

RACKET BASICS, ORDER OF EVALUATION, RECURSION 1

RACKET BASICS, ORDER OF EVALUATION, RECURSION 1 RACKET BASICS, ORDER OF EVALUATION, RECURSION 1 COMPUTER SCIENCE 61AS 1. What is functional programming? Give an example of a function below: Functional Programming In functional programming, you do not

More information

Halting misconceived?

Halting misconceived? Halting misconceived? Bill Stoddart August 25, 2017 Abstract The halting problem is considered to be an essential part of the theoretical background to computing. That halting is not in general computable

More information

Close Your File Template

Close Your File Template In every sale there is always a scenario where I can t get someone to respond. No matter what I do. I can t get an answer from them. When people stop responding I use the Permission To. This is one of

More information

P2_L8 - Hashes Page 1

P2_L8 - Hashes Page 1 P2_L8 - Hashes Page 1 Reference: Computer Security by Stallings and Brown, Chapter 21 In this lesson, we will first introduce the birthday paradox and apply it to decide the length of hash, in order to

More information

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

Computability, Cantor s diagonalization, Russell s Paradox, Gödel s s Incompleteness, Turing Halting Problem. Computability, Cantor s diagonalization, Russell s Paradox, Gödel s s Incompleteness, Turing Halting Problem. Advanced Algorithms By Me Dr. Mustafa Sakalli March, 06, 2012. Incompleteness. Lecture notes

More information

Lambda Calculus and Computation

Lambda Calculus and Computation 6.037 Structure and Interpretation of Computer Programs Chelsea Voss csvoss@mit.edu Massachusetts Institute of Technology With material from Mike Phillips and Nelson Elhage February 1, 2018 Limits to Computation

More information

An Introduction to Subtyping

An Introduction to Subtyping An Introduction to Subtyping Type systems are to me the most interesting aspect of modern programming languages. Subtyping is an important notion that is helpful for describing and reasoning about type

More information

MATH Iris Loeb.

MATH Iris Loeb. MATH 134 http://www.math.canterbury.ac.nz/math134/09/su1/c Iris Loeb I.Loeb@math.canterbury.ac.nz Office Hours: Thur 10.00-11.00, Room 703 (MSCS Building) The Limits of Formal Logic We now turn our attention

More information

Viewing the tm4c123gh6pm_startup_ccs.c file, the first piece of code we see after the comments is shown in Figure 1.

Viewing the tm4c123gh6pm_startup_ccs.c file, the first piece of code we see after the comments is shown in Figure 1. Viewing the tm4c123gh6pm_startup_ccs.c file, the first piece of code we see after the comments is shown in Figure 1. Figure 1 Forward declaration for the default handlers These are the forward declarations,

More information

A Theory of Parallel Computation The π-calculus

A Theory of Parallel Computation The π-calculus A Theory of Parallel Computation The π-calculus Background DFAs, NFAs, pushdown automata, Turing machines... All are mathematical entities that model computation. These abstract systems have concrete,

More information

Who am I? I m a python developer who has been working on OpenStack since I currently work for Aptira, who do OpenStack, SDN, and orchestration

Who am I? I m a python developer who has been working on OpenStack since I currently work for Aptira, who do OpenStack, SDN, and orchestration Who am I? I m a python developer who has been working on OpenStack since 2011. I currently work for Aptira, who do OpenStack, SDN, and orchestration consulting. I m here today to help you learn from my

More information

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

05. Turing Machines and Spacetime. I. Turing Machines and Classical Computability. 05. Turing Machines and Spacetime. I. Turing Machines and Classical Computability. 1. Turing Machines A Turing machine (TM) consists of (Turing 1936): Alan Turing 1. An unbounded tape. Divided into squares,

More information

Part II Composition of Functions

Part II Composition of Functions Part II Composition of Functions The big idea in this part of the book is deceptively simple. It s that we can take the value returned by one function and use it as an argument to another function. By

More information

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras Lecture - 9 Normal Forms In the last class we have seen some consequences and some equivalences,

More information

PROFILE_<PARAM>_QC. What should the variable be and how should it be defined?

PROFILE_<PARAM>_QC. What should the variable be and how should it be defined? PROFILE__QC The PROFILE__QC variables are defined to be the worst QC flag of any level in the profile. A concern was expressed that this definition will lead to a misinterpretation of the

More information

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

Presented By : Abhinav Aggarwal CSI-IDD, V th yr Indian Institute of Technology Roorkee. Joint work with: Prof. Padam Kumar 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

More information

Introduction to Cryptology Dr. Sugata Gangopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Roorkee

Introduction to Cryptology Dr. Sugata Gangopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Roorkee Introduction to Cryptology Dr. Sugata Gangopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Roorkee Lecture 09 Cryptanalysis and its variants, linear attack Welcome

More information

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

CSCI 270: Introduction to Algorithms and Theory of Computing Fall 2017 Prof: Leonard Adleman Scribe: Joseph Bebel CSCI 270: Introduction to Algorithms and Theory of Computing Fall 2017 Prof: Leonard Adleman Scribe: Joseph Bebel We will now discuss computer programs, a concrete manifestation of what we ve been calling

More information

This book is licensed under a Creative Commons Attribution 3.0 License

This book is licensed under a Creative Commons Attribution 3.0 License 6. Syntax Learning objectives: syntax and semantics syntax diagrams and EBNF describe context-free grammars terminal and nonterminal symbols productions definition of EBNF by itself parse tree grammars

More information

Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No.

Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No. Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No. # 20 Concurrency Control Part -1 Foundations for concurrency

More information

Database management system Prof. D. Janakiram Department of Computer Science and Engineering Indian Institute of Technology, Madras

Database management system Prof. D. Janakiram Department of Computer Science and Engineering Indian Institute of Technology, Madras Database management system Prof. D. Janakiram Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 25 Basic 2-phase & 3-phase Commit protocol In the last lecture,

More information

CS 6110 S14 Lecture 1 Introduction 24 January 2014

CS 6110 S14 Lecture 1 Introduction 24 January 2014 CS 6110 S14 Lecture 1 Introduction 24 January 2014 1 Introduction What is a program? Is it just something that tells the computer what to do? Yes, but there is much more to it than that. The basic expressions

More information

(Refer Slide Time: 05:25)

(Refer Slide Time: 05:25) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering IIT Delhi Lecture 30 Applications of DFS in Directed Graphs Today we are going to look at more applications

More information

Lecture T4: Computability

Lecture T4: Computability Puzzle ("Post s Correspondence Problem") Lecture T4: Computability Given a set of cards: N card types (can use as many of each type as possible) Each card has a top string and bottom string Example : N

More information

CS103 Spring 2018 Mathematical Vocabulary

CS103 Spring 2018 Mathematical Vocabulary CS103 Spring 2018 Mathematical Vocabulary You keep using that word. I do not think it means what you think it means. - Inigo Montoya, from The Princess Bride Consider the humble while loop in most programming

More information

CS 531: Notes II. January 31, 2014

CS 531: Notes II. January 31, 2014 CS 531: Notes II January 31, 2014 1 Acceptable and Decidable Languages Let P be a program and x be a string. What happens when we run P on on input x. There are there possibilities. i) The program runs

More information

Project and Production Management Prof. Arun Kanda Department of Mechanical Engineering Indian Institute of Technology, Delhi

Project and Production Management Prof. Arun Kanda Department of Mechanical Engineering Indian Institute of Technology, Delhi Project and Production Management Prof. Arun Kanda Department of Mechanical Engineering Indian Institute of Technology, Delhi Lecture - 8 Consistency and Redundancy in Project networks In today s lecture

More information

Lecture Notes on Program Equivalence

Lecture Notes on Program Equivalence Lecture Notes on Program Equivalence 15-312: Foundations of Programming Languages Frank Pfenning Lecture 24 November 30, 2004 When are two programs equal? Without much reflection one might say that two

More information

CSC D84 Assignment 2 Game Trees and Mini-Max

CSC D84 Assignment 2 Game Trees and Mini-Max 0 The Cats Strike Back Due date: Wednesday, Feb. 21, 9am (electronic submission on Mathlab) This assignment can be completed individually, or by a team of 2 students This assignment is worth 10 units toward

More information

THEORY OF COMPUTATION

THEORY OF COMPUTATION Chapter Eleven THEORY OF COMPUTATION Chapter Summary This chapter introduces the subjects of computability as well as problem classification according to (time) complexity. It begins by presenting the

More information

CS40-S13: Functional Completeness

CS40-S13: Functional Completeness CS40-S13: Functional Completeness Victor Amelkin victor@cs.ucsb.edu April 12, 2013 In class, we have briefly discussed what functional completeness means and how to prove that a certain system (a set)

More information

Recursively Enumerable Languages, Turing Machines, and Decidability

Recursively Enumerable Languages, Turing Machines, and Decidability Recursively Enumerable Languages, Turing Machines, and Decidability 1 Problem Reduction: Basic Concepts and Analogies The concept of problem reduction is simple at a high level. You simply take an algorithm

More information

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

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 CS 275 Automata and Formal Language Theory Course Notes Part III: Limits of Computation Chapt. III.3: Turing Machines Anton Setzer http://www.cs.swan.ac.uk/ csetzer/lectures/ automataformallanguage/13/index.html

More information

6.001 Notes: Section 15.1

6.001 Notes: Section 15.1 6.001 Notes: Section 15.1 Slide 15.1.1 Our goal over the next few lectures is to build an interpreter, which in a very basic sense is the ultimate in programming, since doing so will allow us to define

More information

Type Inference. Prof. Clarkson Fall Today s music: Cool, Calm, and Collected by The Rolling Stones

Type Inference. Prof. Clarkson Fall Today s music: Cool, Calm, and Collected by The Rolling Stones Type Inference Prof. Clarkson Fall 2016 Today s music: Cool, Calm, and Collected by The Rolling Stones Review Previously in 3110: Interpreters: ASTs, evaluation, parsing Formal syntax Formal semantics

More information

(Refer Slide Time: 0:19)

(Refer Slide Time: 0:19) Theory of Computation. Professor somenath Biswas. Department of Computer Science & Engineering. Indian Institute of Technology, Kanpur. Lecture-15. Decision Problems for Regular Languages. (Refer Slide

More information

ARIN Online User Survey Results

ARIN Online User Survey Results ARIN Online User Survey Results ARIN conducted a survey on ARIN Online usage this fall, and solicited direct feedback from the community at the ARIN Online User Forum at ARIN XXVIII in Philadelphia, PA.

More information

For Loop Exit Strategies (Revision 3)

For Loop Exit Strategies (Revision 3) Document number: P0082R2 Date: 2017-02-06 Prior versions: N3587, P0082R0, P0082R1 Audience: Evolution Working Group Reply to: Alan Talbot cpp@alantalbot.com Abstract For Loop Exit Strategies (Revision

More information

6.001 Notes: Section 6.1

6.001 Notes: Section 6.1 6.001 Notes: Section 6.1 Slide 6.1.1 When we first starting talking about Scheme expressions, you may recall we said that (almost) every Scheme expression had three components, a syntax (legal ways of

More information

The following content is provided under a Creative Commons license. Your support

The following content is provided under a Creative Commons license. Your support MITOCW Lecture 9 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To make a donation

More information

h0ps://

h0ps:// 2 For more insanity: h0ps://www.destroyallso7ware.com/talks/wat [Broader point: No one (few people) knows what their programs do in untyped languages.] 3 Type Checking Basics COS 326 David Walker Princeton

More information

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting CS2 Algorithms and Data Structures Note 10 Depth-First Search and Topological Sorting In this lecture, we will analyse the running time of DFS and discuss a few applications. 10.1 A recursive implementation

More information

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics COMP-202 Unit 1: Introduction Announcements Did you miss the first lecture? Come talk to me after class. If you want

More information

On Meaning Preservation of a Calculus of Records

On Meaning Preservation of a Calculus of Records On Meaning Preservation of a Calculus of Records Emily Christiansen and Elena Machkasova Computer Science Discipline University of Minnesota, Morris Morris, MN 56267 chri1101, elenam@morris.umn.edu Abstract

More information

CITS5501 Software Testing and Quality Assurance Formal methods

CITS5501 Software Testing and Quality Assurance Formal methods CITS5501 Software Testing and Quality Assurance Formal methods Unit coordinator: Arran Stewart May 1, 2018 1 / 49 Sources Pressman, R., Software Engineering: A Practitioner s Approach, McGraw-Hill, 2005

More information

Outline Key Management CS 239 Computer Security February 9, 2004

Outline Key Management CS 239 Computer Security February 9, 2004 Outline Key Management CS 239 Computer Security February 9, 2004 Properties of keys Key management Key servers Certificates Page 1 Page 2 Introduction Properties of Keys It doesn t matter how strong your

More information

6.001 Notes: Section 4.1

6.001 Notes: Section 4.1 6.001 Notes: Section 4.1 Slide 4.1.1 In this lecture, we are going to take a careful look at the kinds of procedures we can build. We will first go back to look very carefully at the substitution model,

More information

Eating from the Tree of Ignorance Part 2

Eating from the Tree of Ignorance Part 2 Eating from the Tree of Ignorance Part 2 Jan van Eijck, CWI Amsterdam and Uil-OTS Utrecht Rineke Verbrugge, Institute of AI, University of Groningen ESSLLI 2009, Bordeaux, July 22, 2009 Overview of Part

More information

Introduction to Security in Laserfiche 8.3 and later. White Paper

Introduction to Security in Laserfiche 8.3 and later. White Paper Introduction to Security in Laserfiche 8.3 and later White Paper November 2013 Table of Contents Authentication and Authorization... 4 Authentication... 4 Windows Accounts and LDAP... 5 Laserfiche Trustees...

More information

Unit. Programming Fundamentals. School of Science and Technology INTRODUCTION

Unit. Programming Fundamentals. School of Science and Technology INTRODUCTION INTRODUCTION Programming Fundamentals Unit 1 In order to communicate with each other, we use natural languages like Bengali, English, Hindi, Urdu, French, Gujarati etc. We have different language around

More information

Week - 04 Lecture - 01 Merge Sort. (Refer Slide Time: 00:02)

Week - 04 Lecture - 01 Merge Sort. (Refer Slide Time: 00:02) Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 04 Lecture - 01 Merge Sort (Refer

More information

It Might Be Valid, But It's Still Wrong Paul Maskens and Andy Kramek

It Might Be Valid, But It's Still Wrong Paul Maskens and Andy Kramek Seite 1 von 5 Issue Date: FoxTalk July 2000 It Might Be Valid, But It's Still Wrong Paul Maskens and Andy Kramek This month, Paul Maskens and Andy Kramek discuss the problems of validating data entry.

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

Chapter 11 :: Functional Languages

Chapter 11 :: Functional Languages Chapter 11 :: Functional Languages Programming Language Pragmatics Michael L. Scott Copyright 2016 Elsevier 1 Chapter11_Functional_Languages_4e - Tue November 21, 2017 Historical Origins The imperative

More information

Multiparty Computation (MPC) protocols

Multiparty Computation (MPC) protocols Multiparty Computation (MPC) protocols Protocols where the users of the protocol don t trust each other, but nevertheless they want to achieve a common goal I don t trust Bob I don t trust Alice Alice

More information

Repetition Through Recursion

Repetition Through Recursion Fundamentals of Computer Science I (CS151.02 2007S) Repetition Through Recursion Summary: In many algorithms, you want to do things again and again and again. For example, you might want to do something

More information

1 Parsing (25 pts, 5 each)

1 Parsing (25 pts, 5 each) CSC173 FLAT 2014 ANSWERS AND FFQ 30 September 2014 Please write your name on the bluebook. You may use two sides of handwritten notes. Perfect score is 75 points out of 85 possible. Stay cool and please

More information

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

Recursion. Lecture 6: More Lambda Calculus Programming. Fixed Points. Recursion Recursion Lecture 6: More Lambda Calculus Programming CSC 131! Fall, 2014!! Kim Bruce Recursive definitions are handy! - fact = λn. cond (iszero n) 1 (Mult n (fact (Pred n)))! - Not a legal definition

More information

Type Checking and Type Equality

Type Checking and Type Equality Type Checking and Type Equality Type systems are the biggest point of variation across programming languages. Even languages that look similar are often greatly different when it comes to their type systems.

More information

Skill 1: Multiplying Polynomials

Skill 1: Multiplying Polynomials CS103 Spring 2018 Mathematical Prerequisites Although CS103 is primarily a math class, this course does not require any higher math as a prerequisite. The most advanced level of mathematics you'll need

More information

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1 CS 70 Discrete Mathematics for CS Fall 2000 Wagner MT1 Sol Solutions to Midterm 1 1. (16 pts.) Theorems and proofs (a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are

More information

1 of 5 3/28/2010 8:01 AM Unit Testing Notes Home Class Info Links Lectures Newsgroup Assignmen [Jump to Writing Clear Tests, What about Private Functions?] Testing The typical approach to testing code

More information

Module 10A Lecture - 20 What is a function? Why use functions Example: power (base, n)

Module 10A Lecture - 20 What is a function? Why use functions Example: power (base, n) Programming, Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science and Engineering Indian Institute of Technology, Madras Module 10A Lecture - 20 What is a function?

More information

Alan J. Perlis - Epigrams on Programming

Alan J. Perlis - Epigrams on Programming Programming Languages (CS302 2007S) Alan J. Perlis - Epigrams on Programming Comments on: Perlis, Alan J. (1982). Epigrams on Programming. ACM SIGPLAN Notices 17(9), September 1982, pp. 7-13. 1. One man

More information

6.001 Notes: Section 8.1

6.001 Notes: Section 8.1 6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything

More information

From the λ-calculus to Functional Programming Drew McDermott Posted

From the λ-calculus to Functional Programming Drew McDermott Posted From the λ-calculus to Functional Programming Drew McDermott drew.mcdermott@yale.edu 2015-09-28 Posted 2015-10-24 The λ-calculus was intended from its inception as a model of computation. It was used by

More information

Identity, Authentication, and Access Control

Identity, Authentication, and Access Control Identity, Authentication, and Access Control License This work by Z. Cliffe Schreuders at Leeds Metropolitan University is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

More information

Problem 1. Remove consecutive duplicates (6 points, 11 mintues)

Problem 1. Remove consecutive duplicates (6 points, 11 mintues) Problem 1. Remove consecutive duplicates (6 points, 11 mintues) CS3 Fall 04 Midterm 2 Consider a function remove-conseq-dups that takes a sentence and returns a sentence in which any occurrences of a word

More information

Verifying Cache Coherence in ACL2. Ben Selfridge Oracle / UT Austin

Verifying Cache Coherence in ACL2. Ben Selfridge Oracle / UT Austin erifying Cache Coherence in ACL Ben Selfridge Oracle / UT Austin Goals of this talk Define cache coherence Present a cache coherence protocol designed Present an ACL proof that the protocol is safe (whatever

More information

NUMB3RS Activity: Turing Origami. Episode: One Hour

NUMB3RS Activity: Turing Origami. Episode: One Hour Teacher Page 1 NUMB3RS Activity: Turing Origami Topic: Computer Science, Logic Grade Level: 9-10 Objective: Learn to use a Turing Machine. Time: 20-30 minutes Materials: TI-83 Plus/TI-84 Plus graphing

More information

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

- M ::= v (M M) λv. M - Impure versions add constants, but not necessary! - Turing-complete. - true = λ u. λ v. u. - false = λ u. λ v. Pure Lambda Calculus Lecture 9: More Lambda Calculus / Types CSC 131 Spring, 2019 Kim Bruce Terms of pure lambda calculus - M ::= v (M M) λv. M - Impure versions add constants, but not necessary! - Turing-complete

More information