Proofs Are Programs COS 441 Princeton University Fall 2004.

Slides:



Advertisements
Similar presentations
Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
Advertisements

Current Techniques in Language-based Security David Walker COS 597B With slides stolen from: Steve Zdancewic University of Pennsylvania.
Logic Concepts Lecture Module 11.
Copyright © Cengage Learning. All rights reserved.
CLASSICAL LOGIC and FUZZY LOGIC. CLASSICAL LOGIC In classical logic, a simple proposition P is a linguistic, or declarative, statement contained within.
HISTORY OF LOGIC BY JOHN NAGUIB. What is Logic? The science or study of how to evaluate arguments and reasoning. “Logic is new and necessary reasoning”
CLF: A Concurrent Logical Framework David Walker Princeton (with I. Cervesato, F. Pfenning, K. Watkins)
CSE (c) S. Tanimoto, 2008 Propositional Logic
What’s left in the course. The course in a nutshell Logics Techniques Applications.
CS1001 Lecture 22. Overview Mechanizing Reasoning Mechanizing Reasoning G ö del ’ s Incompleteness Theorem G ö del ’ s Incompleteness Theorem.
Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
Presentation for Proof Assistant course by Nadya Kalabishka
Proofs are Programs: 19th Century Logic and 21st Century Computing CS 510: Programming Languages (a talk adapted from Philip Wadler)
Administrative stuff On Thursday, we will start class at 11:10, and finish at 11:55 This means that each project will get a 10 minute presentation + 5.
Natural deduction  ` A  ` B  ` A Æ B  ` A  ` A Æ B  ` B  ` B  ` A ) B  ` A  ` A ) B  ` B  ` A ÆIÆI ÆE1ÆE1 ÆE2ÆE2 Assume )I)I.
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Computability Thank you for staying close to me!! Learning and thinking More algorithms... computability.
First Order Logic. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about first order.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester Prepared by: amani Omer.
Inference is a process of building a proof of a sentence, or put it differently inference is an implementation of the entailment relation between sentences.
MATH 224 – Discrete Mathematics
CSE 311: Foundations of Computing Fall 2013 Lecture 8: More Proofs.
Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우.
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
Lambda Calculus History and Syntax. History The lambda calculus is a formal system designed to investigate function definition, function application and.
Logic. Mathematical logic is a subfield of mathematics exploring the applications of formal logic to mathematics. Topically, mathematical logic bears.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Logical Agents Logic Propositional Logic Summary
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
0 What logic is or should be Propositions Boolean operations The language of classical propositional logic Interpretation and truth Validity (tautologicity)
Logic in Computer Science - Overview Sep 1, 2009 박성우.
Propositional Calculus – Methods of Proof Predicate Calculus Math Foundations of Computer Science.
Natural Deduction CS 270 Math Foundations of CS Jeremy Johnson.
© Kenneth C. Louden, Chapter 11 - Functional Programming, Part III: Theory Programming Languages: Principles and Practice, 2nd Ed. Kenneth C. Louden.
CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE
The Exciting World of Natural Deduction!!! By: Dylan Kane Jordan Bradshaw Virginia Walker.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
CS6133 Software Specification and Verification
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
Artificial Intelligence “Introduction to Formal Logic” Jennifer J. Burg Department of Mathematics and Computer Science.
First Order Logic Lecture 3: Sep 13 (chapter 2 of the book)
Of 38 lecture 13: propositional logic – part II. of 38 propositional logic Gentzen system PROP_G design to be simple syntax and vocabulary the same as.
Advanced Formal Methods Lecture 3: Simply Typed Lambda calculus Mads Dam KTH/CSC Course 2D1453, Some material from B. Pierce: TAPL + some from.
CSE 311 Foundations of Computing I Lecture 26 Cardinality, Countability & Computability Autumn 2011 CSE 3111.
CSE 311 Foundations of Computing I Lecture 25 Pattern Matching, Cardinality, Computability Spring
CSE 311: Foundations of Computing Fall 2013 Lecture 26: Pattern matching, cardinality.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우.
Alonzo Church: Mathematician. Philosopher. Computer Scientist? Who is Alonzo Church? Alonzo Church was a man who was very important to the computer science.
CSE 311 Foundations of Computing I Lecture 8 Proofs Autumn 2011 CSE 3111.
CSE 311 Foundations of Computing I Lecture 8 Proofs Autumn 2012 CSE
Cut Elimination – Splitting versus Proof Nets Antrittsvortrag zur Diplomarbeit von Matthias Horbach Betreuer: Lutz Straßburger.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
COMP 412, FALL Type Systems C OMP 412 Rice University Houston, Texas Fall 2000 Copyright 2000, Robert Cartwright, all rights reserved. Students.
Foundations of Computing I CSE 311 Fall Announcements Homework #2 due today – Solutions available (paper format) in front – HW #3 will be posted.
Sound Arguments and Derivations. Topics Sound Arguments Derivations Proofs –Inference rules –Deduction.
Chapter 1 Logic and proofs
Proof And Strategies Chapter 2. Lecturer: Amani Mahajoub Omer Department of Computer Science and Software Engineering Discrete Structures Definition Discrete.
CSE 311 Foundations of Computing I
Lecture 2 Propositional Logic
CSE 311 Foundations of Computing I
CS201: Data Structures and Discrete Mathematics I
CSE 311: Foundations of Computing
CS 270 Math Foundations of CS
On Kripke’s Alleged Proof of Church-Turing Thesis
Computer Security: Art and Science, 2nd Edition
Classical propositional logic (quick review)
Proofs are Programs: 19th Century Logic and 21st Century Computing
CS201: Data Structures and Discrete Mathematics I
Presentation transcript:

Proofs Are Programs COS 441 Princeton University Fall 2004

Logic is Computation Want to end the course with an interesting historical perspective about the essence of programming and proving This course has been a hopefully interesting combination of proving and programming Today we’re going to learn how they really are the same thing!

Outline Gentzen’s Natural Deduction Church’s lambda calculus Connection between the two Extending the connection for mobile code on the internet

Brief History of Logic Aristotle (384 BCE – 322 BCE) –Organon (10 works on logic) William of Ockham ( ) –Summa Logicae (1327) Published 1487 Gottolob Frege’s –Begriffsschrift (1879) “Concept Script”

Frege’s modus ponens Frege introduce a pictorial formalizing for logical inference modus ponens From B implies A and B conclude A Conclusion Premises A implies B

Extract from Frege’s Begriffsschrift

Systems Derived From Ferge’s Work

Gentzen’s Natural Deduction Gerhard Gentzen (1909 – 1945) Ich wollte zunächst einmal einen Formalismus aufstellen, der dem wirklichen Schließen möglichst nahe kommt. So ergab sich ein „Kalkül des natürlichen Schließens“. (First I wished to construct a formalism that comes as close as possible to actual reasoning. Thus arose a "calculus of natural deduction".) Gentzen, Untersuchungen über das logische Schließen (Mathematische Zeitschrift 39, pp , 1935)

Natural Deduction Reaction to “sentential” axiomizations used by Hilbert, Frege, and Rusell Also proposed by Stanislaw Jaskowski Many different contributors but of course one person tends to get all the credit!

Fragment of Natural Deduction Rules

Generalize to Include Contexts Assuming B 1,…, B n conclude A  and  stand for lists of propositions A and B single propositions ,  is the union of propositions removing any duplicates

Types of Natural Deduction Rules structural rules logical rules elimination rulesintroduction rules

A Roundabout Proof Leads to the notion of proof simplification Subforumula property means any proof of  ` A can be reduced to a proof that only formulas in  and A or subformulas of  and A

Sequent Calculus Gentezen introduced to logics natural deduction and sequent calculus Sequent calculus is simpler form where proving subformula property is easier Gentezen later showed natural deduction and sequent calculus are equivalent Sequent calculus is a form of “logical assembly code” when compare to natural deduction

Direct Proof of Subformula Property A direct proof of the subformula property can be derived form ideas presented by Church and his formulation of the lambda calculus

Church and the Lambda-Calculus Alonzo Church ( ) B.S. (1924) and PhD (1927) From Princeton University Lambda calculus introduce in 1932 as a reformulation of logic Original formulation was buggy! Allowed for paradoxes (( x. x) ( x.x)) Seen as a foundation for computation in 1936

Refresher Course in Everything reduced to substitution Mathematical function f ( x ) = x £ x f ( 3 ) = 3 £ 3 = 9 Represented with lambda term x. x £ x Plus basic reduction rule ( x. t )( u ) ) [ u / x ] t

Church-Rosser Theorem Order of reduction of lambda term does not matter

Untyped Lambda Calculus Can directly encode multi-argument functions via “currying” Can directly encode the natural numbers as lambda terms Can encode pairs and many structure in pure lambda calculus Can encode any computable function in the untyped lambda calculus

Typed Lambda Calculus Introduce (circa 1940) by Church to avoid paradoxes in original lambda logic as well as Ferge’s and Rusell’s system The following slide should look vaguely familiar!

Rules for the TLC

Reductions Preserve Type

Strong Normalization Unlike the untyped lambda calculus the type lambda calculus does not allow you to express a term with an infinite sequence of reductions Types get simpler after each reductions, types are finite therefore you have to stop TLC is not Turing complete (this is a feature)

The Curry-Howard Isomorphism Take the TLC erase the “red” terms and you get Gentzen’s natural deduction! Lambda terms are one-to-one with proof rules Types are one-to-one with logical formula Term reduction is the same as proof simplification Type-checking is proof checking!

The Long Road to Discovery 1934 – Gentzen’s simplification via sequents 1940 – Church’s TLC 1956 – Prawitz direct simplification of ND ?? – Curry and Feys work on combinators draw connection with Hilbert’s axioms 1969 – W.A. Howard connects the dots of Curry and Prawitz 1980 – Officially published!

Logics and Computer Science Hindley-Milner (type inference) Hindley - logician discovered 1969 Milner – computer scientist re-discovered 1978 Girard-Reynolds (2 nd order polymorphic lambda calculus) Girard – logician 1972 Reynolds – computer scientist 1974

Intuitionist Logic CHI based on intuitionist fragments of logic Intuitionist logic does not include the law of the excluded middle ( : A) Ç A Timothy Griffin (1990) extends CHI to classical logic Roughly requires CPS conversion

Programming Languages and Logic Great deal of effort to establish formally verified properties of software Theorem Proving – HOL, LCF, Isabelle, Twelf, Coq,… Proof Carrying Code Typed Assembly Language

Challenges for the Future Digital Rights Management –Logics will be use to enforce contracts and protect rights of content providers (XRML) Data Privacy (information flow) –Design new languages that don’t leak information Verification of software systems –Systems that don’t crash

Summary There are deep connections between logical reasoning and programming –Programs are proofs –Types are formulas Understanding the foundations of both are the key to moving forward in the next century