hol
play

HOL 1 C ONTENT Intro & motivation, getting started with - PowerPoint PPT Presentation

NICTA Advanced Course Theorem Proving Principles, Techniques, Applications HOL 1 C ONTENT Intro & motivation, getting started with Isabelle Foundations & Principles Lambda Calculus Higher Order Logic, natural deduction


  1. NICTA Advanced Course Theorem Proving Principles, Techniques, Applications HOL 1

  2. C ONTENT ➜ Intro & motivation, getting started with Isabelle ➜ Foundations & Principles • Lambda Calculus • Higher Order Logic, natural deduction • Term rewriting ➜ Proof & Specification Techniques • Datatypes, recursion, induction • Inductively defined sets, rule induction • Calculational reasoning, mathematics style proofs • Hoare logic, proofs about programs C ONTENT 2

  3. L AST T IME ON HOL ➜ Proof rules for propositional and predicate logic L AST T IME ON HOL 3

  4. L AST T IME ON HOL ➜ Proof rules for propositional and predicate logic ➜ Safe and unsafe rules L AST T IME ON HOL 3- A

  5. L AST T IME ON HOL ➜ Proof rules for propositional and predicate logic ➜ Safe and unsafe rules ➜ Forward Proof L AST T IME ON HOL 3- B

  6. L AST T IME ON HOL ➜ Proof rules for propositional and predicate logic ➜ Safe and unsafe rules ➜ Forward Proof ➜ The Epsilon Operator L AST T IME ON HOL 3- C

  7. L AST T IME ON HOL ➜ Proof rules for propositional and predicate logic ➜ Safe and unsafe rules ➜ Forward Proof ➜ The Epsilon Operator ➜ Some automation L AST T IME ON HOL 3- D

  8. D EFINING H IGHER O RDER L OGIC 4

  9. W HAT IS H IGHER O RDER L OGIC ? ➜ Propositional Logic: • no quantifiers • all variables have type bool W HAT IS H IGHER O RDER L OGIC ? 5

  10. W HAT IS H IGHER O RDER L OGIC ? ➜ Propositional Logic: • no quantifiers • all variables have type bool ➜ First Order Logic: • quantification over values, but not over functions and predicates, • terms and formulas syntactically distinct W HAT IS H IGHER O RDER L OGIC ? 5- A

  11. W HAT IS H IGHER O RDER L OGIC ? ➜ Propositional Logic: • no quantifiers • all variables have type bool ➜ First Order Logic: • quantification over values, but not over functions and predicates, • terms and formulas syntactically distinct ➜ Higher Order Logic: • quantification over everything, including predicates • consistency by types • formula = term of type bool • definition built on λ → with certain default types and constants W HAT IS H IGHER O RDER L OGIC ? 5- B

  12. D EFINING H IGHER O RDER L OGIC Default types: bool D EFINING H IGHER O RDER L OGIC 6

  13. D EFINING H IGHER O RDER L OGIC Default types: bool ⇒ D EFINING H IGHER O RDER L OGIC 6- B

  14. D EFINING H IGHER O RDER L OGIC Default types: bool ind ⇒ D EFINING H IGHER O RDER L OGIC 6- C

  15. D EFINING H IGHER O RDER L OGIC Default types: bool ind ⇒ ➜ bool sometimes called o ➜ ⇒ sometimes called fun D EFINING H IGHER O RDER L OGIC 6- D

  16. D EFINING H IGHER O RDER L OGIC Default types: bool ind ⇒ ➜ bool sometimes called o ➜ ⇒ sometimes called fun Default Constants: D EFINING H IGHER O RDER L OGIC 6- E

  17. D EFINING H IGHER O RDER L OGIC Default types: bool ind ⇒ ➜ bool sometimes called o ➜ ⇒ sometimes called fun Default Constants: :: bool ⇒ bool ⇒ bool − → D EFINING H IGHER O RDER L OGIC 6- F

  18. D EFINING H IGHER O RDER L OGIC Default types: bool ind ⇒ ➜ bool sometimes called o ➜ ⇒ sometimes called fun Default Constants: :: bool ⇒ bool ⇒ bool − → = :: α ⇒ α ⇒ bool D EFINING H IGHER O RDER L OGIC 6- G

  19. D EFINING H IGHER O RDER L OGIC Default types: bool ind ⇒ ➜ bool sometimes called o ➜ ⇒ sometimes called fun Default Constants: :: bool ⇒ bool ⇒ bool − → = :: α ⇒ α ⇒ bool :: ( α ⇒ bool ) ⇒ α ǫ D EFINING H IGHER O RDER L OGIC 6- H

  20. H IGHER O RDER A BSTRACT S YNTAX Problem: Define syntax for binders like ∀ , ∃ , ε H IGHER O RDER A BSTRACT S YNTAX 7

  21. H IGHER O RDER A BSTRACT S YNTAX Problem: Define syntax for binders like ∀ , ∃ , ε One approach: ∀ :: var ⇒ term ⇒ bool Drawback: need to think about substitution, α conversion again. H IGHER O RDER A BSTRACT S YNTAX 7- A

  22. H IGHER O RDER A BSTRACT S YNTAX Problem: Define syntax for binders like ∀ , ∃ , ε One approach: ∀ :: var ⇒ term ⇒ bool Drawback: need to think about substitution, α conversion again. But: Already have binder, substitution, α conversion in meta logic λ H IGHER O RDER A BSTRACT S YNTAX 7- B

  23. H IGHER O RDER A BSTRACT S YNTAX Problem: Define syntax for binders like ∀ , ∃ , ε One approach: ∀ :: var ⇒ term ⇒ bool Drawback: need to think about substitution, α conversion again. But: Already have binder, substitution, α conversion in meta logic λ So: Use λ to encode all other binders. H IGHER O RDER A BSTRACT S YNTAX 7- C

  24. H IGHER O RDER A BSTRACT S YNTAX Example: ALL :: ( α ⇒ bool ) ⇒ bool HOAS usual syntax H IGHER O RDER A BSTRACT S YNTAX 8

  25. H IGHER O RDER A BSTRACT S YNTAX Example: ALL :: ( α ⇒ bool ) ⇒ bool HOAS usual syntax ALL ( λx. x = 2) H IGHER O RDER A BSTRACT S YNTAX 8- A

  26. H IGHER O RDER A BSTRACT S YNTAX Example: ALL :: ( α ⇒ bool ) ⇒ bool HOAS usual syntax ALL ( λx. x = 2) ∀ x. x = 2 H IGHER O RDER A BSTRACT S YNTAX 8- B

  27. H IGHER O RDER A BSTRACT S YNTAX Example: ALL :: ( α ⇒ bool ) ⇒ bool HOAS usual syntax ALL ( λx. x = 2) ∀ x. x = 2 ALL P H IGHER O RDER A BSTRACT S YNTAX 8- C

  28. H IGHER O RDER A BSTRACT S YNTAX Example: ALL :: ( α ⇒ bool ) ⇒ bool HOAS usual syntax ALL ( λx. x = 2) ∀ x. x = 2 ALL P ∀ x. P x H IGHER O RDER A BSTRACT S YNTAX 8- D

  29. H IGHER O RDER A BSTRACT S YNTAX Example: ALL :: ( α ⇒ bool ) ⇒ bool HOAS usual syntax ALL ( λx. x = 2) ∀ x. x = 2 ALL P ∀ x. P x Isabelle can translate usual binder syntax into HOAS. H IGHER O RDER A BSTRACT S YNTAX 8- E

  30. S IDE T RACK : S YNTAX D ECLARATIONS IN I SABELLE ➜ mixfix: consts drvbl :: ct ⇒ ct ⇒ fm ⇒ bool (” , ”) ⊢ Legal syntax now: Γ , Π ⊢ F S IDE T RACK : S YNTAX D ECLARATIONS IN I SABELLE 9

  31. S IDE T RACK : S YNTAX D ECLARATIONS IN I SABELLE ➜ mixfix: consts drvbl :: ct ⇒ ct ⇒ fm ⇒ bool (” , ”) ⊢ Legal syntax now: Γ , Π ⊢ F ➜ priorities: pattern can be annotated with priorities to indicate binding strength Example: drvbl :: ct ⇒ ct ⇒ fm ⇒ bool (” , ” [30 , 0 , 20] 60) ⊢ S IDE T RACK : S YNTAX D ECLARATIONS IN I SABELLE 9- A

  32. S IDE T RACK : S YNTAX D ECLARATIONS IN I SABELLE ➜ mixfix: consts drvbl :: ct ⇒ ct ⇒ fm ⇒ bool (” , ”) ⊢ Legal syntax now: Γ , Π ⊢ F ➜ priorities: pattern can be annotated with priorities to indicate binding strength Example: drvbl :: ct ⇒ ct ⇒ fm ⇒ bool (” , ” [30 , 0 , 20] 60) ⊢ ➜ infixl/infixr : short form for left/right associative binary operators Example: or :: bool ⇒ bool ⇒ bool ( infixr ” ∨ ” 30) S IDE T RACK : S YNTAX D ECLARATIONS IN I SABELLE 9- B

  33. S IDE T RACK : S YNTAX D ECLARATIONS IN I SABELLE ➜ mixfix: consts drvbl :: ct ⇒ ct ⇒ fm ⇒ bool (” , ”) ⊢ Legal syntax now: Γ , Π ⊢ F ➜ priorities: pattern can be annotated with priorities to indicate binding strength Example: drvbl :: ct ⇒ ct ⇒ fm ⇒ bool (” , ” [30 , 0 , 20] 60) ⊢ ➜ infixl/infixr : short form for left/right associative binary operators Example: or :: bool ⇒ bool ⇒ bool ( infixr ” ∨ ” 30) ➜ binders: declaration must be of the form c :: ( τ 1 ⇒ τ 2 ) ⇒ τ 3 ( binder ” B ” < p > ) B x. P x translated into c P (and vice versa) Example ALL :: ( α ⇒ bool ) ⇒ bool ( binder ” ∀ ” 10) S IDE T RACK : S YNTAX D ECLARATIONS IN I SABELLE 9- C

  34. S IDE T RACK : S YNTAX D ECLARATIONS IN I SABELLE ➜ mixfix: consts drvbl :: ct ⇒ ct ⇒ fm ⇒ bool (” , ”) ⊢ Legal syntax now: Γ , Π ⊢ F ➜ priorities: pattern can be annotated with priorities to indicate binding strength Example: drvbl :: ct ⇒ ct ⇒ fm ⇒ bool (” , ” [30 , 0 , 20] 60) ⊢ ➜ infixl/infixr : short form for left/right associative binary operators Example: or :: bool ⇒ bool ⇒ bool ( infixr ” ∨ ” 30) ➜ binders: declaration must be of the form c :: ( τ 1 ⇒ τ 2 ) ⇒ τ 3 ( binder ” B ” < p > ) B x. P x translated into c P (and vice versa) Example ALL :: ( α ⇒ bool ) ⇒ bool ( binder ” ∀ ” 10) More (including pretty printing) in Isabelle Reference Manual (7.3) S IDE T RACK : S YNTAX D ECLARATIONS IN I SABELLE 9- D

  35. B ACK TO HOL Base: bool , ⇒ , ind = , − → , ε And the rest is B ACK TO HOL 10

  36. B ACK TO HOL Base: bool , ⇒ , ind = , − → , ε And the rest is definitions: ≡ ( λx :: bool. x ) = ( λx. x ) True All P ≡ P = ( λx. True ) Ex P ≡ ∀ Q. ( ∀ x. P x − → Q ) − → Q False ≡ ∀ P. P ¬ P ≡ P − → False P ∧ Q ≡ ∀ R. ( P − → Q − → R ) − → R ≡ ∀ R. ( P − → R ) − → ( Q − → R ) − P ∨ Q → R If P x y ≡ SOME z. ( P = True − → z = x ) ∧ ( P = False − → z = y ) inj f ≡ ∀ x y. f x = f y − → x = y ≡ ∀ y. ∃ x. y = f x surj f B ACK TO HOL 10- A

  37. T HE A XIOMS OF HOL � x. f x = g x s = t P s ( λx. f x ) = ( λx. g x ) ext subst t = t refl P t T HE A XIOMS OF HOL 11

  38. T HE A XIOMS OF HOL � x. f x = g x s = t P s ( λx. f x ) = ( λx. g x ) ext subst t = t refl P t P = ⇒ Q P − → Q P mp → Q impI P − Q T HE A XIOMS OF HOL 11- A

  39. T HE A XIOMS OF HOL � x. f x = g x s = t P s ( λx. f x ) = ( λx. g x ) ext subst t = t refl P t P = ⇒ Q P − → Q P mp → Q impI P − Q → ( P = Q ) iff ( P − → Q ) − → ( Q − → P ) − T HE A XIOMS OF HOL 11- B

Recommend


More recommend