Foundations of Computation. Ana Bove

Similar documents
Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Propositions as Types

Introduction to Turing Machines

Automata Theory. Definition. Computational Complexity Theory. Computability Theory

Church s undecidability result

Lecture 14 Rosser s Theorem, the length of proofs, Robinson s Arithmetic, and Church s theorem. Michael Beeson

The Curry-Howard Isomorphism

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory

Type Theory and Constructive Mathematics. Type Theory and Constructive Mathematics Thierry Coquand. University of Gothenburg

ON COMPUTAMBLE NUMBERS, WITH AN APPLICATION TO THE ENTSCHENIDUGSPROBLEM. Turing 1936

The roots of computability theory. September 5, 2016

The Calculus of Inductive Constructions

CS 301. Lecture 17 Church Turing thesis. Stephen Checkoway. March 19, 2018

HoTT seminar organization

Fundamentals of Computer Science

The Legacy of Hilbert, Gödel, Gentzen and Turing

Turing Centenary Lecture

PREDICATE LOGIC: UNDECIDABILITY AND INCOMPLETENESS HUTH AND RYAN 2.5, SUPPLEMENTARY NOTES 2

CA320 - Computability & Complexity

Lecture 11: Gödel s Second Incompleteness Theorem, and Tarski s Theorem

Introduction to dependent type theory. CIRM, May 30

CHAPTER 11. Introduction to Intuitionistic Logic

Gödel s Theorem: Limits of logic and computation

The Limit of Humanly Knowable Mathematical Truth

ENEE 459E/CMSC 498R In-class exercise February 10, 2015

Decidability: Church-Turing Thesis

What are the recursion theoretic properties of a set of axioms? Understanding a paper by William Craig Armando B. Matos

Gottfried Wilhelm Leibniz (1666)

Ordinal Strength of Logic-Enriched Type Theories

Decidable Languages - relationship with other classes.

7.1 The Origin of Computer Science

Formalising the Completeness Theorem of Classical Propositional Logic in Agda (Proof Pearl)

Finite Automata Theory and Formal Languages TMV027/DIT321 LP Recap: Logic, Sets, Relations, Functions

Cogito ergo sum non machina!

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 14 : Turing Machines

Lectures on Computational Type Theory

Bootstrapping Mathematics

Hilbert s problems, Gödel, and the limits of computation

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 16 : Turing Machines

Propositional and Predicate Logic. jean/gbooks/logic.html

Friendly Logics, Fall 2015, Lecture Notes 1

Handouts. CS701 Theory of Computation

CST Part IB. Computation Theory. Andrew Pitts

On Modal Logics of Partial Recursive Functions

Large Numbers, Busy Beavers, Noncomputability and Incompleteness

Computation. Some history...

This is logically equivalent to the conjunction of the positive assertion Minimal Arithmetic and Representability

On some Metatheorems about FOL

COMP 2600: Formal Methods for Software Engineeing

Informal Statement Calculus

Computability Theory. CS215, Lecture 6,

Opleiding Informatica

Paradox Machines. Christian Skalka The University of Vermont

Hilbert s problems, Gödel, and the limits of computation

Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky. Radboud University Nijmegen. March 5, 2012

Creative Objectivism, a powerful alternative to Constructivism

Peano Arithmetic. CSC 438F/2404F Notes (S. Cook) Fall, Goals Now

CS21 Decidability and Tractability

Logic in Computer Science. Frank Wolter

Recursion Theory. Joost J. Joosten

Institute for Applied Information Processing and Communications (IAIK) Secure & Correct Systems. Decidability

Contents Propositional Logic: Proofs from Axioms and Inference Rules

Lecture Notes on The Curry-Howard Isomorphism

Computer Proof Assistants and Univalent Foundations of Mathematics

Review of Propositional Calculus

The Church-Turing Thesis and Relative Recursion

Victoria Gitman and Thomas Johnstone. New York City College of Technology, CUNY

COMPUTATION IN AND ABOUT PHYSICS AND MATHEMATICS

IV. Turing Machine. Yuxi Fu. BASICS, Shanghai Jiao Tong University

Marie Duží

Handbook of Logic and Proof Techniques for Computer Science

Last Time. Inference Rules

Epistemological and Computational Constraints of Simulation Support for OR Questions

Computer Science and Logic A Match Made in Heaven

A Simple Proof of Gödel s Incompleteness Theorems

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

Axiomatic set theory. Chapter Why axiomatic set theory?

Intuitionism and effective descriptive set theory

... The Sequel. a.k.a. Gödel's Girdle

CS70 is a course about on Discrete Mathematics for Computer Scientists. The purpose of the course is to teach you about:

Propositions and Proofs

Propositional and Predicate Logic - XIII

Reminder of Notation. For a variable-free term t, we let t N N stand for the interpretation of t in N. (For example, (SSS0 SS0) N equals 6.

KRIPKE S THEORY OF TRUTH 1. INTRODUCTION

Type Theory and Univalent Foundation

Part I: Propositional Calculus

AN INTRODUCTION TO COMPUTABILITY THEORY

Completeness Theorems and λ-calculus

The Lambda Calculus. Stephen A. Edwards. Fall Columbia University

Antinomies of Mathematical Reason: The Inconsistency of PM Arithmetic and Related Systems. (S. Fennell, Cambridge)

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lecture 1 : Introduction

17.1 The Halting Problem

Normalization by Evaluation

Classical First-Order Logic

Learning Goals of CS245 Logic and Computation

Přednáška 12. Důkazové kalkuly Kalkul Hilbertova typu. 11/29/2006 Hilbertův kalkul 1

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

The LCF Approach to Theorem Proving

Transcription:

Foundations of Computation Ana Bove Programming Logic (ProgLog) Group February 13th 2018 Outline of the talk: What we do in ProgLog Origines of computer science Courses in the area

Warming-up Exercise 2 < 4? Now, can you formally prove it? What would you need to do so? February 13th 2018, Ana Bove Foundations of Computation 1/23

How to Give a Formal Proof of 2 < 4? We need to understand the objects we manipulate... Natural numbers: N is a set (inductively) defined as 0 : N n : N n + 1 : N... and also how the relation < is defined! < : N N Prop n : N 0 < n + 1 n < m n + 1 < m + 1 Now we can formally prove that 2 < 4! Can you see how? February 13th 2018, Ana Bove Foundations of Computation 2/23

What about more Complex Proofs? Conjunction: P Q P Q Disjunction: P P Q Q P Q Implication: [P]. Q P Q February 13th 2018, Ana Bove Foundations of Computation 3/23

Propositions as Types, Proofs as Programs Conjunction: Cartesian product: P Q P Q a : A b : B < a, b >: A B Disjunction: Disjoint sum: P P Q Q P Q a : A inl a : A + B b : B inr b : A + B Implication: Functions: [P] [a : A]. Q P Q. b : B λa.b : A B February 13th 2018, Ana Bove Foundations of Computation 4/23

Are We Missing Something? Quantifiers!!! x.p(x) x.p(x) What do they correspond to in the word of types? Dependent Types!! February 13th 2018, Ana Bove Foundations of Computation 5/23

Dependent Types A dependent type is a type that depends on a value. Example: List of a given length. data Vec (A : Set) : N Set where [ ] : Vec A zero :: : {n} A Vec A n Vec A (suc n) Could also be used to state properties of certain objects! Example: Property of being a sorted vector. data SortedV : {n} Vec N n Set where sorted[ ] : SortedV [ ] sorted[-] : {x} SortedV [ x ] sorted:: : {n x y} (xs : Vec N n) x y SortedV (y :: xs) SortedV (x :: y :: xs) February 13th 2018, Ana Bove Foundations of Computation 6/23

Programming with Dependent Types: Sorting How can we write a function that sorts a sequence of numbers? What type will it have? sort : List N List N Result should have the same number of elements: sort : {n} Vec N n Vec N n Result should be sorted: sort : {n} Vec N n (λ ys SortedV {n} ys) Result should have the same elements: sort : {n} (xs : Vec N n) (λ ys SortedV {n} ys PermV xs ys) February 13th 2018, Ana Bove Foundations of Computation 7/23

Programming with Dependent Types: Sorting Given n : N and xs : Vec N n then sort xs returns ys. < ps, qs > such that ys : Vec N n ps : SortedV {n} ys qs : PermV xs ys A program like sort is said to be correct by construction: together with the result, we give a proof showing that the result has the expected properties! February 13th 2018, Ana Bove Foundations of Computation 8/23

Programming with Dependent Types Dependently type programming languages usually have specialised compilers that deal with the logical (proofs) bits. Still they are quite inefficient so far... One can sometimes extract to program into a standard programming language (Haskell, C,...). But then one needs to trust the extraction mechanism... February 13th 2018, Ana Bove Foundations of Computation 9/23

What about the Law of Excluding Middle (LEM)? We have learnt that the LEM is always true (tautology). P P But here we can only construct a proof of it if we know that P is true or P is true!! P P P P P P We work here with intuitionistic/constructive logic! (as opposite to classical logic) February 13th 2018, Ana Bove Foundations of Computation 10/23

Curry-Howard Isomorphism In 1934, Haskell Curry observed the correspondance between (a theory of) functions and (a theory of) implications. In 1969, William Howard extended the correspondance to other logic connectives. He also proposes new concepts for types (now known as dependent types) that would correspond to the quantifiers and. February 13th 2018, Ana Bove Foundations of Computation 11/23

Propositions as Types Mathematicians and computer scientists proposed numerous systems based on this concept: de Bruijn s Automath Martin-Löf s type theory, developed into the Agda proof assistant (here at D&IT, Chalmers-GU) Bates and Constable s nuprl Coquand and Huet s Calculus of Constructions, developed into the Coq proof assistant... February 13th 2018, Ana Bove Foundations of Computation 12/23

Programming Logic Research Group It is our thesis that formal elegance is a prerequisite to efficient implementation. Gérard Huet Senior members: Thierry Coquand Peter Dybjer Andreas Abel Robin Adams Ana Bove Nils Anders Danielsson Ulf Norell Simon Huber Activities: Development of theorem provers and their compilers Development of the underlying theory and methodologies Formalisation of mathematics Programming with dependent types February 13th 2018, Ana Bove Foundations of Computation 13/23

Once Upon a Time... In early 1900 s, Bertrand Russell showed that formal logic can express large parts of mathematics. In 1928, David Hilbert posed a challenge known as the Entscheidungsproblem (decision problem). This problem asked for an effectively calculable procedure to determine whether a given statement is provable from the axioms using the rules of logic. February 13th 2018, Ana Bove Foundations of Computation 14/23

To Prove or Not To Prove: THAT Is the Question! The decision problem presupposed completness: any statement or its negation can be proved. Wir müssen wissen, wir werden wissen ( We must know, we will know ) In 1931, Kurt Gödel published the incompleteness theorems. The first theorem shows that any consistent system capable of expressing arithmetic cannot be complete: there is a true statement that cannot be proved with the rules of the system. The second theorem shows that such a system could not prove its own consistency. February 13th 2018, Ana Bove Foundations of Computation 15/23

λ-calculus as a Language for Logic In the 30s, Alonzo Church (and his students Stephen Kleene and John Barkley Rosser) introduced the λ-calculus as a way to define notations for logical formulas: x λx.m M N In 1935, Kleene and Rosser proved the system inconsistent (due to self application). February 13th 2018, Ana Bove Foundations of Computation 16/23

λ-calculus as a Language for Computations Church discovered how to encode numbers in the λ-calculus. For example, 3 is encoded as λf.λx.f (f (f (x))). Encoding for addition, multiplication and (later) predecesor were defined. Thereafter Church and his students became convinced any effectively calculable function of numbers could be represented by a term in the λ-calculus. February 13th 2018, Ana Bove Foundations of Computation 17/23

Church s Thesis Church proposed λ-definability as the definition of effectively calculable (known today as Church s Thesis). He also demonstrated that the problem of whether a given λ-term has a normal form was not λ-definable (equivalent to the Halting problem). A year later, he demonstrated there was no λ-definable solution to the Entscheidungsproblem. February 13th 2018, Ana Bove Foundations of Computation 18/23

General Recursive Functions 1933: Gödel was not convinced by Church s assertion that every effectively calculable function was λ-definable. Church offered that Gödel would propose a different definition which he then would prove it was included in λ-definability. 1934: Gödel proposed the general recursive functions as his candidate for effective calculability (system which Kleene after developed and published). Church and his students then proved that the two definitions were equivalent. Now Gödel doubt his own definition was correct! February 13th 2018, Ana Bove Foundations of Computation 19/23

Turing Machines Simultaneously, Alan Mathison Turing formulated his notion of effectively calculable in terms of a Turing machine. He used the Turing machines to show the Halting problem undecidable. Then he showed the Entscheidungsproblem undecidable by reducing it to the Halting problem. Turing also proved the equivalence of the λ-calculus and his machines. (Church-Turing Thesis) Gödel is now finally convinced! :-) February 13th 2018, Ana Bove Foundations of Computation 20/23

Computer Science Was Born! Turing s approach took into account the capabilities of a (human) computer: a human performing a computation assisted by paper and pencil. February 13th 2018, Ana Bove Foundations of Computation 21/23

Turing Award Since 1966, annual prize from the Association for Computing Machinery (ACM) for lasting technical contributions to the computing community. Seen as the Nobel Prize of computing. February 13th 2018, Ana Bove Foundations of Computation 22/23

Which Courses Can You Take? TMV027/DIT321 Finite Automata Theory and Formal Languages. Bachelor course given in LP4 in 17/18 (in LP3 from 18/19). DAT060/DIT201 Logic in Computing Sciences. Master course given in LP1. DAT350/DIT232 Types for Programs and Proofs. Master course given in LP1. TDA184/DIT310 (DIT311 from 18/19) Models of Computation. Master course given in LP2. February 13th 2018, Ana Bove Foundations of Computation 23/23