author | wenzelm |
Sun, 07 Feb 2016 14:36:16 +0100 | |
changeset 62268 | 3d86222b4a94 |
parent 61656 | cfabbc083977 |
child 62270 | 77e3ffb5aeb3 |
permissions | -rw-r--r-- |
61656 | 1 |
(*:maxLineLen=78:*) |
2 |
||
26779 | 3 |
theory Quick_Reference |
42651 | 4 |
imports Base Main |
26779 | 5 |
begin |
6 |
||
58618 | 7 |
chapter \<open>Isabelle/Isar quick reference \label{ap:refcard}\<close> |
26779 | 8 |
|
58618 | 9 |
section \<open>Proof commands\<close> |
26779 | 10 |
|
58618 | 11 |
subsection \<open>Primitives and basic syntax\<close> |
26779 | 12 |
|
58618 | 13 |
text \<open> |
26779 | 14 |
\begin{tabular}{ll} |
61493 | 15 |
@{command "fix"}~\<open>x\<close> & augment context by \<open>\<And>x. \<box>\<close> \\ |
16 |
@{command "assume"}~\<open>a: \<phi>\<close> & augment context by \<open>\<phi> \<Longrightarrow> \<box>\<close> \\ |
|
26779 | 17 |
@{command "then"} & indicate forward chaining of facts \\ |
61493 | 18 |
@{command "have"}~\<open>a: \<phi>\<close> & prove local result \\ |
19 |
@{command "show"}~\<open>a: \<phi>\<close> & prove local result, refining some goal \\ |
|
20 |
@{command "using"}~\<open>a\<close> & indicate use of additional facts \\ |
|
21 |
@{command "unfolding"}~\<open>a\<close> & unfold definitional equations \\ |
|
22 |
@{command "proof"}~\<open>m\<^sub>1\<close>~\dots~@{command "qed"}~\<open>m\<^sub>2\<close> & indicate proof structure and refinements \\ |
|
23 |
@{command "{"}~\<open>\<dots>\<close>~@{command "}"} & indicate explicit blocks \\ |
|
26779 | 24 |
@{command "next"} & switch blocks \\ |
61493 | 25 |
@{command "note"}~\<open>a = b\<close> & reconsider facts \\ |
26 |
@{command "let"}~\<open>p = t\<close> & abbreviate terms by higher-order matching \\ |
|
27 |
@{command "write"}~\<open>c (mx)\<close> & declare local mixfix syntax \\ |
|
26779 | 28 |
\end{tabular} |
29 |
||
61421 | 30 |
\<^medskip> |
26852 | 31 |
|
32 |
\begin{tabular}{rcl} |
|
61493 | 33 |
\<open>proof\<close> & = & \<open>prfx\<^sup>*\<close>~@{command "proof"}~\<open>method\<^sup>? stmt\<^sup>*\<close>~@{command "qed"}~\<open>method\<^sup>?\<close> \\ |
34 |
& \<open>|\<close> & \<open>prfx\<^sup>*\<close>~@{command "done"} \\ |
|
35 |
\<open>prfx\<close> & = & @{command "apply"}~\<open>method\<close> \\ |
|
36 |
& \<open>|\<close> & @{command "using"}~\<open>facts\<close> \\ |
|
37 |
& \<open>|\<close> & @{command "unfolding"}~\<open>facts\<close> \\ |
|
38 |
\<open>stmt\<close> & = & @{command "{"}~\<open>stmt\<^sup>*\<close>~@{command "}"} \\ |
|
39 |
& \<open>|\<close> & @{command "next"} \\ |
|
40 |
& \<open>|\<close> & @{command "note"}~\<open>name = facts\<close> \\ |
|
41 |
& \<open>|\<close> & @{command "let"}~\<open>term = term\<close> \\ |
|
42 |
& \<open>|\<close> & @{command "write"}~\<open>name (mixfix)\<close> \\ |
|
43 |
& \<open>|\<close> & @{command "fix"}~\<open>var\<^sup>+\<close> \\ |
|
44 |
& \<open>|\<close> & @{command "assume"}~\<open>name: props\<close> \\ |
|
45 |
& \<open>|\<close> & @{command "then"}\<open>\<^sup>?\<close>~\<open>goal\<close> \\ |
|
46 |
\<open>goal\<close> & = & @{command "have"}~\<open>name: props proof\<close> \\ |
|
47 |
& \<open>|\<close> & @{command "show"}~\<open>name: props proof\<close> \\ |
|
26852 | 48 |
\end{tabular} |
58618 | 49 |
\<close> |
26779 | 50 |
|
51 |
||
58618 | 52 |
subsection \<open>Abbreviations and synonyms\<close> |
26779 | 53 |
|
58618 | 54 |
text \<open> |
26852 | 55 |
\begin{tabular}{rcl} |
61493 | 56 |
@{command "by"}~\<open>m\<^sub>1 m\<^sub>2\<close> & \<open>\<equiv>\<close> & |
57 |
@{command "proof"}~\<open>m\<^sub>1\<close>~@{command "qed"}~\<open>m\<^sub>2\<close> \\ |
|
58 |
@{command ".."} & \<open>\<equiv>\<close> & @{command "by"}~\<open>standard\<close> \\ |
|
59 |
@{command "."} & \<open>\<equiv>\<close> & @{command "by"}~\<open>this\<close> \\ |
|
60 |
@{command "from"}~\<open>a\<close> & \<open>\<equiv>\<close> & @{command "note"}~\<open>a\<close>~@{command "then"} \\ |
|
61 |
@{command "with"}~\<open>a\<close> & \<open>\<equiv>\<close> & @{command "from"}~\<open>a \<AND> this\<close> \\ |
|
62 |
@{command "from"}~\<open>this\<close> & \<open>\<equiv>\<close> & @{command "then"} \\ |
|
26852 | 63 |
\end{tabular} |
58618 | 64 |
\<close> |
26779 | 65 |
|
66 |
||
58618 | 67 |
subsection \<open>Derived elements\<close> |
26779 | 68 |
|
58618 | 69 |
text \<open> |
26852 | 70 |
\begin{tabular}{rcl} |
61493 | 71 |
@{command "also"}\<open>\<^sub>0\<close> & \<open>\<approx>\<close> & |
72 |
@{command "note"}~\<open>calculation = this\<close> \\ |
|
73 |
@{command "also"}\<open>\<^sub>n\<^sub>+\<^sub>1\<close> & \<open>\<approx>\<close> & |
|
74 |
@{command "note"}~\<open>calculation = trans [OF calculation this]\<close> \\ |
|
75 |
@{command "finally"} & \<open>\<approx>\<close> & |
|
76 |
@{command "also"}~@{command "from"}~\<open>calculation\<close> \\[0.5ex] |
|
77 |
@{command "moreover"} & \<open>\<approx>\<close> & |
|
78 |
@{command "note"}~\<open>calculation = calculation this\<close> \\ |
|
79 |
@{command "ultimately"} & \<open>\<approx>\<close> & |
|
80 |
@{command "moreover"}~@{command "from"}~\<open>calculation\<close> \\[0.5ex] |
|
81 |
@{command "presume"}~\<open>a: \<phi>\<close> & \<open>\<approx>\<close> & |
|
82 |
@{command "assume"}~\<open>a: \<phi>\<close> \\ |
|
83 |
@{command "def"}~\<open>a: x \<equiv> t\<close> & \<open>\<approx>\<close> & |
|
84 |
@{command "fix"}~\<open>x\<close>~@{command "assume"}~\<open>a: x \<equiv> t\<close> \\ |
|
85 |
@{command "obtain"}~\<open>x \<WHERE> a: \<phi>\<close> & \<open>\<approx>\<close> & |
|
86 |
\<open>\<dots>\<close>~@{command "fix"}~\<open>x\<close>~@{command "assume"}~\<open>a: \<phi>\<close> \\ |
|
87 |
@{command "case"}~\<open>c\<close> & \<open>\<approx>\<close> & |
|
88 |
@{command "fix"}~\<open>x\<close>~@{command "assume"}~\<open>c: \<phi>\<close> \\ |
|
89 |
@{command "sorry"} & \<open>\<approx>\<close> & |
|
90 |
@{command "by"}~\<open>cheating\<close> \\ |
|
26852 | 91 |
\end{tabular} |
58618 | 92 |
\<close> |
26779 | 93 |
|
94 |
||
58618 | 95 |
subsection \<open>Diagnostic commands\<close> |
26779 | 96 |
|
58618 | 97 |
text \<open> |
26779 | 98 |
\begin{tabular}{ll} |
57479 | 99 |
@{command "print_state"} & print proof state \\ |
100 |
@{command "print_statement"} & print fact in long statement form \\ |
|
61493 | 101 |
@{command "thm"}~\<open>a\<close> & print fact \\ |
102 |
@{command "prop"}~\<open>\<phi>\<close> & print proposition \\ |
|
103 |
@{command "term"}~\<open>t\<close> & print term \\ |
|
104 |
@{command "typ"}~\<open>\<tau>\<close> & print type \\ |
|
26779 | 105 |
\end{tabular} |
58618 | 106 |
\<close> |
26779 | 107 |
|
108 |
||
58618 | 109 |
section \<open>Proof methods\<close> |
26779 | 110 |
|
58618 | 111 |
text \<open> |
26779 | 112 |
\begin{tabular}{ll} |
61477 | 113 |
\multicolumn{2}{l}{\<^bold>\<open>Single steps (forward-chaining facts)\<close>} \\[0.5ex] |
26779 | 114 |
@{method assumption} & apply some assumption \\ |
115 |
@{method this} & apply current facts \\ |
|
61493 | 116 |
@{method rule}~\<open>a\<close> & apply some rule \\ |
60618
4c79543cc376
renamed "default" to "standard", to make semantically clear what it is;
wenzelm
parents:
58618
diff
changeset
|
117 |
@{method standard} & apply standard rule (default for @{command "proof"}) \\ |
61493 | 118 |
@{method contradiction} & apply \<open>\<not>\<close> elimination rule (any order) \\ |
119 |
@{method cases}~\<open>t\<close> & case analysis (provides cases) \\ |
|
120 |
@{method induct}~\<open>x\<close> & proof by induction (provides cases) \\[2ex] |
|
26779 | 121 |
|
61477 | 122 |
\multicolumn{2}{l}{\<^bold>\<open>Repeated steps (inserting facts)\<close>} \\[0.5ex] |
26779 | 123 |
@{method "-"} & no rules \\ |
61493 | 124 |
@{method intro}~\<open>a\<close> & introduction rules \\ |
26779 | 125 |
@{method intro_classes} & class introduction rules \\ |
61493 | 126 |
@{method elim}~\<open>a\<close> & elimination rules \\ |
127 |
@{method unfold}~\<open>a\<close> & definitional rewrite rules \\[2ex] |
|
26779 | 128 |
|
61477 | 129 |
\multicolumn{2}{l}{\<^bold>\<open>Automated proof tools (inserting facts)\<close>} \\[0.5ex] |
26779 | 130 |
@{method iprover} & intuitionistic proof search \\ |
131 |
@{method blast}, @{method fast} & Classical Reasoner \\ |
|
132 |
@{method simp}, @{method simp_all} & Simplifier (+ Splitter) \\ |
|
133 |
@{method auto}, @{method force} & Simplifier + Classical Reasoner \\ |
|
134 |
@{method arith} & Arithmetic procedures \\ |
|
135 |
\end{tabular} |
|
58618 | 136 |
\<close> |
26779 | 137 |
|
138 |
||
58618 | 139 |
section \<open>Attributes\<close> |
26779 | 140 |
|
58618 | 141 |
text \<open> |
26779 | 142 |
\begin{tabular}{ll} |
61477 | 143 |
\multicolumn{2}{l}{\<^bold>\<open>Rules\<close>} \\[0.5ex] |
61493 | 144 |
@{attribute OF}~\<open>a\<close> & rule resolved with facts (skipping ``\<open>_\<close>'') \\ |
145 |
@{attribute of}~\<open>t\<close> & rule instantiated with terms (skipping ``\<open>_\<close>'') \\ |
|
146 |
@{attribute "where"}~\<open>x = t\<close> & rule instantiated with terms, by variable name \\ |
|
26779 | 147 |
@{attribute symmetric} & resolution with symmetry rule \\ |
61493 | 148 |
@{attribute THEN}~\<open>b\<close> & resolution with another rule \\ |
26779 | 149 |
@{attribute rule_format} & result put into standard rule format \\ |
150 |
@{attribute elim_format} & destruct rule turned into elimination rule format \\[1ex] |
|
151 |
||
61477 | 152 |
\multicolumn{2}{l}{\<^bold>\<open>Declarations\<close>} \\[0.5ex] |
26779 | 153 |
@{attribute simp} & Simplifier rule \\ |
154 |
@{attribute intro}, @{attribute elim}, @{attribute dest} & Pure or Classical Reasoner rule \\ |
|
155 |
@{attribute iff} & Simplifier + Classical Reasoner rule \\ |
|
156 |
@{attribute split} & case split rule \\ |
|
157 |
@{attribute trans} & transitivity rule \\ |
|
158 |
@{attribute sym} & symmetry rule \\ |
|
159 |
\end{tabular} |
|
58618 | 160 |
\<close> |
26779 | 161 |
|
162 |
||
58618 | 163 |
section \<open>Rule declarations and methods\<close> |
26779 | 164 |
|
58618 | 165 |
text \<open> |
26779 | 166 |
\begin{tabular}{l|lllll} |
167 |
& @{method rule} & @{method iprover} & @{method blast} & @{method simp} & @{method auto} \\ |
|
168 |
& & & @{method fast} & @{method simp_all} & @{method force} \\ |
|
169 |
\hline |
|
61493 | 170 |
@{attribute Pure.elim}\<open>!\<close> @{attribute Pure.intro}\<open>!\<close> |
171 |
& \<open>\<times>\<close> & \<open>\<times>\<close> \\ |
|
26779 | 172 |
@{attribute Pure.elim} @{attribute Pure.intro} |
61493 | 173 |
& \<open>\<times>\<close> & \<open>\<times>\<close> \\ |
174 |
@{attribute elim}\<open>!\<close> @{attribute intro}\<open>!\<close> |
|
175 |
& \<open>\<times>\<close> & & \<open>\<times>\<close> & & \<open>\<times>\<close> \\ |
|
26779 | 176 |
@{attribute elim} @{attribute intro} |
61493 | 177 |
& \<open>\<times>\<close> & & \<open>\<times>\<close> & & \<open>\<times>\<close> \\ |
26779 | 178 |
@{attribute iff} |
61493 | 179 |
& \<open>\<times>\<close> & & \<open>\<times>\<close> & \<open>\<times>\<close> & \<open>\<times>\<close> \\ |
180 |
@{attribute iff}\<open>?\<close> |
|
181 |
& \<open>\<times>\<close> \\ |
|
182 |
@{attribute elim}\<open>?\<close> @{attribute intro}\<open>?\<close> |
|
183 |
& \<open>\<times>\<close> \\ |
|
26779 | 184 |
@{attribute simp} |
61493 | 185 |
& & & & \<open>\<times>\<close> & \<open>\<times>\<close> \\ |
26779 | 186 |
@{attribute cong} |
61493 | 187 |
& & & & \<open>\<times>\<close> & \<open>\<times>\<close> \\ |
26779 | 188 |
@{attribute split} |
61493 | 189 |
& & & & \<open>\<times>\<close> & \<open>\<times>\<close> \\ |
26779 | 190 |
\end{tabular} |
58618 | 191 |
\<close> |
26779 | 192 |
|
193 |
||
58618 | 194 |
section \<open>Emulating tactic scripts\<close> |
26779 | 195 |
|
58618 | 196 |
subsection \<open>Commands\<close> |
26779 | 197 |
|
58618 | 198 |
text \<open> |
26779 | 199 |
\begin{tabular}{ll} |
61493 | 200 |
@{command "apply"}~\<open>m\<close> & apply proof method at initial position \\ |
201 |
@{command "apply_end"}~\<open>m\<close> & apply proof method near terminal position \\ |
|
26779 | 202 |
@{command "done"} & complete proof \\ |
61493 | 203 |
@{command "defer"}~\<open>n\<close> & move subgoal to end \\ |
204 |
@{command "prefer"}~\<open>n\<close> & move subgoal to beginning \\ |
|
26779 | 205 |
@{command "back"} & backtrack last command \\ |
206 |
\end{tabular} |
|
58618 | 207 |
\<close> |
26779 | 208 |
|
209 |
||
58618 | 210 |
subsection \<open>Methods\<close> |
26779 | 211 |
|
58618 | 212 |
text \<open> |
26779 | 213 |
\begin{tabular}{ll} |
61493 | 214 |
@{method rule_tac}~\<open>insts\<close> & resolution (with instantiation) \\ |
215 |
@{method erule_tac}~\<open>insts\<close> & elim-resolution (with instantiation) \\ |
|
216 |
@{method drule_tac}~\<open>insts\<close> & destruct-resolution (with instantiation) \\ |
|
217 |
@{method frule_tac}~\<open>insts\<close> & forward-resolution (with instantiation) \\ |
|
218 |
@{method cut_tac}~\<open>insts\<close> & insert facts (with instantiation) \\ |
|
219 |
@{method thin_tac}~\<open>\<phi>\<close> & delete assumptions \\ |
|
220 |
@{method subgoal_tac}~\<open>\<phi>\<close> & new claims \\ |
|
221 |
@{method rename_tac}~\<open>x\<close> & rename innermost goal parameters \\ |
|
222 |
@{method rotate_tac}~\<open>n\<close> & rotate assumptions of goal \\ |
|
223 |
@{method tactic}~\<open>text\<close> & arbitrary ML tactic \\ |
|
224 |
@{method case_tac}~\<open>t\<close> & exhaustion (datatypes) \\ |
|
225 |
@{method induct_tac}~\<open>x\<close> & induction (datatypes) \\ |
|
226 |
@{method ind_cases}~\<open>t\<close> & exhaustion + simplification (inductive predicates) \\ |
|
26779 | 227 |
\end{tabular} |
58618 | 228 |
\<close> |
26779 | 229 |
|
230 |
end |