55 |
55 |
56 <h2>Syntax</h2> |
56 <h2>Syntax</h2> |
57 <table class="question" width="100%"> |
57 <table class="question" width="100%"> |
58 <tr> |
58 <tr> |
59 <td>There are lots of arrows in Isabelle. What's the |
59 <td>There are lots of arrows in Isabelle. What's the |
60 difference between <tt>-></tt>, <tt>=></tt>, <tt>--></tt>, |
60 difference between <tt>-></tt>, <tt>=></tt>, <tt>--></tt>, |
61 and <tt>==></tt> ?</td> |
61 and <tt>==></tt> ?</td> |
62 </tr> |
62 </tr> |
63 </table> |
63 </table> |
64 <table class="answer" width="100%"> |
64 <table class="answer" width="100%"> |
65 <tr><td>Isabelle uses the <tt>=></tt> arrow for the function |
65 <tr><td>Isabelle uses the <tt>=></tt> arrow for the function |
66 type (contrary to most functional languages which use |
66 type (contrary to most functional languages which use |
67 <tt>-></tt>). So <tt>a => b</tt> is the type of a function |
67 <tt>-></tt>). So <tt>a => b</tt> is the type of a function |
68 that takes an element of <tt>a</tt> as input and gives you an |
68 that takes an element of <tt>a</tt> as input and gives you an |
69 element of <tt>b</tt> as output. The long arrow <tt>--></tt> |
69 element of <tt>b</tt> as output. The long arrow <tt>--></tt> |
70 and <tt>==></tt> are object and meta level |
70 and <tt>==></tt> are object and meta level |
71 implication. Roughly speaking, the meta level implication |
71 implication. Roughly speaking, the meta level implication |
72 should only be used when stating theorems where it separates |
72 should only be used when stating theorems where it separates |
73 the assumptions from the conclusion. Whenever you need an |
73 the assumptions from the conclusion. Whenever you need an |
74 implication inside a HOL formula, use <code>--></code>. |
74 implication inside a HOL formula, use <code>--></code>. |
75 </td></tr> |
75 </td></tr> |
76 </table> |
76 </table> |
77 |
77 |
78 <table class="question" width="100%"><tr><td>Where do I have to put those double quotes?</td></tr></table> |
78 <table class="question" width="100%"><tr><td>Where do I have to put those double quotes?</td></tr></table> |
79 |
79 |
151 |
151 |
152 <table class="answer" width="100%"><tr><td> |
152 <table class="answer" width="100%"><tr><td> |
153 Most commonly this is a typing problem. The rule you want to apply |
153 Most commonly this is a typing problem. The rule you want to apply |
154 may require a more special (or just plain different) type from |
154 may require a more special (or just plain different) type from |
155 what you have in the current goal. Use the ProofGeneral menu |
155 what you have in the current goal. Use the ProofGeneral menu |
156 <tt>Isabelle/Isar -> Settings -> Show Types</tt> and the |
156 <tt>Isabelle/Isar -> Settings -> Show Types</tt> and the |
157 <tt>thm</tt> command on the rule you want to apply to find out if |
157 <tt>thm</tt> command on the rule you want to apply to find out if |
158 the types are what you expect them to be (also take a look at the |
158 the types are what you expect them to be (also take a look at the |
159 types in your goal). <tt>Show Sorts</tt>, <tt>Show Constants</tt>, |
159 types in your goal). <tt>Show Sorts</tt>, <tt>Show Constants</tt>, |
160 and <tt>Trace Simplifier</tt> in the same menu may also be |
160 and <tt>Trace Simplifier</tt> in the same menu may also be |
161 helpful. |
161 helpful. |
196 <p> |
196 <p> |
197 Otherwise, negate the proposition |
197 Otherwise, negate the proposition |
198 and instantiate (some) variables with concrete values. You may |
198 and instantiate (some) variables with concrete values. You may |
199 also need additional assumptions about these values. For example, |
199 also need additional assumptions about these values. For example, |
200 <tt>True & False ~= True | False</tt> is a counterexample of <tt>A |
200 <tt>True & False ~= True | False</tt> is a counterexample of <tt>A |
201 & B = A | B</tt>, and <tt>A = ~B ==> A & B ~= A | B</tt> is |
201 & B = A | B</tt>, and <tt>A = ~B ==> A & B ~= A | B</tt> is |
202 another one. Sometimes Isabelle can help you to find the |
202 another one. Sometimes Isabelle can help you to find the |
203 counterexample: just negate the proposition and do <tt>auto</tt> |
203 counterexample: just negate the proposition and do <tt>auto</tt> |
204 or <tt>simp</tt>. If lucky, you are left with the assumptions you |
204 or <tt>simp</tt>. If lucky, you are left with the assumptions you |
205 need for the counterexample to work. |
205 need for the counterexample to work. |
206 </p> |
206 </p> |
214 |
214 |
215 <table class="answer" width="100%"><tr><td>The most common reason why X-Symbol doesn't |
215 <table class="answer" width="100%"><tr><td>The most common reason why X-Symbol doesn't |
216 work is: it's not switched on yet. Assuming you are using |
216 work is: it's not switched on yet. Assuming you are using |
217 ProofGeneral and have installed the X-Symbol package, you still |
217 ProofGeneral and have installed the X-Symbol package, you still |
218 need to turn X-Symbol on in ProofGeneral: select the menu items |
218 need to turn X-Symbol on in ProofGeneral: select the menu items |
219 <tt>Proof-General -> Options -> X-Symbol</tt> and (if you want to |
219 <tt>Proof-General -> Options -> X-Symbol</tt> and (if you want to |
220 save the setting for future sessions) select <tt>Options -> Save |
220 save the setting for future sessions) select <tt>Options -> Save |
221 Options</tt> in XEmacs.</td></tr></table> |
221 Options</tt> in XEmacs.</td></tr></table> |
222 |
222 |
223 <table class="question" width="100%"><tr><td>How do I input those X-Symbols anyway?</td></tr></table> |
223 <table class="question" width="100%"><tr><td>How do I input those X-Symbols anyway?</td></tr></table> |
224 |
224 |
225 <table class="answer" width="100%"><tr><td> |
225 <table class="answer" width="100%"><tr><td> |
226 There are lots of ways to input x-symbols. The one that always |
226 There are lots of ways to input x-symbols. The one that always |
227 works is writing it out in plain text (e.g. for the 'and' symbol |
227 works is writing it out in plain text (e.g. for the 'and' symbol |
228 type <tt>\<and></tt>). For common symbols you can try to "paint |
228 type <tt>\<and></tt>). For common symbols you can try to "paint |
229 them in ASCII" and if the xsymbol package recognizes them it will |
229 them in ASCII" and if the xsymbol package recognizes them it will |
230 automatically convert them into their graphical |
230 automatically convert them into their graphical |
231 representation. Examples: <tt>--></tt> is converted into the long |
231 representation. Examples: <tt>--></tt> is converted into the long |
232 single arrow, <tt>/\</tt> is converted into the 'and' symbol, the |
232 single arrow, <tt>/\</tt> is converted into the 'and' symbol, the |
233 sequence <tt>=_</tt> into the equivalence sign, <tt><_</tt> into |
233 sequence <tt>=_</tt> into the equivalence sign, <tt><_</tt> into |
234 less-or-equal, <tt>[|</tt> into opening semantic brackets, and so |
234 less-or-equal, <tt>[|</tt> into opening semantic brackets, and so |
235 on. For greek characters, the <code>rotate</code> command works well: |
235 on. For greek characters, the <code>rotate</code> command works well: |
236 to input α type <code>a</code> and then <code>C-.</code> |
236 to input α type <code>a</code> and then <code>C-.</code> |
237 (control and <code>.</code>). You can also display the |
237 (control and <code>.</code>). You can also display the |
238 grid-of-characters in the x-symbol menu to get an overview of the |
238 grid-of-characters in the x-symbol menu to get an overview of the |