Isabelle / HOL Theorem Proving System

Slides:



Advertisements
Similar presentations
Inference in First-Order Logic
Advertisements

Some Prolog Prolog is a logic programming language
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
1 Logic Programming School of Informatics, University of Edinburgh Logic Programming in 50 Minutes The purpose of this lecture is to explain why logic.
Mathematical Induction (cont.)
1 Section 1.5 Rules of Inference. 2 Definitions Theorem: a statement that can be shown to be true Proof: demonstration of truth of theorem –consists of.
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Proofs and Programs Wei Hu 11/01/2007. Outline  Motivation  Theory  Lambda calculus  Curry-Howard Isomorphism  Dependent types  Practice  Coq Wei.
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
Artificial Intelligence Inference in first-order logic Fall 2008 professor: Luigi Ceccaroni.
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
Deduction In addition to being able to represent facts, or real- world statements, as formulas, we want to be able to manipulate facts, e.g., derive new.
An Integration of Program Analysis and Automated Theorem Proving Bill J. Ellis & Andrew Ireland School of Mathematical & Computer Sciences Heriot-Watt.
Advanced Formal Methods Lecture 6: Isabelle - HOL Mads Dam KTH/CSC Course 2D1453, Material from L. Paulson.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
Case Study: Using PVS to Analyze Security Protocols Kyle Taylor.
Proving Facts About Programs With a Proof Assistant John Wallerius An Example From: Isabelle/HOL, A Proof Assistant for Higher Order Logic, By T. Nipkow,
Advanced Formal Methods Lecture 7: Isabelle – Sets Mads Dam KTH/CSC Course 2D1453, Material from L. Paulson.
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.
Discrete Mathematics and its Applications
CAS- 734 (Presentation -1) By : Vasudha Kapil
© Andrew IrelandDependable Systems Group Proof Automation for the SPARK Approach to High Integrity Ada Andrew Ireland Computing & Electrical Engineering.
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.
Discrete Mathematics CS 2610 August 24, Agenda Last class Introduction to predicates and quantifiers This class Nested quantifiers Proofs.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
Type Safety Kangwon National University 임현승 Programming Languages.
Towards Automatic Verification of Safety Architectures Carsten Schürmann Carnegie Mellon University April 2000.
Computing & Information Sciences Kansas State University Wednesday, 20 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 12 of 42 Wednesday, 20 September.
Advanced Formal Methods Lecture 5: Isabelle – Proofs and Rewriting Mads Dam KTH/CSC Course 2D1453, Some slides from Paulson.
CSE-490 Logic in Computer Science The Coq Proof Assistant POSTECH Dec 15, 2006 박성우.
Logic in Computer Science - Overview Sep 1, 2009 박성우.
Natural Deduction CS 270 Math Foundations of CS Jeremy Johnson.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 13 of 41 Monday, 20 September.
Computing & Information Sciences Kansas State University Lecture 13 of 42 CIS 530 / 730 Artificial Intelligence Lecture 13 of 42 William H. Hsu Department.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 12 Friday, 17 September.
Natural Deduction System for First Order Logic Student: Wei Lei Instructor: W. M. Farmer Department of Computing and Software McMaster University, Hamilton,
The Exciting World of Natural Deduction!!! By: Dylan Kane Jordan Bradshaw Virginia Walker.
9/30/98 Prof. Richard Fikes Inference In First Order Logic Computer Science Department Stanford University CS222 Fall 1998.
Computing & Information Sciences Kansas State University Lecture 14 of 42 CIS 530 / 730 Artificial Intelligence Lecture 14 of 42 William H. Hsu Department.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Automated Reasoning Early AI explored how to automate several reasoning tasks – these were solved by what we might call weak problem solving methods as.
© Andrew IrelandDependable Systems Group Proof Automation for the SPARK Approach to High Integrity Ada Andrew Ireland Computing & Electrical Engineering.
Computing & Information Sciences Kansas State University Monday, 25 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 14 of 42 Monday, 25 September.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 14 of 41 Wednesday, 22.
CS6133 Software Specification and Verification
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 15 of 41 Friday 24 September.
Computing & Information Sciences Kansas State University Lecture 15 of 42 CIS 530 / 730 Artificial Intelligence Lecture 15 of 42 William H. Hsu Department.
Artificial Intelligence 7. Making Deductive Inferences Course V231 Department of Computing Imperial College, London Jeremy Gow.
Advanced Formal Methods Lecture 4: Isabelle – Types and Terms Mads Dam KTH/CSC Course 2D1453, Some material from Paulson.
Computing & Information Sciences Kansas State University Lecture 12 of 42 CIS 530 / 730 Artificial Intelligence Lecture 12 of 42 William H. Hsu Department.
Logic: Proof procedures, soundness and correctness CPSC 322 – Logic 2 Textbook §5.2 March 7, 2011.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
1 Lecture 5 PVS commands. 2 Last week Logical formalisms, first-order logic (syntax, semantics). Introduction to PVS. Language of PVS. Proving sequents.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 14 of 42 Wednesday, 22.
Integrating Math Units and Proof Checking for Specification and Verification SAVCBS Workshop 2008 SIGSOFT 2008 / FSE 16 November 9th, 2008 Hampton Smith.
Lecture 1.3: Predicate Logic, and Rules of Inference* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
The Logic of Conditionals Chapter 8 Language, Proof and Logic.
COMP 412, FALL Type Systems C OMP 412 Rice University Houston, Texas Fall 2000 Copyright 2000, Robert Cartwright, all rights reserved. Students.
COMP 170 L2 Page 1 Review for Midterm 2 Part II: Number Theory and Cryptography L06: RSA Part III: Logic L07, L08, L09 Part IV: Induction and Recurrence.
Computing & Information Sciences Kansas State University Monday, 18 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 11 of 42 Monday, 18 September.
1 Interactive Computer Theorem Proving CS294-9 September 7, 2006 Adam Chlipala UC Berkeley Lecture 3: Data structures and Induction.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Revisiting Predicate Logic LN chapters 3,4
Natural deduction Gerhard Gentzen.
CS 270 Math Foundations of CS
PROGRAMMING IN HASKELL
Presentation transcript:

Isabelle / HOL Theorem Proving System Quang M. Tran E-mail: tranqm@mcmaster.ca Isabelle / HOL Theorem Proving System Course: CAS760 Logic for Practical Use Instructor: Dr. William M. Farmer Department of Computing and Software McMaster University, ON, Hamilton, Canada

Outline History overview Isabelle / HOL first taste: screenshot + Prove: rev (rev list) = list Isabelle / HOL: big picture + terminologies Natural deduction: Prove P v Q => Q v P Isabelle classical reasoner References + Conclusion Conclusion Isabelle / HOL

History: All started with Robin Milner British computer scientist. 1972: Milner developed proof checker for Scott’s “Logic for Computable Functions” (LCF) at Stanford (known as “Stanford LCF” ). 1973: Milner moved to Edinburgh and started the successor project “LCF Edinburgh”. ML language is born in this time. 1981: Mike Gordon joined Cambridge and HOL was born. 1990s: Larry Paulson developed Isabelle. Milner Paulson Isabelle / HOL

Isabelle / HOL first taste : Fun with (Toy)List (*ToyList.thy*) theory ToyList imports Datatype begin (*Datatype of list*) datatype 'a list = Nil ("[]") | Cons 'a "'a list" (infixr ":" 65) … (contd. next slide) CAS760: list as inductive data type, remember? Syntax annotation Official syntax [] Nil 10 : [] Cons 10 Nil 15 : 10 : [] Cons 15 (Cons 10 Nil) Isabelle / HOL

Isabelle / HOL first taste (contd.) (*Functions on lists*) primrec concat :: "'a list => 'a list => 'a list" (infixr “++" 65) where "[] ++ ys = ys" | "(x : xs) ++ ys = x : (xs ++ ys)“ primrec rev :: "'a list => 'a list" where "rev [] = [] " | "rev (x : xs) = (rev xs) ++ (x : [])" “++” is defined by primitive recursion. Syntax annotation Official syntax (10 : []) ++ [] concat (Cons 10 Nil) Nil (10 : []) ++ (5 : []) concat (Cons 10 Nil) (5 : Nil) Isabelle / HOL

Proof: rev (rev list) = list Main goal: rev(rev xs) = xs Subgoal 1: rev (rev []) = [] Simplifier can solve it: rev (rev []) = rev [] = [] Done! Subgoal 2: Forall a list. rev (rev list) = list => rev (rev (a : list)) = a : list Simplifier reduces to subgoal 2.1: Forall a list. rev (rev list) = list => rev (rev list ++ a : []) = a : list Generate subgoals Simplified Simplified … theorem rev_rev [simp]: "rev(rev xs) = xs” apply(induct_tac xs) (*Apply induction tactic*) apply(auto) (*Try to solve “automatically” using simplifier) Isabelle / HOL

Proof (contd.) We need a lemma rev (xs ++ ys) = (rev ys) ++ (rev xs) Subgoal 1: rev ([] ++ ys) = rev ys ++ rev [] Subgoal 2: Forall a list. rev (list ++ ys) = rev ys ++ rev list => rev ((a : list) ++ ys) = rev ys ++ rev (a : list) a list. rev (list ++ ys) = rev ys ++ rev list => (rev ys ++ rev list) ++ a : [] = rev ys ++ rev list ++ a : [] Find subgoals … lemma rev_app [simp]: "rev(xs ++ ys) = (rev ys) ++ (rev xs)" apply(induct_tac xs) (*Apply induction tactic on xs*) apply(auto) (*Try to solve “automatically” using simplifier) Isabelle / HOL

Complete Proof: rev(rev list) = list … lemma app_assoc [simp]: "(xs ++ ys) ++ zs = xs ++ (ys ++ zs)" apply(induct_tac xs) apply(auto) done lemma app_Nil2 [simp]: "xs ++ [] = xs" lemma rev_app [simp]: "rev(xs ++ ys) = (rev ys) ++ (rev xs)" theorem rev_rev [simp]: "rev(rev xs) = xs" We need to prove 3 supporting lemmas , i.e. “Backward” proof This is the theorem what we want to prove Isabelle / HOL

Isabelle: big picture Proof General For Isabelle Isabelle / HOL (X)Emacs GUI for theorem provers A concrete Isabelle instance for Higher- Order-Logic (HOL) Proof General For Isabelle Isabelle / ZF Isabelle / HOL Isabelle / Your Logic Here Provides a generic infrastructure to develop theorem provers. Isabelle Isabelle / HOL

Theorem proving terminologies Meaning Examples Theorem The formula we want to prove rev (rev list) = list Lemma Supporting (sub)theorems for proving the target theorem rev (xs ++ ys) = (rev ys) ++ (rev xs) Tactic Produces subgoals from a goal apply(induct_tac) Simplification The process of simplifying a term / formula by repeated application of rewrite rules rev (rev []) = rev [] = [] Isabelle / HOL

Natural deduction By the German mathematician and logician Gentzen. Motivation: Logical formalism that occurs “naturally” (closely to human reasoning). Assume: “If pigs can fly, then there are green men on Mars” is true. You see a pig flies in Hamilton? Then there are green men on Mars! Gentzen Modus Ponens. This is true for arbitrary P, Q Isabelle / HOL

Natural deduction: Inference rules Introduction (intro.) Elimination (elim.) Conjunction elim. Conjunction intro. Disjunction intro. Disjunction elim. Implication elim. (modus pones !) Implication intro. Isabelle / HOL

Natural deduction (contd.) Introduction (intro.) Elimination (elim.) Existential quantifier intro. Existential quantifier elim. Universal quantifier intro. Universal quantifier elim. Isabelle / HOL

Proof: P v Q => Q v P lemma disj_swap: "P v Q => Q v P" Applies disjunction elim. rule: lemma disj_swap: "P v Q => Q v P" apply (erule disjE) Subgoals: P => Q v P (1) Q => Q v P (2) apply (rule disjI2) Subgoal: P => P apply assumption (*Likewise for (2)*) apply (rule disjI1) done Applies disjunction intro. rule (2) : Isabelle / HOL

Isabelle’s classical reasoner Working with primitive rules like before are tedious. Classical reasoner = a family of tools that perform proofs automatically. Examples: blast method. lemma disj_swap2: "P v Q => Q v P" apply (blast) No subgoals! Done! “blast“ can solve this automatically Isabelle / HOL

Proof: P v Q => Q v P Demo Isabelle / HOL

References Isabelle newcomers: A Proof Assistant for Higher-Order Logic, written by Isabelle authors e.g. C. Paulson, online PDF available. Historical development: From LCF to HOL: a short history , Mike Gordon and The next 700 Theorem Provers, C. Paulson. Theorem prover design techniques: Design a Theorem Prover, C. Paulson. Isabelle / HOL

Conclusion: Should I bother with Isabelle? If you need computer-aided proofs, e.g. formal verification. If you want to deepen your knowledge in logics / mathematics / functional programming. If you have interest in mechanizing mathematics. … then the answer is Yes. Isabelle can be used as a tool to get work done or simply a platform to experiment and study. Isabelle / HOL

Create your first workbook Acknowledgements The author is grateful to Tian Zhang, Eden Burton and Bojan Nokovic (ITB 206) for their very useful feedbacks while preparing this presentation. Create your first workbook

The End Comments? Questions? Isabelle / HOL