NICTA Advanced Course Theorem Proving Principles, Techniques, Applications
HOL
1
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
NICTA Advanced Course Theorem Proving Principles, Techniques, Applications
1
CONTENT
➜ Intro & motivation, getting started with Isabelle ➜ Foundations & Principles
➜ Proof & Specification Techniques
CONTENT 2
LAST TIME ON HOL
➜ Proof rules for propositional and predicate logic
LAST TIME ON HOL 3
LAST TIME ON HOL
➜ Proof rules for propositional and predicate logic ➜ Safe and unsafe rules
LAST TIME ON HOL 3-A
LAST TIME ON HOL
➜ Proof rules for propositional and predicate logic ➜ Safe and unsafe rules ➜ Forward Proof
LAST TIME ON HOL 3-B
LAST TIME ON HOL
➜ Proof rules for propositional and predicate logic ➜ Safe and unsafe rules ➜ Forward Proof ➜ The Epsilon Operator
LAST TIME ON HOL 3-C
LAST TIME ON HOL
➜ Proof rules for propositional and predicate logic ➜ Safe and unsafe rules ➜ Forward Proof ➜ The Epsilon Operator ➜ Some automation
LAST TIME ON HOL 3-D
DEFINING HIGHER ORDER LOGIC
4
WHAT IS HIGHER ORDER LOGIC?
➜ Propositional Logic:
WHAT IS HIGHER ORDER LOGIC? 5
WHAT IS HIGHER ORDER LOGIC?
➜ Propositional Logic:
➜ First Order Logic:
WHAT IS HIGHER ORDER LOGIC? 5-A
WHAT IS HIGHER ORDER LOGIC?
➜ Propositional Logic:
➜ First Order Logic:
➜ Higher Order Logic:
WHAT IS HIGHER ORDER LOGIC? 5-B
DEFINING HIGHER ORDER LOGIC
Default types:
bool
DEFINING HIGHER ORDER LOGIC 6
DEFINING HIGHER ORDER LOGIC
Default types:
bool ⇒
DEFINING HIGHER ORDER LOGIC 6-B
DEFINING HIGHER ORDER LOGIC
Default types:
bool ⇒ ind
DEFINING HIGHER ORDER LOGIC 6-C
DEFINING HIGHER ORDER LOGIC
Default types:
bool ⇒ ind
➜ bool sometimes called o ➜ ⇒ sometimes called fun
DEFINING HIGHER ORDER LOGIC 6-D
DEFINING HIGHER ORDER LOGIC
Default types:
bool ⇒ ind
➜ bool sometimes called o ➜ ⇒ sometimes called fun
Default Constants:
DEFINING HIGHER ORDER LOGIC 6-E
DEFINING HIGHER ORDER LOGIC
Default types:
bool ⇒ ind
➜ bool sometimes called o ➜ ⇒ sometimes called fun
Default Constants:
− → :: bool ⇒ bool ⇒ bool
DEFINING HIGHER ORDER LOGIC 6-F
DEFINING HIGHER ORDER LOGIC
Default types:
bool ⇒ ind
➜ bool sometimes called o ➜ ⇒ sometimes called fun
Default Constants:
− → :: bool ⇒ bool ⇒ bool = :: α ⇒ α ⇒ bool
DEFINING HIGHER ORDER LOGIC 6-G
DEFINING HIGHER ORDER LOGIC
Default types:
bool ⇒ ind
➜ bool sometimes called o ➜ ⇒ sometimes called fun
Default Constants:
− → :: bool ⇒ bool ⇒ bool = :: α ⇒ α ⇒ bool ǫ :: (α ⇒ bool) ⇒ α
DEFINING HIGHER ORDER LOGIC 6-H
HIGHER ORDER ABSTRACT SYNTAX
Problem: Define syntax for binders like ∀, ∃, ε
HIGHER ORDER ABSTRACT SYNTAX 7
HIGHER ORDER ABSTRACT SYNTAX
Problem: Define syntax for binders like ∀, ∃, ε One approach: ∀ :: var ⇒ term ⇒ bool Drawback: need to think about substitution, α conversion again.
HIGHER ORDER ABSTRACT SYNTAX 7-A
HIGHER ORDER ABSTRACT SYNTAX
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
HIGHER ORDER ABSTRACT SYNTAX 7-B
HIGHER ORDER ABSTRACT SYNTAX
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.
HIGHER ORDER ABSTRACT SYNTAX 7-C
HIGHER ORDER ABSTRACT SYNTAX
Example: ALL :: (α ⇒ bool) ⇒ bool HOAS usual syntax
HIGHER ORDER ABSTRACT SYNTAX 8
HIGHER ORDER ABSTRACT SYNTAX
Example: ALL :: (α ⇒ bool) ⇒ bool HOAS usual syntax ALL (λx. x = 2)
HIGHER ORDER ABSTRACT SYNTAX 8-A
HIGHER ORDER ABSTRACT SYNTAX
Example: ALL :: (α ⇒ bool) ⇒ bool HOAS usual syntax ALL (λx. x = 2) ∀x. x = 2
HIGHER ORDER ABSTRACT SYNTAX 8-B
HIGHER ORDER ABSTRACT SYNTAX
Example: ALL :: (α ⇒ bool) ⇒ bool HOAS usual syntax ALL (λx. x = 2) ∀x. x = 2 ALL P
HIGHER ORDER ABSTRACT SYNTAX 8-C
HIGHER ORDER ABSTRACT SYNTAX
Example: ALL :: (α ⇒ bool) ⇒ bool HOAS usual syntax ALL (λx. x = 2) ∀x. x = 2 ALL P ∀x. P x
HIGHER ORDER ABSTRACT SYNTAX 8-D
HIGHER ORDER ABSTRACT SYNTAX
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.
HIGHER ORDER ABSTRACT SYNTAX 8-E
SIDE TRACK: SYNTAX DECLARATIONS IN ISABELLE
➜ mixfix: consts drvbl :: ct ⇒ ct ⇒ fm ⇒ bool (” , ⊢ ”) Legal syntax now: Γ, Π ⊢ F
SIDE TRACK: SYNTAX DECLARATIONS IN ISABELLE 9
SIDE TRACK: SYNTAX DECLARATIONS IN ISABELLE
➜ 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)
SIDE TRACK: SYNTAX DECLARATIONS IN ISABELLE 9-A
SIDE TRACK: SYNTAX DECLARATIONS IN ISABELLE
➜ 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)
SIDE TRACK: SYNTAX DECLARATIONS IN ISABELLE 9-B
SIDE TRACK: SYNTAX DECLARATIONS IN ISABELLE
➜ 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)
SIDE TRACK: SYNTAX DECLARATIONS IN ISABELLE 9-C
SIDE TRACK: SYNTAX DECLARATIONS IN ISABELLE
➜ 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)
SIDE TRACK: SYNTAX DECLARATIONS IN ISABELLE 9-D
BACK TO HOL
Base: bool, ⇒, ind =, − →, ε And the rest is
BACK TO HOL 10
BACK TO HOL
Base: bool, ⇒, ind =, − →, ε And the rest is definitions: True ≡ (λx :: bool. x) = (λx. x) 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 P ∨ Q ≡ ∀R. (P − → R) − → (Q − → R) − → 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 surj f ≡ ∀y. ∃x. y = f x
BACK TO HOL 10-A
THE AXIOMS OF HOL
t = t refl s = t P s P t subst
(λx. f x) = (λx. g x) ext
THE AXIOMS OF HOL 11
THE AXIOMS OF HOL
t = t refl s = t P s P t subst
(λx. f x) = (λx. g x) ext P = ⇒ Q P − → Q impI P − → Q P Q mp
THE AXIOMS OF HOL 11-A
THE AXIOMS OF HOL
t = t refl s = t P s P t subst
(λx. f x) = (λx. g x) ext P = ⇒ Q P − → Q impI P − → Q P Q mp (P − → Q) − → (Q − → P) − → (P = Q) iff
THE AXIOMS OF HOL 11-B
THE AXIOMS OF HOL
t = t refl s = t P s P t subst
(λx. f x) = (λx. g x) ext P = ⇒ Q P − → Q impI P − → Q P Q mp (P − → Q) − → (Q − → P) − → (P = Q) iff P = True ∨ P = False True or False
THE AXIOMS OF HOL 11-C
THE AXIOMS OF HOL
t = t refl s = t P s P t subst
(λx. f x) = (λx. g x) ext P = ⇒ Q P − → Q impI P − → Q P Q mp (P − → Q) − → (Q − → P) − → (P = Q) iff P = True ∨ P = False True or False P ?x P (SOME x. P x) someI
THE AXIOMS OF HOL 11-D
THE AXIOMS OF HOL
t = t refl s = t P s P t subst
(λx. f x) = (λx. g x) ext P = ⇒ Q P − → Q impI P − → Q P Q mp (P − → Q) − → (Q − → P) − → (P = Q) iff P = True ∨ P = False True or False P ?x P (SOME x. P x) someI ∃f :: ind ⇒ ind. inj f ∧ ¬surj f infty
THE AXIOMS OF HOL 11-E
THAT’S IT.
➜ 3 basic constants ➜ 3 basic types ➜ 9 axioms
THAT’S IT. 12
THAT’S IT.
➜ 3 basic constants ➜ 3 basic types ➜ 9 axioms
With this you can define and derive all the rest.
THAT’S IT. 12-A
THAT’S IT.
➜ 3 basic constants ➜ 3 basic types ➜ 9 axioms
With this you can define and derive all the rest. Isabelle knows 2 more axioms: x = y x ≡ y eq reflection (THE x. x = a) = a the eq trivial
THAT’S IT. 12-B
DEMO: THE DEFINITIONS IN ISABELLE
13
DERIVING PROOF RULES
In the following, we will
DERIVING PROOF RULES 14
DERIVING PROOF RULES
In the following, we will
➜ look at the definitions in more detail
DERIVING PROOF RULES 14-A
DERIVING PROOF RULES
In the following, we will
➜ look at the definitions in more detail ➜ derive the traditional proof rules from the axioms in Isabelle
DERIVING PROOF RULES 14-B
DERIVING PROOF RULES
In the following, we will
➜ look at the definitions in more detail ➜ derive the traditional proof rules from the axioms in Isabelle
Convenient for deriving rules: named assumptions in lemmas lemma [name :] assumes [name1 :] ”< prop >1” assumes [name2 :] ”< prop >2” . . . shows ” < prop > ” < proof >
DERIVING PROOF RULES 14-C
DERIVING PROOF RULES
In the following, we will
➜ look at the definitions in more detail ➜ derive the traditional proof rules from the axioms in Isabelle
Convenient for deriving rules: named assumptions in lemmas lemma [name :] assumes [name1 :] ”< prop >1” assumes [name2 :] ”< prop >2” . . . shows ” < prop > ” < proof > proves: [ [ < prop >1; < prop >2; . . . ] ] = ⇒< prop >
DERIVING PROOF RULES 14-D
TRUE
consts True :: bool True ≡ (λx :: bool. x) = (λx. x) Intuition: right hand side is always true
TRUE 15
TRUE
consts True :: bool True ≡ (λx :: bool. x) = (λx. x) Intuition: right hand side is always true Proof Rules: True TrueI Proof: (λx :: bool. x) = (λx. x) refl True unfold True def
TRUE 15-A
DEMO
16
UNIVERSIAL QUANTIFIER
consts ALL :: (α ⇒ bool) ⇒ bool ALL P ≡ P = (λx. True)
UNIVERSIAL QUANTIFIER 17
UNIVERSIAL QUANTIFIER
consts ALL :: (α ⇒ bool) ⇒ bool ALL P ≡ P = (λx. True) Intuition:
➜ ALL P is Higher Order Abstract Syntax for ∀x. P x.
UNIVERSIAL QUANTIFIER 17-A
UNIVERSIAL QUANTIFIER
consts ALL :: (α ⇒ bool) ⇒ bool ALL P ≡ P = (λx. True) Intuition:
➜ ALL P is Higher Order Abstract Syntax for ∀x. P x. ➜ P is a function that takes an x and yields a truth values.
UNIVERSIAL QUANTIFIER 17-B
UNIVERSIAL QUANTIFIER
consts ALL :: (α ⇒ bool) ⇒ bool ALL P ≡ P = (λx. True) Intuition:
➜ ALL P is Higher Order Abstract Syntax for ∀x. P x. ➜ P is a function that takes an x and yields a truth values. ➜ ALL P should be true iff P yields true for all x, i.e. if it is equivalent to the function λx. True.
UNIVERSIAL QUANTIFIER 17-C
UNIVERSIAL QUANTIFIER
consts ALL :: (α ⇒ bool) ⇒ bool ALL P ≡ P = (λx. True) Intuition:
➜ ALL P is Higher Order Abstract Syntax for ∀x. P x. ➜ P is a function that takes an x and yields a truth values. ➜ ALL P should be true iff P yields true for all x, i.e. if it is equivalent to the function λx. True.
Proof Rules:
∀x. P x allI ∀x. P x P ?x = ⇒ R R allE Proof: Isabelle Demo
UNIVERSIAL QUANTIFIER 17-D
FALSE
consts False :: bool False ≡ ∀P.P
FALSE 18
FALSE
consts False :: bool False ≡ ∀P.P Intuition: Everything can be derived from False.
FALSE 18-A
FALSE
consts False :: bool False ≡ ∀P.P Intuition: Everything can be derived from False. Proof Rules: False P FalseE True = False Proof: Isabelle Demo
FALSE 18-B
NEGATION
consts Not :: bool ⇒ bool (¬ ) ¬P ≡ P − → False
NEGATION 19
NEGATION
consts Not :: bool ⇒ bool (¬ ) ¬P ≡ P − → False Intuition: Try P = True and P = False and the traditional truth table for − →.
NEGATION 19-A
NEGATION
consts Not :: bool ⇒ bool (¬ ) ¬P ≡ P − → False Intuition: Try P = True and P = False and the traditional truth table for − →. Proof Rules: A = ⇒ False ¬A notI ¬A A P notE Proof: Isabelle Demo
NEGATION 19-B
EXISTENTIAL QUANTIFIER
consts EX :: (α ⇒ bool) ⇒ bool EX P ≡ ∀Q. (∀x. P x − → Q) − → Q
EXISTENTIAL QUANTIFIER 20
EXISTENTIAL QUANTIFIER
consts EX :: (α ⇒ bool) ⇒ bool EX P ≡ ∀Q. (∀x. P x − → Q) − → Q Intuition:
➜ EX P is HOAS for ∃x. P x. (like ∀)
EXISTENTIAL QUANTIFIER 20-A
EXISTENTIAL QUANTIFIER
consts EX :: (α ⇒ bool) ⇒ bool EX P ≡ ∀Q. (∀x. P x − → Q) − → Q Intuition:
➜ EX P is HOAS for ∃x. P x. (like ∀) ➜ Right hand side is characterization of ∃ with ∀ and − →
EXISTENTIAL QUANTIFIER 20-B
EXISTENTIAL QUANTIFIER
consts EX :: (α ⇒ bool) ⇒ bool EX P ≡ ∀Q. (∀x. P x − → Q) − → Q Intuition:
➜ EX P is HOAS for ∃x. P x. (like ∀) ➜ Right hand side is characterization of ∃ with ∀ and − → ➜ Note that inner ∀ binds wide: (∀x. P x − → Q)
EXISTENTIAL QUANTIFIER 20-C
EXISTENTIAL QUANTIFIER
consts EX :: (α ⇒ bool) ⇒ bool EX P ≡ ∀Q. (∀x. P x − → Q) − → Q Intuition:
➜ EX P is HOAS for ∃x. P x. (like ∀) ➜ Right hand side is characterization of ∃ with ∀ and − → ➜ Note that inner ∀ binds wide: (∀x. P x − → Q) ➜ Remember lemma from last time: (∀x. P x − → Q) = ((∃x. P x) − → Q)
EXISTENTIAL QUANTIFIER 20-D
EXISTENTIAL QUANTIFIER
consts EX :: (α ⇒ bool) ⇒ bool EX P ≡ ∀Q. (∀x. P x − → Q) − → Q Intuition:
➜ EX P is HOAS for ∃x. P x. (like ∀) ➜ Right hand side is characterization of ∃ with ∀ and − → ➜ Note that inner ∀ binds wide: (∀x. P x − → Q) ➜ Remember lemma from last time: (∀x. P x − → Q) = ((∃x. P x) − → Q)
Proof Rules: P ?x ∃x. P x exI ∃x. P x
⇒ R R exE Proof: Isabelle Demo
EXISTENTIAL QUANTIFIER 20-E
CONJUNCTION
consts And :: bool ⇒ bool ⇒ bool ( ∧ ) P ∧ Q ≡ ∀R. (P − → Q − → R) − → R
CONJUNCTION 21
CONJUNCTION
consts And :: bool ⇒ bool ⇒ bool ( ∧ ) P ∧ Q ≡ ∀R. (P − → Q − → R) − → R Intuition:
➜ Mirrors proof rules for ∧
CONJUNCTION 21-A
CONJUNCTION
consts And :: bool ⇒ bool ⇒ bool ( ∧ ) P ∧ Q ≡ ∀R. (P − → Q − → R) − → R Intuition:
➜ Mirrors proof rules for ∧ ➜ Try truth table for P, Q, and R
CONJUNCTION 21-B
CONJUNCTION
consts And :: bool ⇒ bool ⇒ bool ( ∧ ) P ∧ Q ≡ ∀R. (P − → Q − → R) − → R Intuition:
➜ Mirrors proof rules for ∧ ➜ Try truth table for P, Q, and R
Proof Rules: A B A ∧ B conjI A ∧ B [ [A; B] ] = ⇒ C C conjE Proof: Isabelle Demo
CONJUNCTION 21-C
DISJUNCTION
consts Or :: bool ⇒ bool ⇒ bool ( ∨ ) P ∨ Q ≡ ∀R. (P − → R) − → (Q − → R) − → R
DISJUNCTION 22
DISJUNCTION
consts Or :: bool ⇒ bool ⇒ bool ( ∨ ) P ∨ Q ≡ ∀R. (P − → R) − → (Q − → R) − → R Intuition:
➜ Mirrors proof rules for ∨ (case distinction)
DISJUNCTION 22-A
DISJUNCTION
consts Or :: bool ⇒ bool ⇒ bool ( ∨ ) P ∨ Q ≡ ∀R. (P − → R) − → (Q − → R) − → R Intuition:
➜ Mirrors proof rules for ∨ (case distinction) ➜ Try truth table for P, Q, and R
DISJUNCTION 22-B
DISJUNCTION
consts Or :: bool ⇒ bool ⇒ bool ( ∨ ) P ∨ Q ≡ ∀R. (P − → R) − → (Q − → R) − → R Intuition:
➜ Mirrors proof rules for ∨ (case distinction) ➜ Try truth table for P, Q, and R
Proof Rules: A A ∨ B B A ∨ B disjI1/2 A ∨ B A = ⇒ C B = ⇒ C C disjE Proof: Isabelle Demo
DISJUNCTION 22-C
IF-THEN-ELSE
consts If :: bool ⇒ α ⇒ α ⇒ α (if then else ) If P x y ≡ SOME z. (P = True − → z = x) ∧ (P = False − → z = y)
IF-THEN-ELSE 23
IF-THEN-ELSE
consts If :: bool ⇒ α ⇒ α ⇒ α (if then else ) If P x y ≡ SOME z. (P = True − → z = x) ∧ (P = False − → z = y) Intuition:
➜ for P = True, right hand side collapses to SOME z. z = x
IF-THEN-ELSE 23-A
IF-THEN-ELSE
consts If :: bool ⇒ α ⇒ α ⇒ α (if then else ) If P x y ≡ SOME z. (P = True − → z = x) ∧ (P = False − → z = y) Intuition:
➜ for P = True, right hand side collapses to SOME z. z = x ➜ for P = False, right hand side collapses to SOME z. z = y
IF-THEN-ELSE 23-B
IF-THEN-ELSE
consts If :: bool ⇒ α ⇒ α ⇒ α (if then else ) If P x y ≡ SOME z. (P = True − → z = x) ∧ (P = False − → z = y) Intuition:
➜ for P = True, right hand side collapses to SOME z. z = x ➜ for P = False, right hand side collapses to SOME z. z = y
Proof Rules: if True then s else t = s ifTrue if False then s else t = t ifFalse Proof: Isabelle Demo
IF-THEN-ELSE 23-C
THAT WAS HOL
24
MORE ON AUTOMATION
Last time: safe and unsafe rule, heuristics: use safe before unsafe
MORE ON AUTOMATION 25
MORE ON AUTOMATION
Last time: safe and unsafe rule, heuristics: use safe before unsafe This can be automated
MORE ON AUTOMATION 25-A
MORE ON AUTOMATION
Last time: safe and unsafe rule, heuristics: use safe before unsafe This can be automated Syntax: [<kind>!] for safe rules (<kind> one of intro, elim, dest) [<kind>] for unsafe rules
MORE ON AUTOMATION 25-C
MORE ON AUTOMATION
Last time: safe and unsafe rule, heuristics: use safe before unsafe This can be automated Syntax: [<kind>!] for safe rules (<kind> one of intro, elim, dest) [<kind>] for unsafe rules Application (roughly): do safe rules first, search/backtrack on unsafe rules only
MORE ON AUTOMATION 25-D
MORE ON AUTOMATION
Last time: safe and unsafe rule, heuristics: use safe before unsafe This can be automated Syntax: [<kind>!] for safe rules (<kind> one of intro, elim, dest) [<kind>] for unsafe rules Application (roughly): do safe rules first, search/backtrack on unsafe rules only Example: declare attribute globally declare conjI [intro!] allE [elim] remove attribute gloabllay declare allE [rule del] use locally apply (blast intro: someI) delete locally apply (blast del: conjI)
MORE ON AUTOMATION 25-E
DEMO: AUTOMATION
26
WE HAVE LEARNED TODAY ...
➜ Defining HOL
WE HAVE LEARNED TODAY ... 27
WE HAVE LEARNED TODAY ...
➜ Defining HOL ➜ Higher Order Abstract Syntax
WE HAVE LEARNED TODAY ... 27-A
WE HAVE LEARNED TODAY ...
➜ Defining HOL ➜ Higher Order Abstract Syntax ➜ Deriving proof rules
WE HAVE LEARNED TODAY ... 27-B
WE HAVE LEARNED TODAY ...
➜ Defining HOL ➜ Higher Order Abstract Syntax ➜ Deriving proof rules ➜ More automation
WE HAVE LEARNED TODAY ... 27-C
EXERCISES
➜ derive the classical contradiction rule (¬P = ⇒ False) = ⇒ P in Isabelle ➜ define nor and nand in Isabelle ➜ show nor x x = nand x x ➜ derive safe intro and elim rules for them ➜ use these in an automated proof of nor x x = nand x x
EXERCISES 28