the type checking problem (TCP) schema the proof checking problem the type synthesis problem (TSP) decidability input: Γ M :? polymorphism in Coq

Size: px
Start display at page:

Download "the type checking problem (TCP) schema the proof checking problem the type synthesis problem (TSP) decidability input: Γ M :? polymorphism in Coq"

Transcription

1 schema the type checking problem (TCP) decidability polymorphism in Coq dependent inductive data-types in Coq further reading overview input: Γ M : N? output: true yes the typing judgement is derivable false no the typing judgement is not derivable (usually) decidable overview the proof checking problem the type synthesis problem (TSP) input: is candidate-proof P a proof of formula A? output: true yes P is a proof of A false no P is not a proof of A corresponds to type checking input: Γ M :? output: yes and term N typing judgment is derivable no typing judgment is not derivable generally decidable

2 the type inhabitation problem (TIP) the provability problem input: Γ? : N output: yes and term M typing judgment is derivable no typing judgment is not deriable input: is there a proof of formula A? corresponds to type inhabitation problem generally undecidable (but decidable in λ ) reduction theory schema subject reduction types are preserved under computation if Γ M : A and M β M then Γ M : A unique normal forms result of a computation is unique via confluence: if M β N and M β P then there is Q such that: N Q and P Q termination all computations eventually end in a normal form decidability polymorphism in Coq dependent inductive data-types in Coq further reading overview overview

3 identity function applications Definition natid : nat -> nat := fun n : nat => n. Definition boolid: bool -> bool := fun b : bool => b. Definition polyid : forall A : Set, A -> A := fun (A : Set) => fun (a : A) => a. polyid nat : nat -> nat polyid nat 0 polyid bool true Notation id := (polyid _). natlists and boollists in Coq polymorphic lists in Coq definition: Inductive natlist : Set := natnil : natlist natcons : nat -> natlist -> natlist. Inductive polylist (A:Set) : Set := polynil : (polylist A) polycons : A -> (polylist A) -> (polylist A). Inductive boollist : Set := boolnil : boollist boolcons : bool -> boollist -> boollist. types (use Check): polylist : Set -> Set polynil : forall A : Set, polylist A polycons : forall A : Set, A -> polylist A -> polylist A

4 instantiation by application slightly more efficient notation polylist nat : Set polynil nat : polylist nat polycons nat : nat -> polylist nat -> polylist nat polycons nat 2 (polycons nat 1 (polynil nat)) polycons bool true (polycons bool false (polynil bool)) Notation ni := (polynil _). Notation co := (polycons _). then we can write the following: Check (co 2 (co 1 ni)). Check (co true (co false ni)). type constructor for dependent lists function on natlists in Coq inductive definition of dependent natlists: Inductive natlist_dep : nat -> Set := nil_dep : natlist_dep 0 cons_dep : forall n : nat, nat -> natlist_dep n -> natlist_dep (S n). the type of the type constructor: natlist_dep : nat -> Set : Type Fixpoint natlength (l:natlist) {struct l} : nat := match l with natnil => O natcons h t => S (natlength t) end.

5 function on polymorphic lists in Coq dependent types versus polymorphism Fixpoint polylength (A:Set)(l:(polylist A)){struct l} : nat := match l with polynil => O polycons h t => S (polylength A t) end. dependent types types may depend on terms natlistdep n polymorphic types terms may depend on types polyid nat dependent types versus polymorphism inductive data-type for lists dependent types functions and quantifications over elements of a type λx : nat. x Πx:nat. natlistdep x polymorphic types functions and quantification over types λa :. λx : a. x Πa:. a a Inductive natlist : Set := natnil : natlist natcons : nat -> natlist -> natlist. Inductive boollist : Set := boolnil : boollist boolcons : bool -> boollist -> boollist. Inductive polylist (X : Set) : Set := polynil : polylist X polycons : X -> polylist X -> polylist X.

6 instantiation polymorphic types using application Coq < Check polyid nat. polyid nat : nat -> nat Coq < Check polylist nat. polylist nat : Set polymorphic identity in lambda2: λa :. λx : a. x : Πa:. a a polymorphic identity in Coq: Definition polyid : forall A : Set, A -> A := fun (A : Set) => fun (a : A) => a. polymorphic data-type for lists in Coq: Inductive polylist (X : Set) : Set := polynil : polylist X polycons : X -> polylist X -> polylist X. schema zeroes decidability polymorphism in Coq dependent inductive data-types in Coq further reading overview overview definition in Coq: Fixpoint zeroes (n:nat) : natlist := match n with O => nil S p => cons O (zeroes p) end. using Eval compute we find: (zeroes 0) = nil : natlist (zeroes 1) = cons 0 nil : natlist (zeroes 2) = cons 0 (cons 0 nil) : natlist

7 the type of zeroes the type of zeroes: more information the type of the function: zeroes : nat -> natlist use of the application rule (as before): zeroes : nat natlist 3 : nat zeroes 3 (zeroes 0) is a natlist of length 0 (zeroes 1) is a natlist of length 1 (zeroes 2) is a natlist of length 2 (zeroes n) is a natlist of length n type constructor for dependent lists type constructor for dependent lists: type inductive definition of dependent natlists: Inductive natlist_dep : nat -> Set := nil_dep : natlist_dep 0 cons_dep : forall n : nat, nat -> natlist_dep n -> natlist_dep (S n). the type of the type constructor: natlist_dep : nat -> Set : Type the type of the type constructor: natlist_dep : nat -> Set : Type use of the application rule (as before): natlistdep : nat Set 3 : nat natlistdep 3 : Set

8 dependent types in Coq: example inductive definition of dependent zeroes: Fixpoint zeroes_dep (n:nat) : natlist_dep n := match n return natlist_dep n with O => nil_dep S p => cons_dep p O (zeroes_dep p) end. the type of the function: zeroes_dep : forall n : nat, natlist_dep n using Eval compute we find: (zeroes_dep 0) = nil_dep : natlist_dep 0 (zeroes_dep 1) = cons_dep 0 0 nil_dep : natlist_dep 1 (zeroes_dep 2) = cons_dep 1 0 (cons_dep 0 0 nil_dep) : natlist_dep 2 dependent zeroes: type the type of the function: zeroes_dep : forall n : nat, natlist_dep n (new) use of the application rule: zeroesdep : foralln : nat, natlistdepn 3 : nat zeroesdep 3 : natlistdep3 function types: non-dependent and dependent length of dependent lists: definitions non-dependent function type (as before): nat -> natlist dependent function type (new): forall n : nat, natlist_dep n uniform presentation for both: forall n:nat, natlist forall n : nat, natlist_dep n an easy definition: Definition length_dep (n : nat) (l : natlist_dep n) := n. another definition: Definition length_dep_b (n : nat) (l : natlist_dep n) : nat := match l with nil_dep => 0 cons_dep n h t => S n end.

9 append of dependent lists: definition dependent types in Coq Fixpoint append_dep (n : nat) (k : natlist_dep n) (m : nat)(l : natlist_dep m) {struct k} : natlist_dep (n + m) := match k in (natlist_dep n) return (natlist_dep (n + m)) with nil_dep => l cons_dep p h t => cons_dep (p + m) h (append_dep p t m l) end. datatype and (data)type constructor in Set: natlist : Set natlist_dep : nat -> Set proposition and predicate ( proposition constructor ) in Prop: True : Prop even : nat -> Prop we need to compute inside types examples schema decidability O : nat : Set : Type fun x:nat x : nat nat : Set : Type nil : natlist : Set : Type nildep : natlistdep O : Set : Type natlistdep : nat Set : Type polymorphism in Coq dependent inductive data-types in Coq further reading overview overview

10 further reading decidability issues Girard Reynolds normalization of F type inhabitation problem (TIP) Γ? : A decidable in λ, undecidable in λp and in λ2 type checking problem (TCP) Γ P : A? decidable in λ, in λp, in λ2 type synthesis problem (TSP) or typability problem Γ P :? decidable in λ, in λp, in λ2 big projects in proof checking compcert by Xavier Leroy et al using Coq logical verification lecture overview four colour theorem by Georges Gonthier using Coq flyspeck project by Thomas Hales et al using HOL verificard by the Münich theorem proving group using Isabelle

11 Curry-Howard-De Bruijn isomorphism Curry-Howard-De Bruijn isomorphism formulas as types proofs as terms prop1 λ pred1 λp prop2 λ2 logic and lambda calculus logic formulas proofs proof rules provability proof checking types terms typing rules inhabitation type checking prop1 pred1 prop1 prop2 minimal intuitionistic classical

12 formulas formulas in Coq prop1 pred1 prop2 a A B x. B + a. B + a A B x. B a. B a A B forall x:terms, B forall a:prop, B proof rules proofs in minimal logic prop1 pred1 prop2 introduction rules and elimination rules I [x] E I (terms) + E (terms) + I (prop) + E (prop) +

13 proofs in intuitionistic logic proofs in intuitionistic logic prop1 pred1 prop2 I E I E E prop1 pred1 prop2 I (terms) + E (terms) + I (prop) + E (prop) + detour logic: possible questions tautology introduction rule for a connective immediately followed by an elimination rule for the same connective correctness detours encodings in prop2

14 examples formulas as types in prop1 λ : A (A B) B in pred1 λp: ( x. P(x) Q(x)) P(M) Q(M) in prop2 λ2: a b. ((a b) b) a A B x. B a. B a Πx:A. B Πx:Terms. B Πa:. B proofs as terms implication introduction and abstraction B A B Γ, x : A b : B Γ A B : Γ λx : A. b : A B proof rules correspond to typing rules prop1 λ pred1 λp prop2 λ2

15 implication elimination and application quantification introduction and abstraction A B B A Γ P : A B Γ a : A Γ (P a) : B B x. B Γ, x : Terms b : B Γ Πa:Terms. B : Γ λa : Terms. b : Πa:Terms. B prop1 λ pred1 λp prop2 λ2 pred1 λp quantification elimination and application quantification elimination and application x. B B[x := M] Γ P : Πx:Terms. B Γ M : Terms Γ (P M) : B[x := M] a. B B[a := A] Γ P : Πa:. B Γ A : Γ (P A) : B[a := A] pred1 λp prop2 λ2

16 lambda calculus the lambda cube λ λp λ λ2 inductive definitions: data-types and predicates terms and simple types terms and types general A ::= a A A M ::= x λx : A. M (M M) M ::= x Πx : M. M λx : M. M (M M)

17 term normalization three product rules β-reduction rule: (λx : A. M) N β M[x := N] β-reduction step: application of the rule in a context β-reduction: a sequence of β-reduction steps λ, λp, λ2: Γ A : Γ, x : A B : Γ Πx:A. B : only λp: Γ A : Γ, x : A B : Γ Πx:A. B : only λ2: Γ A : Γ, x : A B : Γ Πx:A. B : lambda: possible questions decidability issues typing derivation (for λ ) terms typing rules inhabitants encodings type checking problem (TCP) Γ P : A? type inhabitation problem (TIP) Γ? : A type synthesis problem (TSP) or typability problem Γ P :?

18 decidability inductive datatype: example λ λp λ2 TCP TIP + TSP + Inductive natlist : Set := natnil : natlist natcons : nat -> natlist -> natlist. typing following the product rule for λ : nat -> natlist -> natlist : Set family of inductive datatypes: example family of inductive datatypes: example Inductive natlist_dep : nat -> Set := nil_dep : natlist_dep 0 cons_dep : forall n : nat, nat -> natlist_dep n -> natlist_dep (S n). typing following the product rule for λp: nat -> Set : Type Inductive polylist (X : Set) : Set := polynil : polylist X polycons : X -> polylist X -> polylist X. typing following the product rule for λ2: forall X : Set, polylist X : Type

A Tutorial on [Co-]Inductive Types in Coq

A Tutorial on [Co-]Inductive Types in Coq A Tutorial on [Co-]Inductive Types in Coq Eduardo Giménez, Pierre Castéran May 1998 August 17, 2007 Abstract This document 1 is an introduction to the definition and use of inductive and co-inductive types

More information

Deterministic Discrete Modeling

Deterministic Discrete Modeling Deterministic Discrete Modeling Formal Semantics of Firewalls in Isabelle/HOL Cornelius Diekmann, M.Sc. Dr. Heiko Niedermayer Prof. Dr.-Ing. Georg Carle Lehrstuhl für Netzarchitekturen und Netzdienste

More information

Dependent Types at Work

Dependent Types at Work Dependent Types at Work Ana Bove and Peter Dybjer Chalmers University of Technology, Göteborg, Sweden {bove,peterd}@chalmers.se Abstract. In these lecture notes we give an introduction to functional programming

More information

Introduction to type systems

Introduction to type systems Introduction to type systems p. 1/5 Introductory Course on Logic and Automata Theory Introduction to type systems Polyvios.Pratikakis@imag.fr Based on slides by Jeff Foster, UMD Introduction to type systems

More information

The Lean Theorem Prover

The Lean Theorem Prover The Lean Theorem Prover Jeremy Avigad Department of Philosophy and Department of Mathematical Sciences Carnegie Mellon University (Lean s principal developer is Leonardo de Moura, Microsoft Research, Redmond)

More information

CHAPTER 7 GENERAL PROOF SYSTEMS

CHAPTER 7 GENERAL PROOF SYSTEMS CHAPTER 7 GENERAL PROOF SYSTEMS 1 Introduction Proof systems are built to prove statements. They can be thought as an inference machine with special statements, called provable statements, or sometimes

More information

ML for the Working Programmer

ML for the Working Programmer ML for the Working Programmer 2nd edition Lawrence C. Paulson University of Cambridge CAMBRIDGE UNIVERSITY PRESS CONTENTS Preface to the Second Edition Preface xiii xv 1 Standard ML 1 Functional Programming

More information

Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic

Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic Lars Birkedal Rasmus Ejlers Møgelberg Rasmus Lerchedahl Petersen IT University Technical Report Series TR-00-7 ISSN 600 600 February 00

More information

Extraction of certified programs with effects from proofs with monadic types in Coq

Extraction of certified programs with effects from proofs with monadic types in Coq Extraction of certified programs with effects from proofs with monadic types in Coq Marino Miculan 1 and Marco Paviotti 2 1 Dept. of Mathematics and Computer Science, University of Udine, Italy 2 IT University

More information

Introduction to Type Theory

Introduction to Type Theory Introduction to Type Theory Herman Geuvers Radboud University Nijmegen, The Netherlands Technical University Eindhoven, The Netherlands 1 Overview These notes comprise the lecture Introduction to Type

More information

Computer-Assisted Theorem Proving for Assuring the Correct Operation of Software

Computer-Assisted Theorem Proving for Assuring the Correct Operation of Software 1 Computer-Assisted Theorem Proving for Assuring the Correct Operation of Software Amy Felty University of Ottawa Introduction to CSI5110 2 The General Problem From Evan I. Schwartz, Trust Me, I m Your

More information

Foundational Proof Certificates

Foundational Proof Certificates An application of proof theory to computer science INRIA-Saclay & LIX, École Polytechnique CUSO Winter School, Proof and Computation 30 January 2013 Can we standardize, communicate, and trust formal proofs?

More information

An Agda Tutorial. Makoto Takeyama makoto.takeyama@aist.go.jp

An Agda Tutorial. Makoto Takeyama makoto.takeyama@aist.go.jp An Agda Tutorial Misao Nagayama m-nagayama@aist.go.jp Hideaki Nishihara hide.a.kit@ni.aist.go.jp Makoto Takeyama makoto.takeyama@aist.go.jp Research Center for Verification and Semantics (CVS) National

More information

A Theory of Parametric Polymorphism and an Application

A Theory of Parametric Polymorphism and an Application Thesis for the Degree of Doctor of Philosophy A Theory of Parametric Polymorphism and an Application A formalisation of parametric polymorphism within and about dependent type-theory, and an application

More information

Verifying security protocols using theorem provers

Verifying security protocols using theorem provers 1562 2007 79-86 79 Verifying security protocols using theorem provers Miki Tanaka National Institute of Information and Communications Technology Koganei, Tokyo 184-8795, Japan Email: miki.tanaka@nict.go.jp

More information

Bindings, mobility of bindings, and the -quantifier

Bindings, mobility of bindings, and the -quantifier ICMS, 26 May 2007 1/17 Bindings, mobility of bindings, and the -quantifier Dale Miller, INRIA-Saclay and LIX, École Polytechnique This talk is based on papers with Tiu in LICS2003 & ACM ToCL, and experience

More information

Relations: their uses in programming and computational specifications

Relations: their uses in programming and computational specifications PEPS Relations, 15 December 2008 1/27 Relations: their uses in programming and computational specifications Dale Miller INRIA - Saclay & LIX, Ecole Polytechnique 1. Logic and computation Outline 2. Comparing

More information

PROGRAM-ing Finger Trees in COQ

PROGRAM-ing Finger Trees in COQ PROGRAM-ing Finger Trees in COQ Matthieu Sozeau Univ. Paris Sud, CNRS, Laboratoire LRI, UMR 8623, Orsay, F-91405 INRIA Futurs, ProVal, Parc Orsay Université, F-91893 sozeau@lri.fr Abstract Finger Trees

More information

POLYTYPIC PROGRAMMING OR: Programming Language Theory is Helpful

POLYTYPIC PROGRAMMING OR: Programming Language Theory is Helpful POLYTYPIC PROGRAMMING OR: Programming Language Theory is Helpful RALF HINZE Institute of Information and Computing Sciences Utrecht University Email: ralf@cs.uu.nl Homepage: http://www.cs.uu.nl/~ralf/

More information

Automated Proof Construction in Type Theory using Resolution

Automated Proof Construction in Type Theory using Resolution Automated Proof Construction in Type Theory using Resolution Marc Bezem (bezem@ii.uib.no) University of Bergen, Department of Informatics Dimitri Hendriks (hendriks@phil.uu.nl) Utrecht University, Department

More information

CIS 500 Software Foundations Midterm I, Review Questions

CIS 500 Software Foundations Midterm I, Review Questions CIS 500 Software Foundations Midterm I, Review Questions Untyped lambda calculus 1. (2 points) We have seen that a linear expression likeλx.λy.xyx is shorthand for an abstract syntax tree that can be drawn

More information

Software Engineering

Software Engineering Software Engineering Lecture 04: The B Specification Method Peter Thiemann University of Freiburg, Germany SS 2013 Peter Thiemann (Univ. Freiburg) Software Engineering SWT 1 / 50 The B specification method

More information

Summary Last Lecture. Automated Reasoning. Outline of the Lecture. Definition sequent calculus. Theorem (Normalisation and Strong Normalisation)

Summary Last Lecture. Automated Reasoning. Outline of the Lecture. Definition sequent calculus. Theorem (Normalisation and Strong Normalisation) Summary Summary Last Lecture sequent calculus Automated Reasoning Georg Moser Institute of Computer Science @ UIBK Winter 013 (Normalisation and Strong Normalisation) let Π be a proof in minimal logic

More information

MAP-I Programa Doutoral em Informática. Rigorous Software Development

MAP-I Programa Doutoral em Informática. Rigorous Software Development MAP-I Programa Doutoral em Informática Rigorous Software Development Unidade Curricular em Teoria e Fundamentos Theory and Foundations (UCTF) DI-UM, DCC-FCUP May, 2012 Abstract This text presents a UCTF

More information

Setoids in type theory

Setoids in type theory JFP 13 (2): 261 293, March 2003. DOI: 10.1017/S0956796802004501 c 2003 Cambridge University Press Printed in the United Kingdom 261 Setoids in type theory GILLES BARTHE, VENANZIO CAPRETTA INRIA Sophia-Antipolis,

More information

A Computer Verified Theory of Compact Sets

A Computer Verified Theory of Compact Sets A Computer Verified Theory of Compact Sets by Russell O Connor Institute for Computing and Information Science Faculty of Science Radboud University Nijmegen Email: r.oconnor@cs.ru.nl Abstract Compact

More information

Termination Checking: Comparing Structural Recursion and Sized Types by Examples

Termination Checking: Comparing Structural Recursion and Sized Types by Examples Termination Checking: Comparing Structural Recursion and Sized Types by Examples David Thibodeau Decemer 3, 2011 Abstract Termination is an important property for programs and is necessary for formal proofs

More information

NP-Completeness and Cook s Theorem

NP-Completeness and Cook s Theorem NP-Completeness and Cook s Theorem Lecture notes for COM3412 Logic and Computation 15th January 2002 1 NP decision problems The decision problem D L for a formal language L Σ is the computational task:

More information

Verifying design patterns in Hoare Type Theory. Kasper Svendsen, Alexandre Buisse and Lars Birkedal

Verifying design patterns in Hoare Type Theory. Kasper Svendsen, Alexandre Buisse and Lars Birkedal Verifying design patterns in Hoare Type Theory Kasper Svendsen, Alexre Buisse Lars Birkedal IT University Technical Report Series TR-2008-112 ISSN 1600 6100 October 2008 Copyright c 2008, Kasper Svendsen,

More information

CSE 459/598: Logic for Computer Scientists (Spring 2012)

CSE 459/598: Logic for Computer Scientists (Spring 2012) CSE 459/598: Logic for Computer Scientists (Spring 2012) Time and Place: T Th 10:30-11:45 a.m., M1-09 Instructor: Joohyung Lee (joolee@asu.edu) Instructor s Office Hours: T Th 4:30-5:30 p.m. and by appointment

More information

Observational Program Calculi and the Correctness of Translations

Observational Program Calculi and the Correctness of Translations Observational Program Calculi and the Correctness of Translations Manfred Schmidt-Schauss 1, David Sabel 1, Joachim Niehren 2, and Jan Schwinghammer 1 Goethe-University, Frankfurt, Germany 2 INRIA Lille,

More information

Incompleteness & Completeness Formalizing Logic and Analysis in Type Theory

Incompleteness & Completeness Formalizing Logic and Analysis in Type Theory Incompleteness & Completeness Formalizing Logic and Analysis in Type Theory Russell O Connor Incompleteness & Completeness: Formalizing Logic and Analysis in Type Theory Een wetenschappelijke proeve op

More information

On automating the extraction of programs from termination proofs

On automating the extraction of programs from termination proofs On automating the extraction of programs from termination proofs Fairouz Kamareddine, François Monin Mauricio Ayala-Rincón Abstract We investigate an automated program synthesis system that is based on

More information

Implementing Certified Programming Language Tools in Dependent Type Theory. Adam James Chlipala

Implementing Certified Programming Language Tools in Dependent Type Theory. Adam James Chlipala Implementing Certified Programming Language Tools in Dependent Type Theory by Adam James Chlipala B.S. (Carnegie Mellon University) 2003 M.S. (University of California, Berkeley) 2004 A dissertation submitted

More information

Types vs Tests Amanda Laucher. @pandamonial*

Types vs Tests Amanda Laucher. @pandamonial* Types vs Tests Amanda Laucher @pandamonial* Intersubjectivity Assumptions Craftsmanship Quotes When in doubt create a type. Martin Fowler Make illegal states unrepresentable. Yaron Minsky Michael Feathers

More information

Weyl s Predicative Classical Mathematics as a Logic-Enriched Type Theory

Weyl s Predicative Classical Mathematics as a Logic-Enriched Type Theory Weyl s Predicative Classical Mathematics as a Logic-Enriched Type Theory ROBIN ADAMS and ZHAOHUI LUO Dept of Computer Science, Royal Holloway, Univ of London We construct a logic-enriched type theory LTT

More information

OPERATIONAL TYPE THEORY by Adam Petcher Prepared under the direction of Professor Aaron Stump A thesis presented to the School of Engineering of

OPERATIONAL TYPE THEORY by Adam Petcher Prepared under the direction of Professor Aaron Stump A thesis presented to the School of Engineering of WASHINGTON NIVERSITY SCHOOL OF ENGINEERING AND APPLIED SCIENCE DEPARTMENT OF COMPTER SCIENCE AND ENGINEERING DECIDING JOINABILITY MODLO GROND EQATIONS IN OPERATIONAL TYPE THEORY by Adam Petcher Prepared

More information

Fun with Henry. Dirk Pattinson Department of Computing Imperial College London

Fun with Henry. Dirk Pattinson Department of Computing Imperial College London Fun with Henry Dirk Pattinson Department of Computing Imperial College London 1 Example: The Tudors Henry VIII Henry Carey Mary Boleyn There have been speculation that Mary s two children, Catherine and

More information

AURA: A language with authorization and audit

AURA: A language with authorization and audit AURA: A language with authorization and audit Steve Zdancewic University of Pennsylvania WG 2.8 2008 Security-oriented Languages Limin Jia, Karl Mazurak, Jeff Vaughan, Jianzhou Zhao Joey Schorr and Luke

More information

Normalization by Evaluation

Normalization by Evaluation Normalization by Evaluation Midlands Graduate School in the Foundations of Computer Science Leicester, UK Peter Dybjer Chalmers University of Technology Gothenburg, Sweden 30 March - 3 April, 2009 What

More information

Logic in Computer Science: Logic Gates

Logic in Computer Science: Logic Gates Logic in Computer Science: Logic Gates Lila Kari The University of Western Ontario Logic in Computer Science: Logic Gates CS2209, Applied Logic for Computer Science 1 / 49 Logic and bit operations Computers

More information

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson Mathematics for Computer Science/Software Engineering Notes for the course MSM1F3 Dr. R. A. Wilson October 1996 Chapter 1 Logic Lecture no. 1. We introduce the concept of a proposition, which is a statement

More information

Non-deterministic Semantics and the Undecidability of Boolean BI

Non-deterministic Semantics and the Undecidability of Boolean BI 1 Non-deterministic Semantics and the Undecidability of Boolean BI DOMINIQUE LARCHEY-WENDLING, LORIA CNRS, Nancy, France DIDIER GALMICHE, LORIA Université Henri Poincaré, Nancy, France We solve the open

More information

Certified Assembly Programming with Embedded Code Pointers

Certified Assembly Programming with Embedded Code Pointers Certified Assembly Programming with Embedded Code Pointers Zhaozhong Ni Zhong Shao Department of Computer Science, Yale University New Haven, CT 06520-8285, U.S.A. {ni-zhaozhong, shao-zhong}@cs.yale.edu

More information

Mathematical Induction

Mathematical Induction Mathematical Induction In logic, we often want to prove that every member of an infinite set has some feature. E.g., we would like to show: N 1 : is a number 1 : has the feature Φ ( x)(n 1 x! 1 x) How

More information

From Program Verification to Certified Binaries

From Program Verification to Certified Binaries From Program Verification to Certified Binaries The Quest for the Holy Grail of Software Engineering Angelos Manousaridis, Michalis A. Papakyriakou, and Nikolaos S. Papaspyrou National Technical University

More information

Verifying Specifications with Proof Scores in CafeOBJ

Verifying Specifications with Proof Scores in CafeOBJ Verifying Specifications with Proof Scores in CafeOBJ FUTATSUGI, Kokichi 二 木 厚 吉 Chair of Language Design Graduate School of Information Science Japan Advanced Institute of Science and Technology (JAIST)

More information

One More Decidable Class of Finitely Ground Programs

One More Decidable Class of Finitely Ground Programs One More Decidable Class of Finitely Ground Programs Yuliya Lierler and Vladimir Lifschitz Department of Computer Sciences, University of Texas at Austin {yuliya,vl}@cs.utexas.edu Abstract. When a logic

More information

SECTION 10-2 Mathematical Induction

SECTION 10-2 Mathematical Induction 73 0 Sequences and Series 6. Approximate e 0. using the first five terms of the series. Compare this approximation with your calculator evaluation of e 0.. 6. Approximate e 0.5 using the first five terms

More information

Formal Engineering for Industrial Software Development

Formal Engineering for Industrial Software Development Shaoying Liu Formal Engineering for Industrial Software Development Using the SOFL Method With 90 Figures and 30 Tables Springer Contents Introduction 1 1.1 Software Life Cycle... 2 1.2 The Problem 4 1.3

More information

A Certified Type-Preserving Compiler from Lambda Calculus to Assembly Language

A Certified Type-Preserving Compiler from Lambda Calculus to Assembly Language A Certified Type-Preserving Compiler from Lambda Calculus to Assembly Language Adam Chlipala University of California, Berkeley adamc@cs.berkeley.edu Abstract We present a certified compiler from the simply-typed

More information

Model Checking: An Introduction

Model Checking: An Introduction Announcements Model Checking: An Introduction Meeting 2 Office hours M 1:30pm-2:30pm W 5:30pm-6:30pm (after class) and by appointment ECOT 621 Moodle problems? Fundamentals of Programming Languages CSCI

More information

Computational Semantics, Type Theory, and Functional Programming

Computational Semantics, Type Theory, and Functional Programming Computational Semantics, Type Theory, and Functional Programming I Converting Montague Grammarians into Programmers Jan van Eijck CWI and ILLC, Amsterdam, Uil-OTS, Utrecht LOLA7 Tutorial, Pecs August 2002

More information

INF5140: Specification and Verification of Parallel Systems

INF5140: Specification and Verification of Parallel Systems INF5140: Specification and Verification of Parallel Systems Lecture 7 LTL into Automata and Introduction to Promela Gerardo Schneider Department of Informatics University of Oslo INF5140, Spring 2007 Gerardo

More information

Report T97:04 ISRN : SICS-T{97/04-SE ISSN : 1100-3154 Using Formal Methods A practical comparison between Z/EVES and PVS by Daniel Fredholm FDT 971204 Swedish Institute of Computer Science Box 1263, S-164

More information

Real Roots of Univariate Polynomials with Real Coefficients

Real Roots of Univariate Polynomials with Real Coefficients Real Roots of Univariate Polynomials with Real Coefficients mostly written by Christina Hewitt March 22, 2012 1 Introduction Polynomial equations are used throughout mathematics. When solving polynomials

More information

Equality and dependent type theory. Oberwolfach, March 2 (with some later corrections)

Equality and dependent type theory. Oberwolfach, March 2 (with some later corrections) Oberwolfach, March 2 (with some later corrections) The Axiom of Univalence, a type-theoretic view point In type theory, we reduce proof-checking to type-checking Hence we want type-checking to be decidable

More information

Propositional Logic. A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both.

Propositional Logic. A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both. irst Order Logic Propositional Logic A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both. Are the following sentences propositions? oronto

More information

Certified Programming with Dependent Types

Certified Programming with Dependent Types Certified Programming with Dependent Types Adam Chlipala April 8, 2015 A print version of this book is available from the MIT Press. For more information, see the book s home page: http://adam.chlipala.net/cpdt/

More information

Section 6.1 Factoring Expressions

Section 6.1 Factoring Expressions Section 6.1 Factoring Expressions The first method we will discuss, in solving polynomial equations, is the method of FACTORING. Before we jump into this process, you need to have some concept of what

More information

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2 CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2 Proofs Intuitively, the concept of proof should already be familiar We all like to assert things, and few of us

More information

GRAPH THEORY LECTURE 4: TREES

GRAPH THEORY LECTURE 4: TREES GRAPH THEORY LECTURE 4: TREES Abstract. 3.1 presents some standard characterizations and properties of trees. 3.2 presents several different types of trees. 3.7 develops a counting method based on a bijection

More information

Hoare Type Theory, Polymorphism and Separation

Hoare Type Theory, Polymorphism and Separation Under consideration for publication in J. Functional Programming 1 Hoare Type Theory, Polymorphism and Separation ALEKSANDAR NANEVSKI and GREG MORRISETT Harvard University {aleks,greg}@eecs.harvard.edu

More information

Towards Certified Program Logics for the Verification of Imperative Programs

Towards Certified Program Logics for the Verification of Imperative Programs David Miguel Ramalho Pereira Towards Certified Program Logics for the Verification of Imperative Programs Doctoral Program in Computer Science of the Universities of Minho, Aveiro and Porto April 2013

More information

Formalization of the CRM: Initial Thoughts

Formalization of the CRM: Initial Thoughts Formalization of the CRM: Initial Thoughts Carlo Meghini Istituto di Scienza e Tecnologie della Informazione Consiglio Nazionale delle Ricerche Pisa CRM SIG Meeting Iraklio, October 1st, 2014 Outline Overture:

More information

MATHEMATICS: CONCEPTS, AND FOUNDATIONS Vol. III - Logic and Computer Science - Phokion G. Kolaitis

MATHEMATICS: CONCEPTS, AND FOUNDATIONS Vol. III - Logic and Computer Science - Phokion G. Kolaitis LOGIC AND COMPUTER SCIENCE Phokion G. Kolaitis Computer Science Department, University of California, Santa Cruz, CA 95064, USA Keywords: algorithm, Armstrong s axioms, complete problem, complexity class,

More information

Specification and Analysis of Contracts Lecture 1 Introduction

Specification and Analysis of Contracts Lecture 1 Introduction Specification and Analysis of Contracts Lecture 1 Introduction Gerardo Schneider gerardo@ifi.uio.no http://folk.uio.no/gerardo/ Department of Informatics, University of Oslo SEFM School, Oct. 27 - Nov.

More information

Functional programming languages

Functional programming languages Functional programming languages Part II: abstract machines Xavier Leroy INRIA Rocquencourt MPRI 2-4-2, 2007 X. Leroy (INRIA) Functional programming languages MPRI 2-4-2, 2007 1 / 73 Execution models for

More information

Lecture 16 : Relations and Functions DRAFT

Lecture 16 : Relations and Functions DRAFT CS/Math 240: Introduction to Discrete Mathematics 3/29/2011 Lecture 16 : Relations and Functions Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT In Lecture 3, we described a correspondence

More information

JUST THE MATHS UNIT NUMBER 1.8. ALGEBRA 8 (Polynomials) A.J.Hobson

JUST THE MATHS UNIT NUMBER 1.8. ALGEBRA 8 (Polynomials) A.J.Hobson JUST THE MATHS UNIT NUMBER 1.8 ALGEBRA 8 (Polynomials) by A.J.Hobson 1.8.1 The factor theorem 1.8.2 Application to quadratic and cubic expressions 1.8.3 Cubic equations 1.8.4 Long division of polynomials

More information

How to Make Ad Hoc Proof Automation Less Ad Hoc

How to Make Ad Hoc Proof Automation Less Ad Hoc How to Make Ad Hoc Proof Automation Less Ad Hoc Georges Gonthier Microsoft Research gonthier@microsoft.com Beta Ziliani MPI-SWS beta@mpi-sws.org Aleksandar Nanevski IMDEA Software Institute aleks.nanevski@imdea.org

More information

Intuitionistic Type Theory. Per Martin-Löf

Intuitionistic Type Theory. Per Martin-Löf Intuitionistic Type Theory Per Martin-Löf Notes by Giovanni Sambin of a series of lectures given in Padua, June 1980 Contents Introductory remarks............................ 1 Propositions and judgements.......................

More information

Properties of Stabilizing Computations

Properties of Stabilizing Computations Theory and Applications of Mathematics & Computer Science 5 (1) (2015) 71 93 Properties of Stabilizing Computations Mark Burgin a a University of California, Los Angeles 405 Hilgard Ave. Los Angeles, CA

More information

Certified Security Proofs of Cryptographic Protocols in the Computational Model : an Application to Intrusion Resilience

Certified Security Proofs of Cryptographic Protocols in the Computational Model : an Application to Intrusion Resilience Certified Security Proofs of Cryptographic Protocols in the Computational Model : an Application to Intrusion Resilience Pierre Corbineau Mathilde Duclos Yassine Lakhnech Université de Grenoble, CNRS Verimag,

More information

CS510 Software Engineering

CS510 Software Engineering CS510 Software Engineering Propositional Logic Asst. Prof. Mathias Payer Department of Computer Science Purdue University TA: Scott A. Carr Slides inspired by Xiangyu Zhang http://nebelwelt.net/teaching/15-cs510-se

More information

A Gentle Introduction to Type Classes and Relations in Coq

A Gentle Introduction to Type Classes and Relations in Coq A Gentle Introduction to Type Classes and Relations in Coq Pierre Castéran Univ. Bordeaux, LaBRI, UMR 5800, F-33400 Talence, France. CNRS, LaBRI, UMR 5800, F-33400 Talence, France. Matthieu Sozeau INRIA

More information

A Formal Specification of the MIDP 2.0 Security Model

A Formal Specification of the MIDP 2.0 Security Model A Formal Specification of the MIDP 2.0 Security Model Santiago Zanella Béguelin 1, Gustavo Betarte 2, and Carlos Luna 2 1 FCEIA, Universidad Nacional de Rosario, Argentina szanella@fceia.unr.edu.ar 2 InCo,

More information

263-2200 Types and Programming Languages

263-2200 Types and Programming Languages 263-2200 Types and Programming Languages 1 / 49 Outline Types Evaluation Rules Typing Rules Properties of the Typing Relation The Inversion Lemma Prolog Implementation Reasoning Involving Types Progress

More information

Linear Types for Continuations

Linear Types for Continuations 1/28 Linear Types for Continuations Alex Simpson LFCS, School of Informatics University of Edinburgh, UK Joint work with: Jeff Egger (LFCS, Edinburgh) Rasmus Møgelberg (ITU, Copenhagen) Linear Types for

More information

Using the Computer to Prove the Correctness of Programs p.1/12

Using the Computer to Prove the Correctness of Programs p.1/12 Using the Computer to Prove the Correctness of Programs Bengt Nordström bengt@cs.chalmers.se ChungAng University on leave from Chalmers University, Göteborg, Sweden Using the Computer to Prove the Correctness

More information

Lecture 13 of 41. More Propositional and Predicate Logic

Lecture 13 of 41. More Propositional and Predicate Logic Lecture 13 of 41 More Propositional and Predicate Logic Monday, 20 September 2004 William H. Hsu, KSU http://www.kddresearch.org http://www.cis.ksu.edu/~bhsu Reading: Sections 8.1-8.3, Russell and Norvig

More information

Formal firewall conformance testing: an application of test and proof techniques

Formal firewall conformance testing: an application of test and proof techniques SOFTWARE TESTING, VERIFICATION AND RELIABILITY Softw. Test. Verif. Reliab. 2014; 00:1 38 Published online in Wiley InterScience (www.interscience.wiley.com). Formal firewall conformance testing: an application

More information

Automated Theorem Proving - summary of lecture 1

Automated Theorem Proving - summary of lecture 1 Automated Theorem Proving - summary of lecture 1 1 Introduction Automated Theorem Proving (ATP) deals with the development of computer programs that show that some statement is a logical consequence of

More information

(67902) Topics in Theory and Complexity Nov 2, 2006. Lecture 7

(67902) Topics in Theory and Complexity Nov 2, 2006. Lecture 7 (67902) Topics in Theory and Complexity Nov 2, 2006 Lecturer: Irit Dinur Lecture 7 Scribe: Rani Lekach 1 Lecture overview This Lecture consists of two parts In the first part we will refresh the definition

More information

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology First Name: Family Name: Student Number: Class/Tutorial: WOLLONGONG COLLEGE AUSTRALIA A College of the University of Wollongong Diploma in Information Technology Mid-Session Test Summer Session 008-00

More information

2110711 THEORY of COMPUTATION

2110711 THEORY of COMPUTATION 2110711 THEORY of COMPUTATION ATHASIT SURARERKS ELITE Athasit Surarerks ELITE Engineering Laboratory in Theoretical Enumerable System Computer Engineering, Faculty of Engineering Chulalongkorn University

More information

Predicate Logic Review

Predicate Logic Review Predicate Logic Review UC Berkeley, Philosophy 142, Spring 2016 John MacFarlane 1 Grammar A term is an individual constant or a variable. An individual constant is a lowercase letter from the beginning

More information

COMPUTER SCIENCE TRIPOS

COMPUTER SCIENCE TRIPOS CST.98.5.1 COMPUTER SCIENCE TRIPOS Part IB Wednesday 3 June 1998 1.30 to 4.30 Paper 5 Answer five questions. No more than two questions from any one section are to be answered. Submit the answers in five

More information

A Note on Context Logic

A Note on Context Logic A Note on Context Logic Philippa Gardner Imperial College London This note describes joint work with Cristiano Calcagno and Uri Zarfaty. It introduces the general theory of Context Logic, and has been

More information

Chapter 15 Functional Programming Languages

Chapter 15 Functional Programming Languages Chapter 15 Functional Programming Languages Introduction - The design of the imperative languages is based directly on the von Neumann architecture Efficiency (at least at first) is the primary concern,

More information

6.1 Add & Subtract Polynomial Expression & Functions

6.1 Add & Subtract Polynomial Expression & Functions 6.1 Add & Subtract Polynomial Expression & Functions Objectives 1. Know the meaning of the words term, monomial, binomial, trinomial, polynomial, degree, coefficient, like terms, polynomial funciton, quardrtic

More information

The Modal Logic Programming System MProlog

The Modal Logic Programming System MProlog The Modal Logic Programming System MProlog Linh Anh Nguyen Institute of Informatics, University of Warsaw ul. Banacha 2, 02-097 Warsaw, Poland nguyen@mimuw.edu.pl Abstract. We present the design of our

More information

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook. Elementary Number Theory and Methods of Proof CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.edu/~cse215 1 Number theory Properties: 2 Properties of integers (whole

More information

Trust but Verify: Authorization for Web Services. The University of Vermont

Trust but Verify: Authorization for Web Services. The University of Vermont Trust but Verify: Authorization for Web Services Christian Skalka X. Sean Wang The University of Vermont Trust but Verify (TbV) Reliable, practical authorization for web service invocation. Securing complex

More information

Proving Type Soundness of a Simply Typed ML-Like Language with References

Proving Type Soundness of a Simply Typed ML-Like Language with References Proving Type Soundness of a Simply Typed ML-Like Language with References Olivier Boite and Catherine Dubois CEDRIC-IIE (CNAM), 18 allée Jean Rostand F-91025 EVRY, France {boite,dubois}@iie.cnam.fr Abstract.

More information

Ralf Hinze Generic Programs and Proofs

Ralf Hinze Generic Programs and Proofs Ralf Hinze Generic Programs and Proofs Bonn, 2000 Für Anja, Lisa und Florian Brief contents 1 Introduction 1 2 Background 15 3 Generic programs 53 4 Generic proofs 87 5 Examples 107 6 Generic Haskell 147

More information

The last three chapters introduced three major proof techniques: direct,

The last three chapters introduced three major proof techniques: direct, CHAPTER 7 Proving Non-Conditional Statements The last three chapters introduced three major proof techniques: direct, contrapositive and contradiction. These three techniques are used to prove statements

More information

Idris, a General Purpose Dependently Typed Programming Language: Design and Implementation

Idris, a General Purpose Dependently Typed Programming Language: Design and Implementation Under consideration for publication in J. Functional Programming 1 Idris, a General Purpose Dependently Typed Programming Language: Design and Implementation EDWIN BRADY School of Computer Science, University

More information

Program Transformation and Its Applications to Software Synthesis and Verification

Program Transformation and Its Applications to Software Synthesis and Verification Program Transformation and Its Applications to Software Synthesis and Verification Maurizio Proietti Joint work with: Fabio Fioravanti (Univ. D'Annunzio, Pescara, Italy), Alberto Pettorossi (Univ. Tor

More information