Inductive Predicates  Unit vs True  Inductive unit : Set := tt : unit  Inductive True : Prop := I : True  Curry Howard Isomorphism  But Coq distinguish.

Slides:



Advertisements
Similar presentations
Functional Programming Lecture 13 - induction on lists.
Advertisements

Know what is meant by proof by Induction Learning Outcomes: PROOF BY INDUCTION Be able to use proof by induction to prove statements.
PROOF BY CONTRADICTION
Formalising the structure of extremal p-groups Georges Gonthier.
Proofs and Programs Wei Hu 11/01/2007. Outline  Motivation  Theory  Lambda calculus  Curry-Howard Isomorphism  Dependent types  Practice  Coq Wei.
Semantics of Hoare Logic Aquinas Hobor and Martin Henz.
T h e G a s L a w s. T H E G A S L A W S z B o y l e ‘ s L a w z D a l t o n ‘ s L a w z C h a r l e s ‘ L a w z T h e C o m b i n e d G a s L a w z B.
SAT and Model Checking. Bounded Model Checking (BMC) A.I. Planning problems: can we reach a desired state in k steps? Verification of safety properties:
What’s left in the course. The course in a nutshell Logics Techniques Applications.
Case Study: Using PVS to Analyze Security Protocols Kyle Taylor.
Denotational Semantics Syntax-directed approach, generalization of attribute grammars: –Define context-free abstract syntax –Specify syntactic categories.
Advanced Formal Methods Lecture 7: Isabelle – Sets Mads Dam KTH/CSC Course 2D1453, Material from L. Paulson.
1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state.
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.
Review: forward E { P } { P && E } TF { P && ! E } { P 1 } { P 2 } { P 1 || P 2 } x = E { P } { \exists … }
Review: forward E { P } { P && E } TF { P && ! E } { P 1 } { P 2 } { P 1 || P 2 } x = E { P } { \exists … }
Monadic Predicate Logic is Decidable Boolos et al, Computability and Logic (textbook, 4 th Ed.)
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
Deciding a Combination of Theories - Decision Procedure - Changki pswlab Combination of Theories Daniel Kroening, Ofer Strichman Presented by Changki.
CISC 2315 Discrete Structures Professor William G. Tanner, Jr. Fall 2010 Slides created by James L. Hein, author of Discrete Structures, Logic, and Computability,
Secure Compiler Seminar 11/7 Survey: Modular Development of Certified Program Verifiers with a Proof Assistant Toshihiro YOSHINO (D1, Yonezawa Lab.)
CAS- 734 (Presentation -1) By : Vasudha Kapil
Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우.
2.5 Proofs Segments and Angles
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
CISC 2315 Discrete Structures Professor William G. Tanner, Jr. Spring 2011 Slides created by James L. Hein, author of Discrete Structures, Logic, and Computability,
9.4 Mathematical Induction
Lesson 4 Typed Arithmetic Typed Lambda Calculus 1/21/02 Chapters 8, 9, 10.
CSE-490 Logic in Computer Science The Coq Proof Assistant POSTECH Dec 15, 2006 박성우.
Logic in Computer Science - Overview Sep 1, 2009 박성우.
Correctness Proofs and Counter-model Generation with Authentication-Protocol Logic Koji Hasebe Mitsuhiro Okada Department of Philosophy, Keio University.
Logical Reasoning:Proof Prove the theorem using the basic axioms of algebra.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Thinking Mathematically Problem Solving and Critical Thinking.
Code-Carrying Theory Aytekin Vargun Rensselaer Polytechnic Institute.
Coq and Nuprl Wojciech Moczydłowski History World, type system Inductive types in Coq Extraction in Coq Other features of Coq.
12/9/20151 Programming Languages and Compilers (CS 421) Elsa L Gunter 2112 SC, UIUC Based in part on slides by Mattox.
Specifying Languages Our aim is to be able to specify languages for use in the computer. The sketch of an FSA is easy for us to understand, but difficult.
CSE-321 Programming Languages Review POSTECH June 14, 2011 박성우.
Advanced Formal Methods Lecture 4: Isabelle – Types and Terms Mads Dam KTH/CSC Course 2D1453, Some material from Paulson.
DPLL in Coq Zhuang Zhong Overview  Previous work  Stålmarck algorithm and Binary Decision Diagram  Produce traces of proof  Reconstruct.
Copyright Curt Hill Euler Circles With Venn Diagrams Thrown in for Good Measure.
1. Write a proof of the alternate exterior angles theorem.
2/6/20161 Programming Languages and Compilers (CS 421) Elsa L Gunter 2112 SC, UIUC Based in part on slides by Mattox.
CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우.
CS/APMA 202 Spring 2005 Aaron Bloomfield. Sequences in Nature
1 Interactive Computer Theorem Proving CS294-9 September 28, 2006 Adam Chlipala UC Berkeley Lecture 6: A Crash Course on Proof Automation.
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 November 30, 2006 Adam Chlipala UC Berkeley Lecture 14: Twelf.
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 Parametric Higher-Order Abstract Syntax for Mechanized Semantics Adam Chlipala Harvard University ICFP 2008.
Thoughts on Programming with Proof Assistants Adam Chlipala University of California, Berkeley PLPV Workshop.
4 Starting Tips to Keep Your Car in Top Condition
Lecture 9 : Universal Types
Lecture 2: Propositional and First-Order Logic
Lecture 11: Proof by Reflection
Lesson 5 Simple extensions of the typed lambda calculus
11.7 – Proof by Mathematical Induction
Section 2.1 Conditional Statements
Automata, Grammars and Languages
Negation-Limited Formulas
Lesson 4 Typed Arithmetic Typed Lambda Calculus
Lifting Propositional Interpolants to the Word-Level
CS 154, Lecture 4: Limitations on DFAs (I),
Typed Arithmetic Expressions
التعلم بالإكتشاف المراجع:
Mathematics for Computer Science MIT 6.042J/18.062J
Search techniques.
Presentation transcript:

Inductive Predicates  Unit vs True  Inductive unit : Set := tt : unit  Inductive True : Prop := I : True  Curry Howard Isomorphism  But Coq distinguish Proof and Program  Efficiency?  Proof Prevalence?

Propositional Logic  not = fun A : Prop => A -> False : Prop -> Prop  Inductive and (A : Prop) (B : Prop) : Prop := conj : A -> B -> A /\ B  Inductive or (A : Prop) (B : Prop) : Prop := or_introl : A -> A \/ B | or_intror : B -> A \/ B

Bool Vs Prop  bool is datatype of two members, true, false  Prop is primitive type in Coq, and True, False are two members in Prop  Coq use Constructive Logic, while P\/~P is not allowed  Issues  bool is decidable  Constructive logic allow us to extract program from proof  We can write program by proof a theorem, though maybe less efficient

First-Order Logic  forall and exists  forall is built-in  exists:  Inductive ex (A : Type) (P : A -> Prop) : Prop := ex_intro : forall x : A, P x -> ex P

Tactics  Tauto  Solve intuition logic, only unfold not  Intuition  Use tauto, and apply tactics  Intuition=intuition auto.  Firstorder  Extend tauto to firstorder logic  Trivial  Restricted auto  auto  Eauto  Auto using eapply, generate ‘_’

Basic dependant type  Inductive isZero : nat -> Prop := | IsZero : isZero 0.  Inductive even : nat -> Prop := | EvenO : even O | EvenSS : forall n, even n -> even (S (S n)).  Example of product: forall a:A,B (s,s’,s’’) 约束分类 (s,s’,s’)s,s’ {Set,Prop} 普通的类型 (Type,Prop,Prop) (s,Type,Type)Type denpends on a value (Type,Type,Type)High order type