Natural Deduction in ISABELLE: - ``Single-step proofs based on ...
Natural Deduction in ISABELLE: - ``Single-step proofs based on ...
Natural Deduction in ISABELLE: - ``Single-step proofs based on ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g>:<br />
“S<str<strong>on</strong>g>in</str<strong>on</strong>g>gle-<str<strong>on</strong>g>step</str<strong>on</strong>g> <str<strong>on</strong>g>proofs</str<strong>on</strong>g> <str<strong>on</strong>g>based</str<strong>on</strong>g> <strong>on</strong> Sequent Notati<strong>on</strong> ”<br />
Joaquín AGuado 1<br />
1 Informatics Theory Group (GdI)<br />
University of Bamberg<br />
joaqu<str<strong>on</strong>g>in</str<strong>on</strong>g>.aguado@wiai.uni-bamberg.de<br />
University of Sheffield,<br />
August 17, 2007<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 1 / 56
Outl<str<strong>on</strong>g>in</str<strong>on</strong>g>e<br />
1 MA-101: Logic<br />
Lecture (Vorlesung)<br />
Tutorial (Übung)<br />
Laboratory (Praktikum)<br />
2 The Gospel of Isabelle<br />
She who Rules, Unifies . . .<br />
And this is Her Resoluti<strong>on</strong>:<br />
Lift Up the St<strong>on</strong>e, and You will F<str<strong>on</strong>g>in</str<strong>on</strong>g>d Me There<br />
3 Isis Bella<br />
Variati<strong>on</strong>s <strong>on</strong> Resoluti<strong>on</strong><br />
More Methods and Commands<br />
Examples<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 2 / 56
Formal Logic<br />
Generally, a Logic is captured by a Formal System c<strong>on</strong>sist<str<strong>on</strong>g>in</str<strong>on</strong>g>g of two<br />
comp<strong>on</strong>ents:<br />
1 A Formal Language:<br />
A f<str<strong>on</strong>g>in</str<strong>on</strong>g>ite set of symbols which can be used for c<strong>on</strong>struct<str<strong>on</strong>g>in</str<strong>on</strong>g>g formulae<br />
(signature Σ, sorted family of variables X).<br />
A way of c<strong>on</strong>struct<str<strong>on</strong>g>in</str<strong>on</strong>g>g well-formed-formulas: Term Σ (X), Atom Σ (X) and<br />
Form Σ (X) (e.g., grammars, syntax rules).<br />
2 A Proof System:<br />
A particular set of rules.<br />
General pr<str<strong>on</strong>g>in</str<strong>on</strong>g>ciples <strong>on</strong> of how rules are grafted together to build trees<br />
(called derivati<strong>on</strong>s).<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 3 / 56
The Language: A Signature for Lists<br />
ToyList<br />
Σ = (S, OP, REL)<br />
S = {a, list}<br />
OP = { nil : list,<br />
c<strong>on</strong>s: a list 7→ list,<br />
app: list list 7→ list,<br />
rev: list 7→ list }<br />
REL = { is <str<strong>on</strong>g>in</str<strong>on</strong>g>: ha listi,<br />
sublist: hlist listi }<br />
X = {x : a, xs : list}<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 4 / 56
The Language: FOL Syntax<br />
Well-Formed Terms (i.e., Term Σ(X)):<br />
x 2 X s<br />
(T1)<br />
x : s<br />
t 1 : s 1 t 2 : s 2 . . . t n : s n f : s 1 s 2 . . . s n → s 2 OP<br />
f(t 1 , t 2 , . . . , t n ) : s<br />
(T2)<br />
Well-Formed (Atomic) Formulas (i.e., Atom Σ(X)):<br />
(A1)<br />
> : hi<br />
(A1)<br />
: hi<br />
t 1 : s t 2 : s<br />
t 1 = t 2 : hi<br />
(A2)<br />
t 1 : s 1 t 2 : s 2 . . . t n : s n R : hs 1 s 2 . . . s n i 2 REL<br />
R(t 1 , t 2 , . . . , t n ) : hi<br />
Well-Formed Formulas (i.e., Form Σ(X)):<br />
(A3)<br />
ϕ : hi ψ : hi<br />
(ϕ ∧ ψ) : hi<br />
(F1)<br />
ϕ : hi ψ : hi<br />
(ϕ ∨ ψ) : hi<br />
(F1)<br />
ϕ : hi ψ : hi<br />
(ϕ → ψ) : hi<br />
(F1)<br />
ϕ : hi ψ : hi<br />
(ϕ ↔ ψ) : hi<br />
(F1)<br />
ϕ : hi<br />
(¬ϕ) : hi<br />
(F2)<br />
x 2 X ϕ : hi<br />
(8x ϕ) : hi<br />
(F3)<br />
x 2 X ϕ : hi<br />
(9x ϕ) : hi<br />
(F3)<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 5 / 56
The Language: A Well-Formed Formula<br />
x : a xs : list is <str<strong>on</strong>g>in</str<strong>on</strong>g> : ha listi 2 REL<br />
is <str<strong>on</strong>g>in</str<strong>on</strong>g>(x, xs) : hi<br />
(A 3 )<br />
x : a<br />
xs : list<br />
rev : list 7→ list 2 OP<br />
(T 2 )<br />
rev(xs) : list<br />
is <str<strong>on</strong>g>in</str<strong>on</strong>g>(x, rev(xs)) : hi<br />
is <str<strong>on</strong>g>in</str<strong>on</strong>g> : ha listi 2 REL<br />
(A 3 )<br />
xs 2 X<br />
is <str<strong>on</strong>g>in</str<strong>on</strong>g>(x, xs) : hi is <str<strong>on</strong>g>in</str<strong>on</strong>g>(x, rev(xs)) : hi<br />
x 2 X is <str<strong>on</strong>g>in</str<strong>on</strong>g>(x, xs) → is <str<strong>on</strong>g>in</str<strong>on</strong>g>(x, rev(xs)) : hi<br />
9x is <str<strong>on</strong>g>in</str<strong>on</strong>g>(x, xs) → is <str<strong>on</strong>g>in</str<strong>on</strong>g>(x, rev(xs)) : hi<br />
8xs 9x is <str<strong>on</strong>g>in</str<strong>on</strong>g>(x, xs) → is <str<strong>on</strong>g>in</str<strong>on</strong>g>(x, rev(xs)) : hi<br />
(F 1 )<br />
(F 3 )<br />
(F 3 )<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 6 / 56
Semantics, Meta-logical Approach & Motivati<strong>on</strong><br />
Logic maybe formulated abstractly by its own sake, but it usually has an<br />
<str<strong>on</strong>g>in</str<strong>on</strong>g>tended <str<strong>on</strong>g>in</str<strong>on</strong>g>terpretati<strong>on</strong> represent<str<strong>on</strong>g>in</str<strong>on</strong>g>g a descripti<strong>on</strong> of some doma<str<strong>on</strong>g>in</str<strong>on</strong>g> of<br />
<str<strong>on</strong>g>in</str<strong>on</strong>g>terest (Semantics).<br />
A Meta-logic is a logic that is used to formalise syntax, proof system,<br />
semantics and meta-properties (soundness, completeness) of another logic<br />
called the object-logic.<br />
Here we will focus <strong>on</strong> the deductive mach<str<strong>on</strong>g>in</str<strong>on</strong>g>ery and implicitly assume<br />
syntax, semantics and meta-theorems.<br />
Mechanis<str<strong>on</strong>g>in</str<strong>on</strong>g>g Logical <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> (Motivati<strong>on</strong>)<br />
By formalis<str<strong>on</strong>g>in</str<strong>on</strong>g>g patterns of reas<strong>on</strong><str<strong>on</strong>g>in</str<strong>on</strong>g>g, it is possible for such reas<strong>on</strong><str<strong>on</strong>g>in</str<strong>on</strong>g>g to be<br />
checked or even carried out by a computer.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 7 / 56
Proof System: <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g><br />
Isabelle is a generic (<str<strong>on</strong>g>in</str<strong>on</strong>g>teractive) theorem prover designed around <str<strong>on</strong>g>Natural</str<strong>on</strong>g><br />
<str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g>. It has been <str<strong>on</strong>g>in</str<strong>on</strong>g>stantiated to support reas<strong>on</strong><str<strong>on</strong>g>in</str<strong>on</strong>g>g <str<strong>on</strong>g>in</str<strong>on</strong>g> several<br />
object-logics.<br />
<str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> is an approach to Proof Theory that attempts to<br />
provide a formal model of logical reas<strong>on</strong><str<strong>on</strong>g>in</str<strong>on</strong>g>g as it “naturally” occurs.<br />
we make (temporary) assumpti<strong>on</strong>s.<br />
we derive new formulae by apply<str<strong>on</strong>g>in</str<strong>on</strong>g>g basic rules.<br />
there is a mechanism for discharg<str<strong>on</strong>g>in</str<strong>on</strong>g>g assumpti<strong>on</strong>.<br />
S<str<strong>on</strong>g>in</str<strong>on</strong>g>ce the logic’s syntax and the <str<strong>on</strong>g>in</str<strong>on</strong>g>ference rules are specified declaratively,<br />
this allows s<str<strong>on</strong>g>in</str<strong>on</strong>g>gle-<str<strong>on</strong>g>step</str<strong>on</strong>g> proof c<strong>on</strong>structi<strong>on</strong>.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 8 / 56
Inference<br />
In Isabelle, <str<strong>on</strong>g>proofs</str<strong>on</strong>g> are c<strong>on</strong>structed us<str<strong>on</strong>g>in</str<strong>on</strong>g>g <str<strong>on</strong>g>in</str<strong>on</strong>g>ference rules. The most familiar<br />
is (probably) modus p<strong>on</strong>ens:<br />
P → Q<br />
Q<br />
P<br />
(mp)<br />
Derivati<strong>on</strong>s are trees, where the leaves are called assumpti<strong>on</strong>s.<br />
[A → (B → C)] [A]<br />
B → C<br />
C<br />
(mp)<br />
[B]<br />
(mp)<br />
<str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>proofs</str<strong>on</strong>g> build derivati<strong>on</strong>s under (possibly temporary)<br />
assumpti<strong>on</strong>s. A proof is a derivati<strong>on</strong> with no open assumpti<strong>on</strong>s.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 9 / 56
Intuiti<strong>on</strong>istic FOL Rules I<br />
¬P abbreviates P → <br />
P ↔ Q abbreviates (P → Q) ∧ (Q → P)<br />
P Q<br />
P ∧ Q<br />
(c<strong>on</strong>jI)<br />
P ∧ Q<br />
(c<strong>on</strong>junct1)<br />
P<br />
P ∧ Q<br />
(c<strong>on</strong>junct2)<br />
Q<br />
[P]<br />
[Q]<br />
P<br />
P ∨ Q<br />
(disjI1)<br />
Q<br />
P ∨ Q<br />
(disjI2)<br />
P ∨ Q<br />
.<br />
R<br />
R<br />
.<br />
R<br />
(disjE)<br />
[P]<br />
.<br />
Q<br />
P → Q<br />
(impI)<br />
P → Q<br />
Q<br />
P<br />
(mp)<br />
<br />
P<br />
(FalseE)<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 10 / 56
Intuiti<strong>on</strong>istic FOL Rules II (Includ<str<strong>on</strong>g>in</str<strong>on</strong>g>g Equality)<br />
[P]<br />
P<br />
8x.P<br />
(allI) 1 £<br />
8x.P<br />
P[t/x]<br />
(spec)<br />
P[t/x]<br />
(exI)<br />
9x.P<br />
9x.P<br />
Q<br />
.<br />
Q<br />
(exE) 2 £<br />
(refl)<br />
t = t<br />
t = u<br />
P[u/x]<br />
P[t/x]<br />
(subst)<br />
Eigenvariable c<strong>on</strong>diti<strong>on</strong>s:<br />
1 £ : (8I) provided x is not free <str<strong>on</strong>g>in</str<strong>on</strong>g> any assumpti<strong>on</strong> <strong>on</strong> which P depends.<br />
2 £ : (9E) provided x is not free <str<strong>on</strong>g>in</str<strong>on</strong>g> Q or any assumpti<strong>on</strong> except P.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 11 / 56
Paper & Pencil<br />
Lemma 1<br />
(A ∧ (B ∧ C)) → (A ∧ C)<br />
Proof.<br />
[A ∧ (B ∧ C)] £<br />
[A ∧ (B ∧ C)] £ (c<strong>on</strong>junct2)<br />
B ∧ C<br />
(c<strong>on</strong>junct1)<br />
A<br />
C<br />
A ∧ C<br />
(A ∧ (B ∧ C)) £ → (A ∧ C)<br />
(c<strong>on</strong>junct2)<br />
(c<strong>on</strong>jI)<br />
(impI)<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 12 / 56
A “Theorem Checker” Dialog<br />
You<br />
lemma “A ∧ (B ∧ C) −→ A ∧ C”<br />
apply (rule impI)<br />
apply (rule c<strong>on</strong>jI)<br />
apply (rule c<strong>on</strong>junct1)<br />
apply (assumpti<strong>on</strong>)<br />
apply (c<strong>on</strong>junct2)<br />
apply (c<strong>on</strong>junct2)<br />
apply (assumpti<strong>on</strong>)<br />
d<strong>on</strong>e<br />
Isabelle<br />
1. A ∧ B ∧ C −→ A ∧ C<br />
1. A ∧ B ∧ C =⇒ A ∧ C<br />
1. A ∧ B ∧ C =⇒ A<br />
2. A ∧ B ∧ C =⇒ C<br />
1. A ∧ B ∧ C =⇒ A ∧ Q 2<br />
2. A ∧ B ∧ C =⇒ C<br />
1. A ∧ B ∧ C =⇒ C<br />
1. A ∧ B ∧ C =⇒ P 3 ∧ C<br />
1. A ∧ B ∧ C =⇒ P 4 ∧ P 3 ∧ C<br />
No more Goals . . .<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 13 / 56
Derivability Judgment<br />
All assumpti<strong>on</strong>s <str<strong>on</strong>g>in</str<strong>on</strong>g><br />
A → (B → C)<br />
B → C<br />
C<br />
A<br />
(mp)<br />
B<br />
(mp)<br />
are open.<br />
We can write A → (B → C), A, B ` C (derivability judgment) to assert<br />
that C can be derived <str<strong>on</strong>g>in</str<strong>on</strong>g> this proof system under the given assumpti<strong>on</strong>s<br />
A → (B → C), A, B.<br />
It is possible to make such derivability judgments the central object of a<br />
deducti<strong>on</strong> system. The notati<strong>on</strong> Γ ` A is called Sequent Notati<strong>on</strong>.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 14 / 56
<str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> Us<str<strong>on</strong>g>in</str<strong>on</strong>g>g Sequent Notati<strong>on</strong><br />
For the → /∧ fragment:<br />
A 2 Γ<br />
Γ ` A<br />
(assumpti<strong>on</strong>)<br />
Γ ` B<br />
A, Γ ` B<br />
(weaken)<br />
Γ ` A Γ ` B<br />
Γ ` A ∧ B<br />
(∧ I )<br />
Γ ` A ∧ B<br />
Γ ` A<br />
(∧ EL )<br />
Γ ` A ∧ B<br />
Γ ` B<br />
(∧ ER )<br />
A, Γ ` B<br />
Γ ` A → B<br />
(→ I )<br />
Γ ` A → B Γ ` A<br />
Γ ` B<br />
(→ E )<br />
More rules can be derived.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 15 / 56
Ref<str<strong>on</strong>g>in</str<strong>on</strong>g>ement Style with Metavariables<br />
A ∧ (B ∧ C) 2 Γ<br />
A ∧ (B ∧ C) ` P 4 ∧ (P 3 ∧ C)<br />
A ∧ (B ∧ C) ` P 3 ∧ C<br />
A ∧ (B ∧ C) ` C<br />
(assumpti<strong>on</strong>)<br />
(∧ ER )<br />
(∧ ER )<br />
A ∧ (B ∧ C) 2 Γ<br />
(assumpti<strong>on</strong>)<br />
A ∧ (B ∧ C) ` A ∧ Q 2<br />
(∧ EL )<br />
A ∧ (B ∧ C) ` A<br />
A ∧ (B ∧ C) ` A A ∧ (B ∧ C) ` C<br />
A ∧ (B ∧ C) ` A ∧ C<br />
` A ∧ (B ∧ C) −→ A ∧ C<br />
(∧ I )<br />
(→ I )<br />
Soluti<strong>on</strong> for Q 2 (B ∧ C) and P 3 B and P 4 A.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 16 / 56
Meta-Logic<br />
The Isabelle’s meta-level c<strong>on</strong>nectives are implicati<strong>on</strong>, the universal<br />
quantifier, and equality:<br />
The implicati<strong>on</strong> φ =⇒ ψ means ‘φ implies ψ’, and express logical<br />
entailment.<br />
The quantificati<strong>on</strong> V x.φ means ‘φ is true for all x’, and express<br />
generality <str<strong>on</strong>g>in</str<strong>on</strong>g> rules and axiom schemes.<br />
The equality a b means ‘a equals b’, for express<str<strong>on</strong>g>in</str<strong>on</strong>g>g def<str<strong>on</strong>g>in</str<strong>on</strong>g>iti<strong>on</strong>s.<br />
Isabelle also provides schematic variables (unknowns) for unificati<strong>on</strong>.<br />
Logically, these are free variables. But while ord<str<strong>on</strong>g>in</str<strong>on</strong>g>ary variables rema<str<strong>on</strong>g>in</str<strong>on</strong>g><br />
fixed, unificati<strong>on</strong> may <str<strong>on</strong>g>in</str<strong>on</strong>g>stantiate the schematic variables (i.e., they can be<br />
replaced by arbitrary formulas).<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 17 / 56
Object-Level Rules as Meta-Level Axioms I<br />
[P; Q] =⇒ P ∧ Q<br />
(c<strong>on</strong>jI)<br />
P ∧ Q =⇒ P P ∧ Q =⇒ Q (c<strong>on</strong>junct1, 2)<br />
[P ∨ Q; P =⇒ R; Q =⇒ R] =⇒ R<br />
(disjE)<br />
P =⇒ P ∨ Q Q =⇒ P ∨ Q (disjI1, 2)<br />
(P =⇒ Q) =⇒ P −→ Q<br />
[P −→ Q; P] =⇒ Q<br />
(impI)<br />
(mp)<br />
False =⇒ P<br />
(FalseE)<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 18 / 56
Object-Level Rules as Meta-Level Axioms II<br />
(^ x. P x) =⇒ 8x. P x (allI)<br />
(8x. P x) =⇒ P x<br />
(spec)<br />
P x =⇒ 9x. P x (exI)<br />
[9x. P x;<br />
^<br />
x. P x −→ Q] =⇒ Q (exE)<br />
[s = t; P s] =⇒ P t<br />
(subst)<br />
The object-level quantifier (8) is def<str<strong>on</strong>g>in</str<strong>on</strong>g>ed us<str<strong>on</strong>g>in</str<strong>on</strong>g>g V . But, it is not required<br />
to have meta-level counterparts of all the c<strong>on</strong>nectives of the object-logic!<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 19 / 56
Unificati<strong>on</strong><br />
Unificati<strong>on</strong> refers to the process of mak<str<strong>on</strong>g>in</str<strong>on</strong>g>g two terms identical<br />
(possibly) by substitut<str<strong>on</strong>g>in</str<strong>on</strong>g>g their schematic variables by terms.<br />
Unificati<strong>on</strong> is equati<strong>on</strong> solv<str<strong>on</strong>g>in</str<strong>on</strong>g>g:<br />
The simplest case is when the two terms are already the same.<br />
Next simplest is pattern-match<str<strong>on</strong>g>in</str<strong>on</strong>g>g which replaces variables <str<strong>on</strong>g>in</str<strong>on</strong>g> <strong>on</strong>e of<br />
the terms.<br />
In the most complex case, variables <str<strong>on</strong>g>in</str<strong>on</strong>g> both terms are replaced.<br />
Unificati<strong>on</strong> supports quantifier reas<strong>on</strong><str<strong>on</strong>g>in</str<strong>on</strong>g>g by allow<str<strong>on</strong>g>in</str<strong>on</strong>g>g the schematic<br />
variables to be <str<strong>on</strong>g>in</str<strong>on</strong>g>stantiate later, possibly <str<strong>on</strong>g>in</str<strong>on</strong>g> stages.<br />
Higher-Order Unificati<strong>on</strong> (HU) is equati<strong>on</strong> solv<str<strong>on</strong>g>in</str<strong>on</strong>g>g for typed<br />
λ-terms.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 20 / 56
Higher-Order Unificati<strong>on</strong>: Imitati<strong>on</strong><br />
Isabelle uses Huet’s Search Procedure (HSP) which solves equati<strong>on</strong>s by<br />
Imitati<strong>on</strong> and Projecti<strong>on</strong>. For example, to solve the equati<strong>on</strong>:<br />
P(t) αβη g(u 1 , . . . , u k ) (1)<br />
Imitati<strong>on</strong> makes P apply the lead<str<strong>on</strong>g>in</str<strong>on</strong>g>g symbol of the right-hand side. So,<br />
to solve equati<strong>on</strong> (1), HSP guesses:<br />
P λx. g(h 1 (x), . . . , h k (x))<br />
Now, assum<str<strong>on</strong>g>in</str<strong>on</strong>g>g there are no other occurrences of P, equati<strong>on</strong> (1)<br />
simplifies to the set of equati<strong>on</strong>s: h 1 (t) αβη u 1 . . . h k (t) αβη u k .<br />
If the processes solves these equati<strong>on</strong>s <str<strong>on</strong>g>in</str<strong>on</strong>g>stantiat<str<strong>on</strong>g>in</str<strong>on</strong>g>g h 1 , . . . , h k , then it<br />
yields an <str<strong>on</strong>g>in</str<strong>on</strong>g>stantiati<strong>on</strong> for P.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 21 / 56
Higher-Order Unificati<strong>on</strong>: Projecti<strong>on</strong><br />
Projecti<strong>on</strong> makes P apply <strong>on</strong>e of its argument. So, to solve equati<strong>on</strong>:<br />
P(t) αβη g(u 1 , . . . , u k ) (1)<br />
If t expects m arguments and delivers a result of suitable type, HSP<br />
guesses:<br />
P λx. x(h 1 (x), . . . , h m (x))<br />
Assum<str<strong>on</strong>g>in</str<strong>on</strong>g>g there are no other occurrences of P, equati<strong>on</strong> (1) simplifies to<br />
the equati<strong>on</strong>:<br />
t(h 1 (t), . . . , h m (t)) αβη g(u 1 , . . . , u k )<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 22 / 56
HSP Features<br />
1 Equati<strong>on</strong>s with no functi<strong>on</strong>s unknowns are solved us<str<strong>on</strong>g>in</str<strong>on</strong>g>g first-order<br />
unificati<strong>on</strong>, extended to treat bound variables.<br />
2 An occurrence of the term P(x, y, z), where the arguments are<br />
dist<str<strong>on</strong>g>in</str<strong>on</strong>g>ct bound variables, causes no difficulties. Its projecti<strong>on</strong>s can <strong>on</strong>ly<br />
match the corresp<strong>on</strong>d<str<strong>on</strong>g>in</str<strong>on</strong>g>g variables.<br />
3 Even an equati<strong>on</strong> such as P(a) αβη a + a is all right. It has four<br />
soluti<strong>on</strong>s, but Isabelle evaluates them lazily, try<str<strong>on</strong>g>in</str<strong>on</strong>g>g projecti<strong>on</strong> before<br />
imitati<strong>on</strong>:<br />
P αβη λx. x + x, P αβη λx. a + x, P αβη λx. x + a, and<br />
P αβη λx. a + a.<br />
4 Equati<strong>on</strong>s such as P(x, y) αβη t and P(g(x)) αβη t admit vast<br />
number of unifiers, and must be avoided.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 23 / 56
Proof by Resoluti<strong>on</strong><br />
Resoluti<strong>on</strong> is the basic mechanism for transform<str<strong>on</strong>g>in</str<strong>on</strong>g>g proof states <str<strong>on</strong>g>in</str<strong>on</strong>g><br />
Isabelle <str<strong>on</strong>g>in</str<strong>on</strong>g> order to c<strong>on</strong>struct a proof. It is c<strong>on</strong>venient for derive simple<br />
rules and for reas<strong>on</strong><str<strong>on</strong>g>in</str<strong>on</strong>g>g forward from facts.<br />
Forward proof work by unify<str<strong>on</strong>g>in</str<strong>on</strong>g>g theorems with the premises of a rule,<br />
deriv<str<strong>on</strong>g>in</str<strong>on</strong>g>g a new theorem.<br />
Resoluti<strong>on</strong>, <str<strong>on</strong>g>in</str<strong>on</strong>g> particular, is c<strong>on</strong>venient for backward proof.<br />
Intuitively<br />
Backward proof works by unify<str<strong>on</strong>g>in</str<strong>on</strong>g>g a goal with the c<strong>on</strong>clusi<strong>on</strong> of a rule,<br />
whose premises become new subgoals.<br />
So, we start with a goal and ref<str<strong>on</strong>g>in</str<strong>on</strong>g>e it to progressively simpler subgoals until<br />
all have been solved.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 24 / 56
Theorems (Rules and Proof States) for Resoluti<strong>on</strong><br />
Isabelle works with meta-level theorems of the form [φ 1 ; . . . φ n ] =⇒ φ.<br />
We can view this as the <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g>’s rule with premises<br />
φ 1 , . . . , φ n and c<strong>on</strong>clusi<strong>on</strong> φ. Also, it can be viewed as the proof state<br />
with subgoals φ 1 , . . . , φ n and ma<str<strong>on</strong>g>in</str<strong>on</strong>g> goal φ.<br />
Let [ψ 1 ; . . . ; ψ m ] =⇒ ψ and [φ 1 ; . . . ; φ n ] =⇒ φ be two Isabelle theorems.<br />
If ψ and φ i have a higher-order unifier, then there is some substituti<strong>on</strong> s<br />
such that (ψ)s αβη (φ i )s. In short,<br />
Def<str<strong>on</strong>g>in</str<strong>on</strong>g>iti<strong>on</strong> 2 (Resoluti<strong>on</strong>)<br />
[ψ 1 ; . . . ; ψ m ] =⇒ ψ [φ 1 ; . . . ; φ i ; . . . ; φ n ] =⇒ φ<br />
((ψ)s αβη (φ i )s)<br />
([φ 1 ; . . . ; φ i−1 ; ψ 1 ; . . . ; ψ m ; . . . φ n ] =⇒ φ)s<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 25 / 56
Backward Proof<br />
To prove the formula φ, take φ =⇒ φ as the <str<strong>on</strong>g>in</str<strong>on</strong>g>itial proof state. This<br />
asserti<strong>on</strong> is, trivially, a theorem.<br />
At a later stage <str<strong>on</strong>g>in</str<strong>on</strong>g> the (backward) proof, a typical proof state is<br />
[φ 1 ; . . . ; φ n ] =⇒ φ. This is a theorem, ensur<str<strong>on</strong>g>in</str<strong>on</strong>g>g that the subgoals<br />
φ 1 , . . . , φ n imply φ.<br />
If n = 0 then we have proved φ outright. Otherwise, to ref<str<strong>on</strong>g>in</str<strong>on</strong>g>e subgoal φ i<br />
of a proof state by a rule [ψ 1 ; . . . ; ψ m ] =⇒ ψ perform resoluti<strong>on</strong>.<br />
In this form, the subgoal φ i is replaced by m new subgoals (the rule’s<br />
<str<strong>on</strong>g>in</str<strong>on</strong>g>stantiated premises).<br />
If some unknowns are left un-<str<strong>on</strong>g>in</str<strong>on</strong>g>stantiated, they become new unknowns <str<strong>on</strong>g>in</str<strong>on</strong>g><br />
the (new) proof state.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 26 / 56
Beh<str<strong>on</strong>g>in</str<strong>on</strong>g>d the Scenes (Unificati<strong>on</strong>)<br />
You<br />
lemma “A ∧ (B ∧ C) −→ A ∧ C”<br />
Isabelle<br />
1. A ∧ B ∧ C −→ A ∧ C<br />
apply (rule impI)<br />
(P =⇒ Q) =⇒ P −→ Q<br />
A ∧ B ∧ C −→ A ∧ C =⇒ A ∧ B ∧ C −→ A ∧ C<br />
(impI)<br />
(state1)<br />
Substituti<strong>on</strong> s for (P −→ Q)s αβη ( A ∧ B ∧ C −→ A ∧ C)s<br />
Soluti<strong>on</strong> P A ∧ B ∧ C and Q A ∧ C<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 27 / 56
Beh<str<strong>on</strong>g>in</str<strong>on</strong>g>d the Scenes (Resoluti<strong>on</strong>)<br />
You<br />
lemma “A ∧ (B ∧ C) −→ A ∧ C”<br />
apply (rule impI)<br />
Isabelle<br />
1. A ∧ B ∧ C −→ A ∧ C<br />
1. A ∧ B ∧ C =⇒ A ∧ C<br />
(P =⇒ Q) =⇒ P −→ Q A ∧ B ∧ C −→ A ∧ C =⇒ A ∧ B ∧ C −→ A ∧ C<br />
((P =⇒ Q) =⇒ A ∧ B ∧ C −→ A ∧ C)s<br />
But ((P =⇒ Q) =⇒ A ∧ B ∧ C −→ A ∧ C)s after substituti<strong>on</strong> becomes:<br />
(A ∧ B ∧ C =⇒ A ∧ C) =⇒ A ∧ B ∧ C −→ A ∧ C (state2)<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 28 / 56
Lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g a Rule <str<strong>on</strong>g>in</str<strong>on</strong>g>to a C<strong>on</strong>text<br />
The rules impI and allI may seem unsuitable for resoluti<strong>on</strong>.<br />
They have n<strong>on</strong>-atomic premises, namely P =⇒ Q and V x. P x, while<br />
the c<strong>on</strong>clusi<strong>on</strong>s of all the rules are atomic.<br />
Isabelle gets round this problem, through a meta-<str<strong>on</strong>g>in</str<strong>on</strong>g>ference called Lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g.<br />
Def<str<strong>on</strong>g>in</str<strong>on</strong>g>iti<strong>on</strong> 3 (Lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g over Assumpti<strong>on</strong>s)<br />
[φ 1 ; . . . ; φ n ] =⇒ φ<br />
[θ =⇒ φ 1 ; . . . ; θ =⇒ φ n ] =⇒ (θ =⇒ φ)<br />
Lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g over θ =⇒ is clearly sound.<br />
Typically, the θ i are assumpti<strong>on</strong>s <str<strong>on</strong>g>in</str<strong>on</strong>g> a <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> proof; lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g<br />
copies them <str<strong>on</strong>g>in</str<strong>on</strong>g>to a rule’s premises and c<strong>on</strong>clusi<strong>on</strong>.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 29 / 56
Lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g Over Assumpti<strong>on</strong>s<br />
In our proof example, Isabelle is now display<str<strong>on</strong>g>in</str<strong>on</strong>g>g: A ∧ B ∧ C =⇒ A ∧ C<br />
and the proof state is:<br />
(A ∧ B ∧ C =⇒ A ∧ C) =⇒ A ∧ B ∧ C −→ A ∧ C<br />
We want to apply [P; Q] =⇒ P ∧ Q. But for this, the rule must be<br />
lifted over assumpti<strong>on</strong> A ∧ B ∧ C, as follows:<br />
Lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g over A ∧ B ∧ C =⇒<br />
[P; Q] =⇒ P ∧ Q<br />
[A ∧ B ∧ C =⇒ P; A ∧ B ∧ C =⇒ Q] =⇒ (A ∧ B ∧ C =⇒ P ∧ Q)<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 30 / 56
The Next Step <str<strong>on</strong>g>in</str<strong>on</strong>g> the Proof<br />
Us<str<strong>on</strong>g>in</str<strong>on</strong>g>g the follow<str<strong>on</strong>g>in</str<strong>on</strong>g>g nomenclature for l<str<strong>on</strong>g>in</str<strong>on</strong>g>ear notati<strong>on</strong>:<br />
D 11<br />
D 1 D 2<br />
D<br />
D : [A ∧ B ∧ C =⇒ A; A ∧ B ∧ C =⇒ C] =⇒ A ∧ B ∧ C −→ A ∧ C<br />
D 1 : [A ∧ B ∧ C =⇒ P; A ∧ B ∧ C =⇒ Q] =⇒ (A ∧ B ∧ C =⇒ P ∧ Q)<br />
D 11 : [P; Q] =⇒ P ∧ Q<br />
D 2 : (A ∧ B ∧ C =⇒ A ∧ C) =⇒ A ∧ B ∧ C −→ A ∧ C<br />
From the lifted rule (D 1 ) and proof state (D 2 ).<br />
For (A ∧ B ∧ C =⇒ P ∧ Q αβη A ∧ B ∧ C =⇒ A ∧ C)s, we use s: P A<br />
and Q C.<br />
Then by resoluti<strong>on</strong>, and after substituti<strong>on</strong> we get a new state (D).<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 31 / 56
Lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g Over Parameters<br />
An analogous form of Lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g handles premises of the form V x . . . . Here,<br />
lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g prefixes an object-rule’s premises and c<strong>on</strong>clusi<strong>on</strong> with V x . . . . At<br />
the same time lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g <str<strong>on</strong>g>in</str<strong>on</strong>g>troduces a dependence up<strong>on</strong> x.<br />
It replaces each unknown P <str<strong>on</strong>g>in</str<strong>on</strong>g> the rule by P 0 x, where P 0 is a new<br />
unknown (by subscript<str<strong>on</strong>g>in</str<strong>on</strong>g>g) of suitable type (necessarily a functi<strong>on</strong> type).<br />
In short:<br />
Def<str<strong>on</strong>g>in</str<strong>on</strong>g>iti<strong>on</strong> 4 (Lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g over Parameters)<br />
[φ 1 ; . . . ; φ n ] =⇒ φ<br />
[ V x. φ x 1 ; . . . ;V x. φ x n] =⇒ V x. φ x<br />
where φ x stands for the result of lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g unknowns over x <str<strong>on</strong>g>in</str<strong>on</strong>g> φ. It is not<br />
hard to see that this meta-<str<strong>on</strong>g>in</str<strong>on</strong>g>ference is sound.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 32 / 56
A Quantifier Proof: For All Introducti<strong>on</strong><br />
You<br />
8x. P x −→ P x ∨ Q y<br />
Isabelle<br />
8x. P x −→ P x ∨ Q y =⇒ 8x. P x −→ P x ∨ Q y<br />
answers: 8x. P x −→ P x ∨ Q y<br />
You<br />
apply (rule allI)<br />
( V x. P x) =⇒ 8x. P x<br />
( V x. P x) =⇒ 8x. P x 8x. P x −→ P x ∨ Qy =⇒ 8x. P x −→ P x ∨ Q y<br />
(( V x. P x) =⇒ 8x. P x −→ P x ∨ Qy)s<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 33 / 56
A Quantifier Proof: Lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g Over Parameters<br />
Isabelle<br />
V x. P x −→ P x ∨ Q y =⇒ 8x. P x −→ P x ∨ Q y<br />
answers: V x. P x −→ P x ∨ Q y<br />
You<br />
apply (rule impI) (P =⇒ Q) =⇒ P −→ Q<br />
And then . . .<br />
Lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g over V x<br />
(P =⇒ Q) =⇒ P −→ Q<br />
( V x. P 0 x =⇒ Q 0 x) =⇒ V x. P 0 x −→ Q 0 x<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 34 / 56
A Quantifier Proof: Unificati<strong>on</strong><br />
D<br />
: ( V x. P x =⇒ P x ∨ Q y) =⇒ 8x. P x −→ P x ∨ Q y<br />
D 1 : ( V x. P 0 x =⇒ Q 0 x) =⇒ V x. P 0 x −→ Q 0 x<br />
D 11 : (P =⇒ Q) =⇒ P −→ Q<br />
D 2<br />
V<br />
: x. P x −→ P x ∨ Q y =⇒ 8x. P x −→ P x ∨ Q y<br />
V x. P<br />
0<br />
x −→ Q<br />
0<br />
x<br />
<br />
αβη<br />
V x. P x −→ P x ∨ Q y<br />
P 0<br />
x αβη P x<br />
Q 0 x αβη P x ∨ Q y:<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 35 / 56
A Quantifier Proof: Disjuncti<strong>on</strong> Introducti<strong>on</strong><br />
Isabelle<br />
( V x. P x =⇒ P x ∨ Q y)=⇒ 8x. P x −→ P x ∨ Q y<br />
answers: V x. P x =⇒ P x ∨ Q y<br />
You<br />
apply (rule disjI1) P =⇒ P ∨ Q<br />
Isabelle<br />
Lift<str<strong>on</strong>g>in</str<strong>on</strong>g>g over: V x. P x =⇒<br />
Produces: ( V x. P x =⇒ P 0 x) =⇒ ( V x. P x =⇒ P 0 x ∨ Q 0 x)<br />
( V x. P x =⇒ P x)=⇒ 8x. P x −→ P x ∨ Q y<br />
answers: V x. P x =⇒ P x<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 36 / 56
And then by Assumpti<strong>on</strong> . . .<br />
In the course of a proof, parameters x 1 , . . . , x m and assumpti<strong>on</strong>s<br />
accumulate form<str<strong>on</strong>g>in</str<strong>on</strong>g>g a c<strong>on</strong>text for each subgoal (<str<strong>on</strong>g>in</str<strong>on</strong>g> normal form):<br />
V<br />
x1 , . . . , x m [φ 1 ; . . . ; φ k ] =⇒ φ<br />
It says that φ follows from φ 1 , . . . , φ k for arbitrary x 1 , . . . , x m . This is<br />
trivially true if φ equals of any of φ 1 , . . . , φ k , or is unifiable with any of<br />
them .<br />
Isabelle<br />
answers: V x. P x =⇒ P x<br />
You<br />
apply (assumpti<strong>on</strong>)<br />
d<strong>on</strong>e<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 37 / 56
Rule Applicati<strong>on</strong> Methods (Tactics): rule & assumpti<strong>on</strong><br />
Tactics perform backward proof. A tactic is a functi<strong>on</strong> that takes a proof<br />
state and returns a sequence (lazy list) of possible successor states. Basic<br />
tactics execute a meta-rule <strong>on</strong> a given subgoal.<br />
Method rule R<br />
Ord<str<strong>on</strong>g>in</str<strong>on</strong>g>ary resoluti<strong>on</strong> attempts to reduce the current subgoal φ i by unify<str<strong>on</strong>g>in</str<strong>on</strong>g>g<br />
it with the c<strong>on</strong>clusi<strong>on</strong> of the rule R : [ψ 1 ; . . . ; ψ m ] =⇒ ψ. The subgoal is<br />
then replaced by m new subgoals <str<strong>on</strong>g>in</str<strong>on</strong>g>stances of the premises of the rule.<br />
Method assumpti<strong>on</strong><br />
If the goal φ i is of the form [ϕ 1 ; . . . ; ϕ k ] =⇒ ϕ. The assumpti<strong>on</strong> method<br />
tries to unify ϕ with ϕ j for some (1 j k). This models proof by<br />
assumpti<strong>on</strong> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g>.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 38 / 56
Example: rule with Sequent Notati<strong>on</strong><br />
Isabelle<br />
answers: [A −→ C; B −→ C] =⇒ A ∨ B −→ C<br />
Γ, P ` Q<br />
Γ ` P −→ Q<br />
(rule impI)<br />
[A −→ C; B −→ C; A ∨ B] ` C<br />
[A −→ C; B −→ C] ` A ∨ B −→ C<br />
(rule impI)<br />
Isabelle<br />
answers: [A −→ C; B −→ C; A ∨ B] =⇒ C<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 39 / 56
Rule Applicati<strong>on</strong> Methods (Tactics): erule<br />
In pr<str<strong>on</strong>g>in</str<strong>on</strong>g>ciple, resoluti<strong>on</strong> and assumpti<strong>on</strong> suffice to prove all theorems.<br />
However, specialised forms of resoluti<strong>on</strong> are helpful for work<str<strong>on</strong>g>in</str<strong>on</strong>g>g with some<br />
classes of rules.<br />
Method erule R<br />
C<strong>on</strong>sider the rule R : [ψ 1 ; . . . ; ψ m ] =⇒ ψ and subgoal φ i of the form<br />
[ϕ 1 ; . . . ; ϕ k ] =⇒ ϕ. Then erule would try simultaneously: (i) to reduce<br />
the goal φ i as with ord<str<strong>on</strong>g>in</str<strong>on</strong>g>ary resoluti<strong>on</strong>, and (ii) to solve the first premise<br />
ψ 1 of the rule R by assumpti<strong>on</strong>, with some assumpti<strong>on</strong> ϕ j of φ i .<br />
The subgoal is then replaced by m − 1 new subgoals <str<strong>on</strong>g>in</str<strong>on</strong>g>stances of the<br />
premises of the rule ψ 2 ; . . . ; ψ m where the match<str<strong>on</strong>g>in</str<strong>on</strong>g>g assumpti<strong>on</strong> ϕ j has<br />
been deleted.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 40 / 56
Example: erule with Sequent Notati<strong>on</strong><br />
Isabelle<br />
answers: [A −→ C; B −→ C; A ∨ B] =⇒ C<br />
Γ ` P ∨ Q Γ, P ` R Γ, Q ` R<br />
Γ ` R<br />
(rule disjE)<br />
Γ, P ` R Γ, Q ` R<br />
Γ, P ∨ Q ` R<br />
(erule disjE)<br />
[A −→ C; B −→ C; A] ` C [A −→ C; B −→ C; B] ` C<br />
[A −→ C; B −→ C; A ∨ B] ` C<br />
(erule disjE)<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 41 / 56
Two K<str<strong>on</strong>g>in</str<strong>on</strong>g>ds of Elim<str<strong>on</strong>g>in</str<strong>on</strong>g>ati<strong>on</strong><br />
There are two k<str<strong>on</strong>g>in</str<strong>on</strong>g>ds of elim<str<strong>on</strong>g>in</str<strong>on</strong>g>ati<strong>on</strong> rule. The rules, c<strong>on</strong>junct1,<br />
c<strong>on</strong>junct2, mp and spec extract the c<strong>on</strong>clusi<strong>on</strong> from the major premise.<br />
They are easy to use <str<strong>on</strong>g>in</str<strong>on</strong>g> forward proof (destructi<strong>on</strong> rules).<br />
The rules disjE, FalseE and exE work by discharg<str<strong>on</strong>g>in</str<strong>on</strong>g>g assumpti<strong>on</strong>s. In<br />
<str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> this is the most general form of elim<str<strong>on</strong>g>in</str<strong>on</strong>g>ati<strong>on</strong> rule.<br />
To facilitate the use of destructi<strong>on</strong> rules <str<strong>on</strong>g>in</str<strong>on</strong>g> a backward proof, Isabelle<br />
provides a means of transform<str<strong>on</strong>g>in</str<strong>on</strong>g>g them as follows:<br />
ψ 1 . . . ψ m (destructi<strong>on</strong>)<br />
ψ<br />
ψ 1 . . . ψ m<br />
[ψ]<br />
.<br />
ϕ<br />
ϕ<br />
(elim<str<strong>on</strong>g>in</str<strong>on</strong>g>ati<strong>on</strong>)<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 42 / 56
Rule Applicati<strong>on</strong> Methods (Tactics): drule & erule<br />
Method drule R<br />
This method comb<str<strong>on</strong>g>in</str<strong>on</strong>g>es the above transformati<strong>on</strong> with elim-resoluti<strong>on</strong> (i.e.,<br />
erule).<br />
In other words, it applies a destructi<strong>on</strong> rule to some assumpti<strong>on</strong> of the<br />
goal.<br />
Method frule R<br />
Sometimes a (universal) formula has to be kept so that it can be used<br />
aga<str<strong>on</strong>g>in</str<strong>on</strong>g>. Then we use frule.<br />
This method is like drule except that the match<str<strong>on</strong>g>in</str<strong>on</strong>g>g assumpti<strong>on</strong> is not<br />
deleted, <str<strong>on</strong>g>in</str<strong>on</strong>g>stead it is copied.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 43 / 56
Next Step <str<strong>on</strong>g>in</str<strong>on</strong>g> the Example: rule<br />
Let us c<strong>on</strong>t<str<strong>on</strong>g>in</str<strong>on</strong>g>ue our previous example, and explore various alternatives for<br />
it.<br />
Isabelle<br />
answers: [A −→ C; B −→ C; A] =⇒ C<br />
with rule<br />
Γ ` P −→ Q<br />
Γ ` Q<br />
Γ ` P<br />
(rule mp)<br />
[A −→ C; B −→ C; A] ` P −→ C [A −→ C; B −→ C; A] ` P<br />
[A −→ C; B −→ C; A] ` C<br />
(rule mp)<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 44 / 56
Next Step <str<strong>on</strong>g>in</str<strong>on</strong>g> the Example: erule & Transformati<strong>on</strong><br />
Isabelle<br />
answers: [A −→ C; B −→ C; A] =⇒ C<br />
with erule<br />
Γ ` P<br />
Γ, P −→ Q ` Q<br />
(erule mp)<br />
[B −→ C; A] ` A<br />
[A −→ C; B −→ C; A] ` C<br />
(erule mp)<br />
Transformati<strong>on</strong><br />
Γ ` P −→ Q<br />
Γ ` Q<br />
Γ ` P<br />
(dest. mp)<br />
Γ ` P −→ Q Γ ` P Γ, Q ` R<br />
Γ ` R<br />
(elim. mp)<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 45 / 56
Next Step <str<strong>on</strong>g>in</str<strong>on</strong>g> the Example: drule & frule<br />
Isabelle<br />
answers: [A −→ C; B −→ C; A] =⇒ C<br />
with drule<br />
Γ ` P Γ, Q ` R<br />
Γ, P −→ Q ` R<br />
(drule mp)<br />
[B −→ C; A] ` A [B −→ C; A; C] ` C<br />
[A −→ C; B −→ C; A] ` C<br />
(rule mp)<br />
with frule<br />
[A −→ C; B −→ C; A] ` A [A −→ C; B −→ C; A; C] ` C<br />
[A −→ C; B −→ C; A] ` C<br />
(frule mp)<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 46 / 56
Proof Search<br />
Commands<br />
The by command executes an apply command and then tries to prove all<br />
rema<str<strong>on</strong>g>in</str<strong>on</strong>g><str<strong>on</strong>g>in</str<strong>on</strong>g>g subgoals by assumpti<strong>on</strong>. S<str<strong>on</strong>g>in</str<strong>on</strong>g>ce (if successful) it ends the proof,<br />
it also replaces the d<strong>on</strong>e symbol.<br />
The back command tries an alternative proof state successor of the<br />
current proof state (e.g., different unifiers).<br />
The undo command returns to the previous proof state.<br />
Methods<br />
The <str<strong>on</strong>g>in</str<strong>on</strong>g>tro method repeatedly applies the given <str<strong>on</strong>g>in</str<strong>on</strong>g>troducti<strong>on</strong> rules.<br />
The elim method repeatedly applies elim<str<strong>on</strong>g>in</str<strong>on</strong>g>ati<strong>on</strong> rules.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 47 / 56
Mak<str<strong>on</strong>g>in</str<strong>on</strong>g>g Bigger Steps<br />
Example 5 (impI OF impI)<br />
apply (rule impI)<br />
apply (rule impI)<br />
apply (assumpti<strong>on</strong>)<br />
d<strong>on</strong>e<br />
Alternatives<br />
Us<str<strong>on</strong>g>in</str<strong>on</strong>g>g by<br />
apply (rule impI)<br />
by (rule impI)<br />
A −→ (B −→ A)<br />
A =⇒ B −→ A<br />
[A; B] =⇒ A<br />
No subgoals!<br />
Us<str<strong>on</strong>g>in</str<strong>on</strong>g>g <str<strong>on</strong>g>in</str<strong>on</strong>g>tro<br />
apply (<str<strong>on</strong>g>in</str<strong>on</strong>g>tro impI)<br />
apply (assumpti<strong>on</strong>)<br />
d<strong>on</strong>e<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 48 / 56
Explicit Substituti<strong>on</strong><br />
Some methods apply a rule while c<strong>on</strong>stra<str<strong>on</strong>g>in</str<strong>on</strong>g><str<strong>on</strong>g>in</str<strong>on</strong>g>g some of its variables. The<br />
general form is:<br />
Instantiat<str<strong>on</strong>g>in</str<strong>on</strong>g>g Variables<br />
rule tac v 1 = t 1 and . . . and v k = t k <str<strong>on</strong>g>in</str<strong>on</strong>g> R<br />
This behaves like rule R, while <str<strong>on</strong>g>in</str<strong>on</strong>g>stantiat<str<strong>on</strong>g>in</str<strong>on</strong>g>g variables v 1 , . . . , v k as<br />
specified.<br />
Note that for the tactics we have seen, there are variants of them:<br />
erule tac,<br />
drule tac and<br />
frule tac.<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 49 / 56
Work<str<strong>on</strong>g>in</str<strong>on</strong>g>g with Quantifiers I<br />
For all, Exists<br />
lemma “forall-exists”: “(8x. p(x)) −→ (9x. p(x))”<br />
goal: (8x. p x) −→ (9x. p x)<br />
Γ, P ` Q<br />
Γ ` P −→ Q<br />
(rule impI)<br />
goal: 8x. p x =⇒ 9x. p x<br />
Γ ` P[t/x]<br />
Γ ` 9x. P x<br />
(rule exI)<br />
goal: 8x. p x =⇒ p x 1<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 50 / 56
Work<str<strong>on</strong>g>in</str<strong>on</strong>g>g with Quantifiers II<br />
For all, Exists<br />
Alternatively, rule tac x = t <str<strong>on</strong>g>in</str<strong>on</strong>g> exI will result <str<strong>on</strong>g>in</str<strong>on</strong>g>:<br />
goal: 8x. p x =⇒ p t<br />
Γ ` 8x. P x<br />
Γ ` P[t/x]<br />
(rule spec)<br />
Γ, 8x. P x ` P[t/x]<br />
(erule spec)<br />
No subgoals!<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 51 / 56
Work<str<strong>on</strong>g>in</str<strong>on</strong>g>g with Negati<strong>on</strong> I<br />
C<strong>on</strong>trapositive<br />
goal: [¬(P −→ Q); ¬(R −→ Q)] =⇒ R<br />
[¬Q; ¬P =⇒ Q] =⇒ P<br />
(c<strong>on</strong>trapos np)<br />
Γ ` ¬Q Γ, ¬P ` Q<br />
Γ ` P<br />
(rule c<strong>on</strong>trapos np)<br />
goal: 1. [¬(P −→ Q); ¬(R −→ Q)] =⇒ ¬Q<br />
2. [¬(P −→ Q); ¬(R −→ Q); ¬R] =⇒ Q<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 52 / 56
Work<str<strong>on</strong>g>in</str<strong>on</strong>g>g with Negati<strong>on</strong> II<br />
C<strong>on</strong>trapositive<br />
goal: [¬(P −→ Q); ¬(R −→ Q)] =⇒ R<br />
Γ, ¬P ` Q<br />
Γ, ¬Q ` P<br />
(erule c<strong>on</strong>trapos np)<br />
[¬(R −→ Q); ¬R] ` P −→ Q<br />
[¬(P −→ Q); ¬(R −→ Q)] ` R<br />
(erule c<strong>on</strong>trapos np)<br />
[¬(P −→ Q); ¬R] ` R −→ Q<br />
[¬(P −→ Q); ¬(R −→ Q)] ` R<br />
(erule c<strong>on</strong>trapos np)<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 53 / 56
Work<str<strong>on</strong>g>in</str<strong>on</strong>g>g with Negati<strong>on</strong> III<br />
C<strong>on</strong>trapositive<br />
goal: [¬(P −→ Q); ¬(R −→ Q)] =⇒ R<br />
Γ, ¬P ` Q<br />
Γ, ¬Q ` P<br />
(erule c<strong>on</strong>trapos np)<br />
Alternatively, erule tac Q = "R −→ Q" <str<strong>on</strong>g>in</str<strong>on</strong>g> c<strong>on</strong>trapos np will produce the<br />
same effect.<br />
goal: [¬(P −→ Q); ¬R] =⇒ R −→ Q<br />
And then apply (rule impI) will result:<br />
goal: [¬(P −→ Q); ¬R; R] =⇒ Q<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 54 / 56
Work<str<strong>on</strong>g>in</str<strong>on</strong>g>g with Negati<strong>on</strong> IV<br />
Negati<strong>on</strong> Elim<str<strong>on</strong>g>in</str<strong>on</strong>g>ati<strong>on</strong><br />
goal: [¬(P −→ Q); ¬R; R] =⇒ Q<br />
[¬P; P] =⇒ R<br />
(notE)<br />
Γ ` ¬P Γ ` P<br />
Γ ` R<br />
(rule notE)<br />
Γ ` P<br />
Γ, ¬P ` R<br />
(erule notE)<br />
by (erule notE)<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 55 / 56
What is Next<br />
It is difficult to prove theorems us<str<strong>on</strong>g>in</str<strong>on</strong>g>g the methods we have studied<br />
(i.e., the proof can be very l<strong>on</strong>g).<br />
Proof sequences realise their full potential with Tacticals. These are<br />
operators for comb<str<strong>on</strong>g>in</str<strong>on</strong>g><str<strong>on</strong>g>in</str<strong>on</strong>g>g Tactics. DFS, BFS and Best-FS (heuristics)<br />
return their outcomes as sequences.<br />
Moreover, Isabelle provides enough atomati<strong>on</strong> to tackle substantial<br />
examples. The Classical Reas<strong>on</strong>er is a family of tools that perform<br />
such <str<strong>on</strong>g>proofs</str<strong>on</strong>g> automatically.<br />
The most important is the blast method, which basically is a generic<br />
tableaux prover <str<strong>on</strong>g>in</str<strong>on</strong>g>tegrated with Isabelle (reas<strong>on</strong>er).<br />
J. AGuado (Informatics Theory Group) <str<strong>on</strong>g>Natural</str<strong>on</strong>g> <str<strong>on</strong>g>Deducti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>in</str<strong>on</strong>g> <str<strong>on</strong>g>ISABELLE</str<strong>on</strong>g> University of Bamberg 56 / 56