1 / 20

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

torie
Download Presentation

Isabelle / HOL Theorem Proving System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. 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

  3. 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

  4. 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? Isabelle / HOL

  5. Isabelle / HOL first taste (contd.) • (*Functions on lists*) • primrecconcat :: "'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. Isabelle / HOL

  6. Proof: rev (rev list) = list Generate subgoals Simplified Simplified … theoremrev_rev [simp]: "rev(rev xs) = xs” apply(induct_tacxs) (*Apply induction tactic*) apply(auto) (*Try to solve “automatically” using simplifier) … Isabelle / HOL

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

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

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

  10. Theorem proving terminologies Isabelle / HOL

  11. 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

  12. Natural deduction: Inference rules Conjunction elim. Conjunctionintro. Disjunction elim. Disjunctionintro. Implication elim. (modus pones !) Implicationintro. Isabelle / HOL

  13. Natural deduction (contd.) Universal quantifierintro. Universal quantifierelim. Existential quantifierintro. Existential quantifierelim. Isabelle / HOL

  14. Proof: P v Q => Q v P • lemma disj_swap: "P v Q => Q v P" • apply (eruledisjE) • 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) • apply assumption • done Applies disjunction elim. rule: • Applies disjunction intro. rule (2) : Isabelle / HOL

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

  16. Proof: P v Q => Q v P • Demo Isabelle / HOL

  17. 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

  18. 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

  19. Acknowledgements • The author is grateful to TianZhang, Eden Burton and BojanNokovic (ITB 206) for their very useful feedbacks while preparing this presentation. Create your first workbook

  20. The End • Comments? • Questions? Isabelle / HOL

More Related