Coq and Nuprl Wojciech Moczydłowski History World, type system Inductive types in Coq Extraction in Coq Other features of Coq.

Slides:



Advertisements
Similar presentations
T YPE I SOMORPHISM O LA M AHMOUD S UPERVISED BY : D R. M ARCELO F IORE UNIVERSITY OF CAMBRIDGE Computer Laboratory Theory & Semantics Group I NTRODUCTION.
Advertisements

1 Logic Programming School of Informatics, University of Edinburgh Logic Programming in 50 Minutes The purpose of this lecture is to explain why logic.
Chapter 11 user support. Issues –different types of support at different times –implementation and presentation both important –all need careful design.
Proofs and Programs Wei Hu 11/01/2007. Outline  Motivation  Theory  Lambda calculus  Curry-Howard Isomorphism  Dependent types  Practice  Coq Wei.
1 Dependent Types for Termination Verification Hongwei Xi University of Cincinnati.
VIDE als voortzetting van Cocktail SET Seminar 11 september 2008 Dr. ir. Michael Franssen.
Functional Design and Programming Lecture 11: Functional reasoning.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 355 – Programming Languages
Code-Carrying Proofs Aytekin Vargun Rensselaer Polytechnic Institute.
What’s left in the course. The course in a nutshell Logics Techniques Applications.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
VIDE Integrated Environment for Development and Verification of Programs.
Katz Formal Specifications Larch 1 Algebraic Specification and Larch Formal Specifications of Complex Systems Shmuel Katz The Technion.
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.
Sparkle A theorem prover for the functional language Clean Maarten de Mol University of Nijmegen February 2002.
Describing Syntax and Semantics
MCA –Software Engineering Kantipur City College. Topics include  Formal Methods Concept  Formal Specification Language Test plan creation Test-case.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 Tools of Software Development l 2 types of tools used by software engineers:
Making an Argument The goal of communication is to achieve the desired affect on the target audience. Often we want to convince the audience of something.
Mathematical Maxims and Minims, 1988
LTT: a type-theoretic framework for foundational pluralism Zhaohui Luo Dept of Computer Science Royal Holloway, Univ of London.
CAS- 734 (Presentation -1) By : Vasudha Kapil
Mathematical Modeling and Formal Specification Languages CIS 376 Bruce R. Maxim UM-Dearborn.
NummSquared Coercion make it so! Samuel Howse poohbist.com November 29, 2006 Copyright © 2006 Samuel Howse. All rights reserved.
CSCI 2670 Introduction to Theory of Computing Instructor: Shelby Funk.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Formal Verification Lecture 9. Formal Verification Formal verification relies on Descriptions of the properties or requirements Descriptions of systems.
CSE-490 Logic in Computer Science The Coq Proof Assistant POSTECH Dec 15, 2006 박성우.
Induction Proof. Well-ordering A set S is well ordered if every subset has a least element. [0, 1] is not well ordered since (0,1] has no least element.
© Kenneth C. Louden, Chapter 11 - Functional Programming, Part III: Theory Programming Languages: Principles and Practice, 2nd Ed. Kenneth C. Louden.
ISBN Chapter 3 Describing Semantics.
Syntax and Semantics CIS 331 Syntax: the form or structure of the expressions, statements, and program units. Semantics: the meaning of the expressions,
Universal Types Report by Matthias Horbach. Contents Types of Polymorphism System F Basic Properties Erasure Impredicativity Parametricity.
Inductive Predicates  Unit vs True  Inductive unit : Set := tt : unit  Inductive True : Prop := I : True  Curry Howard Isomorphism  But Coq distinguish.
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
Kazushige Terui RIMS, Kyoto University. On 11/10/2015, IPSJ announced: Computer Shogi Project has been completed. What’s next?  Go, or … Computer Shomei.
Automated tactics for separation logic VeriML Reconstruct Z3 Proof Safe incremental type checker Certifying code transformation Proof carrying hardware.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
Advanced Formal Methods Lecture 3: Simply Typed Lambda calculus Mads Dam KTH/CSC Course 2D1453, Some material from B. Pierce: TAPL + some from.
1 First order theories (Chapter 1, Sections 1.4 – 1.5) From the slides for the book “Decision procedures” by D.Kroening and O.Strichman.
Supercompilation and Normalisation by Evaluation Gavin Mendel-Gleason & Geoff Hamilton Dublin City University.
1/24 An Introduction to PVS Charngki PSWLAB An Introduction to PVS Judy Crow, Sam Owre, John Rushby, Natarajan Shankar, Mandayam Srivas Computer.
COMPUTER III. Fundamental Concepts of Programming Control Structures Sequence Selection Iteration Flowchart Construction Introduction to Visual Basic.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우.
CMSC 330: Organization of Programming Languages Operational Semantics.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
June 21, Reasoning about explicit strictness in a lazy language using mixed lazy/strict semantics Marko van Eekelen Maarten de Mol Nijmegen University,
Metalogic Soundness and Completeness. Two Notions of Logical Consequence Validity: If the premises are true, then the conclusion must be true. Provability:
C H A P T E R E I G H T Functional Programming Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
5 Lecture in math Predicates Induction Combinatorics.
1 Discrete Mathematical Mathematical Induction ( الاستقراء الرياضي )
Type-Theoretical Semantics with Coercive Subtyping Zhaohui Luo Department of Computer Science Royal Holloway, University of London.
Mostly-Automated Verification of Low-Level Programs in Computational Separation Logic Adam Chlipala Harvard University PLDI 2011.
1 Interactive Computer Theorem Proving CS294-9 October 5, 2006 Adam Chlipala UC Berkeley Lecture 7: Programming with Proofs.
1 Interactive Computer Theorem Proving CS294-9 October 19, 2006 Adam Chlipala UC Berkeley Lecture 9: Beyond Primitive Recursion.
1 Interactive Computer Theorem Proving CS294-9 September 7, 2006 Adam Chlipala UC Berkeley Lecture 3: Data structures and Induction.
1 Interactive Computer Theorem Proving CS294-9 September 14, 2006 Adam Chlipala UC Berkeley Lecture 4: Inductively- Defined Predicates.
Thoughts on Programming with Proof Assistants Adam Chlipala University of California, Berkeley PLPV Workshop.
Lecture 11: Proof by Reflection
(Proof By) Induction Recursion
COSC 5V90 Functional Programming and Interactive Theorem Proving
CS 550 Programming Languages Jeremy Johnson
Sparkle a functional theorem prover
Programming Languages 2nd edition Tucker and Noonan
IS 2935: Developing Secure Systems
Chapter 11 user support.
Sub-system interfaces
Presentation transcript:

Coq and Nuprl Wojciech Moczydłowski History World, type system Inductive types in Coq Extraction in Coq Other features of Coq

History Coq Lambda calculus with types. Church, Curry, Howard, Girard, Huet, Coquand, Paulin-Mohring. Nuprl Type theory. Russell, Church, Curry, Howard, Martin-Löf, Nuprl group.

Ideology Coq A Calculus of Inductive Constructions. Not assuming stance on FOM. Nuprl A foundational system, intented to represent constructive mathematics. Propositions-as-types principle

Type system: Judgements Coq t : T t is of type T Nuprl s=t : T s is equal to t in type T T=S types T and S are equal

Consistency Coq 1. Syntactic - proof-theoretic methods, strong normalization. 2. Semantic - models in (domain,set, category) theory. Nuprl 1. Syntactic - no strong normalization. 2. Semantic - Allen, Howe, Moran. Domain models for Martin-Löf’s type theory

Rules Coq Only typing rules. Core λC has <10 rules (PTS presentation). Inductive definitions - probably about <20 more. Extraction - ??? Reduction - ??? Marketing Nuprl Judgements + extraction terms + tactics. More than 100 rules.

World Coq (8.0) Set, Type i predicative Prop impredicative Note: In Coq 7.2 Set impredicative as well Nuprl Completely predicative

Type system Coq Closed. No really new types can be added. Nuprl Open-ended. New types can and are being added. Type system

Logic Coq Only universal quantifier built-in. Rest defined using inductive types (including equality). Can also use Girard’s ideas. Nuprl All the logic built-in. Logic

Coq - inductive definitions Very generic mechanism. Used to define logic, natural numbers, lists, inductive predicates and others... To each inductive definition correspond generated principles of induction and recursion.

Coq - inductive types Logic Inductive False :=. Inductive True := I : True. Inductive and (A B : Prop) : Prop := conj A  B  A /\ B. Inductive or (A B : Prop) : Prop := or_introl : A  A \/ B | or_intror : B  A \/ B. Coq - inductive types Logic

Natural numbers Coq Another inductive type. Nuprl Built-in construct.

Coq - inductive types Natural numbers Inductive nat := 0 : nat | S : nat  nat. Recursion:  P : nat  Set, P 0  (  n : nat. P n  P (S n))   n : nat. P n

Coq - inductive types Natural numbers Inductive nat := 0 : nat | S : nat  nat. Induction:  P : nat  Prop, P 0  (  n : nat. P n  P (S n))   n : nat. P n

Coq - inductive types List Inductive List (A:Set) : Set := Nil : List A | Cons : A  List A  List A Recursion:  A  P : List A  Set. P (Nil A)  (  a : A, l : List A. P l  P (a::l))   l : List A.

Coq - inductive types List Inductive List (A:Set) : Set := Nil : List A | Cons : A  List A  List A Induction:  A  P : List A  Prop. P (Nil A)  (  a : A, l : List A. P l  P (a::l))   l : List A.

Coq - inductive types <= Inductive le (n:nat) : nat  Prop := le_n : le n n | le_S :  m:nat, le n m  le n (S m).

Coq - extraction External mechanism. Proof irrelevance - Prop doesn’t contain computational content and isn’t supposed to. Set and Type hierarchy, however, do. Coq - extraction

Ind. ex (A : x) (P:A  y) : z ex_intro :  x : A, P x  ex A P. (x, y, z) = (Type, Prop, Prop) No computational content Notation: exists x : A, P x Coq - extraction

Ind. ex (A : x) (P:A  y) : z ex_intro :  x : A, P x  ex A P. (x, y, z) = (Set, Prop, Set) Witness is extracted, proof not. Notation: { x : A | P x } Coq - extraction

Ind. ex (A : x) (P:A  y) : z ex_intro :  x : A, P x  ex A P. (x, y, z) = (Set, Set, Set) Everything is extracted. Isomorphic to  type. Notation: { x : A & P x } Coq - extraction

Programming language Coq Not very strong, due to strong normalization. Restrictions on possible programs - structural recursion. Nuprl Full power of Y combinator. Programming language

Environment Coq Text-mode interface for user interaction. External graphic environment is being developed. Nuprl Sophisticated programming environment, integrated editor, library management etc. Environment

Installation and system requirements Coq Installation: easy. Sys.req: Modest. Systems: Windows, Unix (Linux/ MacOS/ Solaris...). Nuprl Installation: hard. Sys.req: High. Systems: Unix Installation and system requirements

Coq - other informations User base: over 250 people subscribed to the mailing list. New book: Coq’Art (2004). Website: coq.inria.fr Documentation tools. Why - a tool for proving correctness of imperative programs. Can use Coq as a backend prover. Coq - other informations