10956
|
1 |
theory Tacticals = Main:
|
|
2 |
|
|
3 |
text{*REPEAT*}
|
|
4 |
lemma "\<lbrakk>(P\<longrightarrow>Q); (Q\<longrightarrow>R); (R\<longrightarrow>S); P\<rbrakk> \<Longrightarrow> S"
|
|
5 |
apply (drule mp, assumption)
|
|
6 |
apply (drule mp, assumption)
|
|
7 |
apply (drule mp, assumption)
|
|
8 |
apply (assumption)
|
|
9 |
done
|
|
10 |
|
|
11 |
lemma "\<lbrakk>(P\<longrightarrow>Q); (Q\<longrightarrow>R); (R\<longrightarrow>S); P\<rbrakk> \<Longrightarrow> S"
|
|
12 |
by (drule mp, assumption)+
|
|
13 |
|
|
14 |
text{*ORELSE with REPEAT*}
|
|
15 |
lemma "\<lbrakk>(Q\<longrightarrow>R); (P\<longrightarrow>Q); x<#5\<longrightarrow>P; Suc x < #5\<rbrakk> \<Longrightarrow> R"
|
|
16 |
by (drule mp, (assumption|arith))+
|
|
17 |
|
|
18 |
text{*exercise: what's going on here?*}
|
|
19 |
lemma "\<lbrakk>(P\<and>Q\<longrightarrow>R); (P\<longrightarrow>Q); P\<rbrakk> \<Longrightarrow> R"
|
|
20 |
by (drule mp, intro?, assumption+)+
|
|
21 |
|
|
22 |
text{*defer and prefer*}
|
|
23 |
|
|
24 |
lemma "hard \<and> (P \<or> ~P) \<and> (Q\<longrightarrow>Q)"
|
|
25 |
apply intro --{* @{subgoals[display,indent=0,margin=65]} *}
|
|
26 |
defer 1 --{* @{subgoals[display,indent=0,margin=65]} *}
|
|
27 |
apply blast+ --{* @{subgoals[display,indent=0,margin=65]} *}
|
|
28 |
oops
|
|
29 |
|
|
30 |
lemma "ok1 \<and> ok2 \<and> doubtful"
|
|
31 |
apply intro --{* @{subgoals[display,indent=0,margin=65]} *}
|
|
32 |
prefer 3 --{* @{subgoals[display,indent=0,margin=65]} *}
|
|
33 |
oops
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
(*needed??*)
|
|
38 |
|
|
39 |
lemma "(P\<or>Q) \<and> (R\<or>S) \<Longrightarrow> PP"
|
|
40 |
apply elim
|
|
41 |
oops
|
|
42 |
|
|
43 |
lemma "((P\<or>Q) \<and> R) \<and> (Q \<and> (P\<or>S)) \<Longrightarrow> PP"
|
|
44 |
apply (elim conjE)
|
|
45 |
oops
|
|
46 |
|
|
47 |
lemma "((P\<or>Q) \<and> R) \<and> (Q \<and> (P\<or>S)) \<Longrightarrow> PP"
|
|
48 |
apply (erule conjE)+
|
|
49 |
oops
|
|
50 |
|
|
51 |
end
|