]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/help/C/sec_terms.xml
082a5bb75f47b79d26820ac30506c11ceeb7abdd
[helm.git] / helm / software / matita / help / C / sec_terms.xml
1
2 <!-- =========== Terms, declarations and definitions ============ -->
3
4 <chapter id="sec_terms">
5   <title>Syntax</title>
6   <para>To describe syntax in this manual we use the following conventions:</para>
7   <orderedlist>
8     <listitem><para>Non terminal symbols are emphasized and have a link to their
9         definition. E.g.: &term;</para></listitem>
10     <listitem><para>Terminal symbols are in bold. E.g.:
11         <emphasis role="bold">theorem</emphasis></para></listitem>
12     <listitem><para>Optional sequences of elements are put in square brackets.
13         E.g.: [<emphasis role="bold">in</emphasis> &term;]</para></listitem>
14     <listitem><para>Alternatives are put in square brakets and they are
15         separated by vertical bars. E.g.: [<emphasis role="bold">&lt;</emphasis>|<emphasis role="bold">&gt;</emphasis>]</para></listitem>
16     <listitem><para>Repetitions of a sequence of elements are given by putting the
17     sequence in square brackets, that are followed by three dots. The empty
18     sequence is a valid repetition.
19     E.g.: [<emphasis role="bold">and</emphasis> &term;]…</para></listitem>
20     <listitem><para>Characters belonging to a set of characters are given
21      by listing the set elements in square brackets. Hyphens are used to
22      specify ranges of characters in the set.
23      E.g.: [<emphasis role="bold">a</emphasis>-<emphasis role="bold">zA</emphasis>-<emphasis role="bold">Z0</emphasis>-<emphasis role="bold">9_-</emphasis>]</para></listitem>
24   </orderedlist>
25   <sect1 id="terms_and_co">
26   <title>Terms &amp; co.</title>
27   <sect2 id="lexical">
28   <title>Lexical conventions</title>
29     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
30       <title>qstring</title>
31       <tgroup cols="4">
32       <tbody>
33        <row>
34         <entry id="grammar.qstring">&qstring;</entry>
35         <entry>::=</entry>
36         <entry><emphasis role="bold">&quot;</emphasis><emphasis>〈〈any sequence of characters excluded &quot;〉〉</emphasis><emphasis role="bold">&quot;</emphasis></entry>
37        </row>
38       </tbody>
39      </tgroup>
40     </table>
41     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
42       <title>id</title>
43       <tgroup cols="4">
44       <tbody>
45        <row>
46         <entry id="grammar.id">&id;</entry>
47         <entry>::=</entry>
48         <entry><emphasis>〈〈any sequence of letters, underscores or valid <ulink type="http" url="http://www.w3.org/TR/2004/REC-xml-20040204/#NT-Digit">XML digits</ulink> prefixed by a latin letter ([a-zA-Z]) and post-fixed by a possible empty sequence of decorators ([?'`])〉〉</emphasis></entry>
49        </row>
50       </tbody>
51      </tgroup>
52     </table>
53     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
54       <title>nat</title>
55       <tgroup cols="4">
56       <tbody>
57        <row>
58         <entry id="grammar.nat">&nat;</entry>
59         <entry>::=</entry>
60         <entry><emphasis>〈〈any sequence of valid <ulink type="http" url="http://www.w3.org/TR/2004/REC-xml-20040204/#NT-Digit">XML digits</ulink>〉〉</emphasis></entry>
61        </row>
62       </tbody>
63      </tgroup>
64     </table>
65     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
66       <title>char</title>
67       <tgroup cols="4">
68       <tbody>
69        <row>
70         <entry id="grammar.char">&char;</entry>
71         <entry>::=</entry>
72         <entry>[<emphasis role="bold">a</emphasis>-<emphasis role="bold">zA</emphasis>-<emphasis role="bold">Z0</emphasis>-<emphasis role="bold">9_-</emphasis>]</entry>
73        </row>
74       </tbody>
75      </tgroup>
76     </table>
77     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
78       <title>uri-step</title>
79       <tgroup cols="4">
80       <tbody>
81        <row>
82         <entry id="grammar.uri-step">&uri-step;</entry>
83         <entry>::=</entry>
84         <entry>&char;[&char;]…</entry>
85        </row>
86       </tbody>
87      </tgroup>
88     </table>
89     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
90       <title>uri</title>
91       <tgroup cols="4">
92       <tbody>
93        <row>
94         <entry id="grammar.uri">&uri;</entry>
95         <entry>::=</entry>
96         <entry>[<emphasis role="bold">cic:/</emphasis>|<emphasis role="bold">theory:/</emphasis>]&uri-step;[<emphasis role="bold">/</emphasis>&uri-step;]…<emphasis role="bold">.</emphasis>&id;[<emphasis role="bold">.</emphasis>&id;]…[<emphasis role="bold">#xpointer(</emphasis>&nat;<emphasis role="bold">/</emphasis>&nat;[<emphasis role="bold">/</emphasis>&nat;]…<emphasis role="bold">)</emphasis>]</entry>
97        </row>
98       </tbody>
99      </tgroup>
100     </table>
101     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
102       <title>csymbol</title>
103       <tgroup cols="4">
104       <tbody>
105        <row>
106         <entry id="grammar.csymbol">&csymbol;</entry>
107         <entry>::=</entry>
108         <entry><emphasis role="bold">'</emphasis>&id;</entry>
109        </row>
110       </tbody>
111       </tgroup>
112      </table>
113   </sect2>
114   <sect2 id="terms">
115   <title>Terms</title>
116
117   <!-- ZACK: Sample EBNF snippet, see:
118   http://www.docbook.org/tdg/en/html/productionset.html -->
119   <!--
120   <productionset>
121     <title>Terms</title>
122     <production id="grammar.term">
123       <lhs>&term;</lhs>
124       <rhs>&sterm;</rhs>
125       <lineannotation></lineannotation>
126     </production>
127   </productionset>
128   -->
129
130   <para>
131   <table frame="topbot" rowsep="0" colsep="0" role="grammar">
132     <title>Terms</title>
133     <tgroup cols="4">
134     <tbody>
135      <row>
136       <entry id="grammar.term">&term;</entry>
137       <entry>::=</entry>
138       <entry>&sterm;</entry>
139       <entry>simple or delimited term</entry>
140      </row>
141      <row>
142       <entry/>
143       <entry>|</entry>
144       <entry>&term; &term;</entry>
145       <entry>application</entry>
146      </row>
147      <row>
148       <entry/>
149       <entry>|</entry>
150       <entry><emphasis role="bold">λ</emphasis>&args;<emphasis role="bold">.</emphasis>&term;</entry>
151       <entry>λ-abstraction</entry>
152      </row>
153      <row>
154       <entry/>
155       <entry>|</entry>
156       <entry><emphasis role="bold">Π</emphasis>&args;<emphasis role="bold">.</emphasis>&term;</entry>
157       <entry>dependent product meant to define a datatype</entry>
158      </row>
159      <row>
160       <entry/>
161       <entry>|</entry>
162       <entry><emphasis role="bold">∀</emphasis>&args;<emphasis role="bold">.</emphasis>&term;</entry>
163       <entry>dependent product meant to define a proposition</entry>
164      </row>
165      <row>
166       <entry/>
167       <entry>|</entry>
168       <entry>&term; <emphasis role="bold">→</emphasis> &term;</entry>
169       <entry>non-dependent product (logical implication or function space)</entry>
170      </row>
171      <row>
172       <entry/>
173       <entry>|</entry>
174       <entry><emphasis role="bold">let</emphasis> [&id;|(&id;<emphasis role="bold">:</emphasis> &term;)] <emphasis role="bold">≝</emphasis> &term; <emphasis role="bold">in</emphasis> &term;</entry>
175       <entry>local definition</entry>
176      </row>
177      <row>
178       <entry/>
179       <entry>|</entry>
180       <entry>
181         <emphasis role="bold">let</emphasis>
182         [<emphasis role="bold">co</emphasis>]<emphasis role="bold">rec</emphasis>
183         &rec_def;
184       </entry>
185       <entry>(co)recursive definitions</entry>
186      </row>
187      <row>
188       <entry/>
189       <entry/>
190       <entry>
191       [<emphasis role="bold">and</emphasis> &rec_def;]…
192       </entry>
193       <entry/>
194      </row>
195      <row>
196       <entry/>
197       <entry/>
198       <entry>
199       <emphasis role="bold">in</emphasis> &term;
200       </entry>
201       <entry/>
202      </row>
203      <row>
204       <entry/>
205       <entry>|</entry>
206       <entry>…</entry>
207       <entry>user provided notation</entry>
208      </row>
209       <row>
210         <entry id="grammar.rec_def">&rec_def;</entry>
211         <entry>::=</entry>
212         <entry>
213           &id; [&id;|<emphasis role="bold">_</emphasis>|<emphasis role="bold">(</emphasis>&id;[<emphasis role="bold">,</emphasis>&id;]… <emphasis role="bold">:</emphasis>&term;<emphasis role="bold">)</emphasis>]…
214         </entry>
215         <entry />
216       </row>
217       <row>
218         <entry />
219         <entry />
220         <entry>
221           [<emphasis role="bold">on</emphasis> &id;]
222           [<emphasis role="bold">:</emphasis> &term;]
223           <emphasis role="bold">≝</emphasis> &term;]
224         </entry>
225         <entry />
226       </row>
227     </tbody>
228    </tgroup>
229   </table>
230
231   <table frame="topbot" rowsep="0" colsep="0" role="grammar">
232     <title>Simple terms</title>
233     <tgroup cols="4">
234     <tbody>
235      <row>
236       <entry id="grammar.sterm">&sterm;</entry>
237       <entry>::=</entry>
238       <entry><emphasis role="bold">(</emphasis>&term;<emphasis role="bold">)</emphasis></entry>
239       <entry/>
240      </row>
241      <row>
242       <entry/>
243       <entry>|</entry>
244       <entry>&id;[<emphasis role="bold">\subst[</emphasis>
245        &id;<emphasis role="bold">≔</emphasis>&term;
246        [<emphasis role="bold">;</emphasis>&id;<emphasis role="bold">≔</emphasis>&term;]…
247        <emphasis role="bold">]</emphasis>]
248       </entry>
249       <entry>identifier with optional explicit named substitution</entry>
250      </row>
251      <row>
252       <entry/>
253       <entry>|</entry>
254       <entry>&uri;</entry>
255       <entry>a qualified reference</entry>
256      </row>
257      <row>
258       <entry/>
259       <entry>|</entry>
260       <entry><emphasis role="bold">Prop</emphasis></entry>
261       <entry>the impredicative sort of propositions</entry>
262      </row>
263      <row>
264       <entry/>
265       <entry>|</entry>
266       <entry><emphasis role="bold">Set</emphasis></entry>
267       <entry>the impredicate sort of datatypes</entry>
268      </row>
269      <row>
270       <entry/>
271       <entry>|</entry>
272       <entry><emphasis role="bold">CProp</emphasis></entry>
273       <entry>one fixed predicative sort of constructive propositions</entry>
274      </row>
275      <row>
276       <entry/>
277       <entry>|</entry>
278       <entry><emphasis role="bold">Type</emphasis></entry>
279       <entry>one predicative sort of datatypes</entry>
280      </row>
281      <row>
282       <entry/>
283       <entry>|</entry>
284       <entry><emphasis role="bold">?</emphasis></entry>
285       <entry>implicit argument</entry>
286      </row>
287      <row>
288       <entry/>
289       <entry>|</entry>
290       <entry><emphasis role="bold">?n</emphasis>
291       [<emphasis role="bold">[</emphasis>
292       [<emphasis role="bold">_</emphasis>|&term;]…
293       <emphasis role="bold">]</emphasis>]</entry>
294       <entry>metavariable</entry>
295      </row>
296      <row>
297       <entry/>
298       <entry>|</entry>
299         <entry><emphasis role="bold">match</emphasis> &term; 
300         [ <emphasis role="bold">in</emphasis> &id; ]
301         [ <emphasis role="bold">return</emphasis> &term; ]
302         <emphasis role="bold">with</emphasis>
303       </entry>
304       <entry>case analysis</entry>
305      </row>
306      <row>
307       <entry/>
308       <entry/>
309       <entry>
310        <emphasis role="bold">[</emphasis> 
311        &match_branch;[<emphasis role="bold">|</emphasis>&match_branch;]…
312        <emphasis role="bold">]</emphasis> 
313       </entry>
314       <entry/>
315      </row>
316      <row>
317       <entry/>
318       <entry>|</entry>
319       <entry><emphasis role="bold">(</emphasis>&term;<emphasis role="bold">:</emphasis>&term;<emphasis role="bold">)</emphasis></entry>
320       <entry>cast</entry>
321      </row>
322      <row>
323       <entry/>
324       <entry>|</entry>
325       <entry>…</entry>
326       <entry>user provided notation at precedence 90</entry>
327      </row>
328     </tbody>
329    </tgroup>
330   </table>
331
332   <table frame="topbot" rowsep="0" colsep="0" role="grammar">
333     <title>Arguments</title>
334     <tgroup cols="4">
335     <tbody>
336      <row>
337       <entry id="grammar.args">&args;</entry>
338       <entry>::=</entry>
339       <entry>
340        <emphasis role="bold">_</emphasis>[<emphasis role="bold">:</emphasis> &term;]
341       </entry>
342       <entry>ignored argument</entry>
343      </row>
344      <row>
345       <entry/>
346       <entry>|</entry>
347       <entry>
348        <emphasis role="bold">(</emphasis><emphasis role="bold">_</emphasis>[<emphasis role="bold">:</emphasis> &term;]<emphasis role="bold">)</emphasis>
349       </entry>
350       <entry>ignored argument</entry>
351      </row>
352      <row>
353       <entry/>
354       <entry>|</entry>
355       <entry>&id;[<emphasis role="bold">,</emphasis>&id;]…[<emphasis role="bold">:</emphasis> &term;]</entry>
356       <entry></entry>
357      </row>
358      <row>
359       <entry/>
360       <entry>|</entry>
361       <entry><emphasis role="bold">(</emphasis>&id;[<emphasis role="bold">,</emphasis>&id;]…[<emphasis role="bold">:</emphasis> &term;]<emphasis role="bold">)</emphasis></entry>
362       <entry/>
363      </row>
364      <row>
365       <entry id="grammar.args2">&args2;</entry>
366       <entry>::=</entry>
367       <entry>&id;</entry>
368       <entry/>
369      </row>
370      <row>
371       <entry/>
372       <entry>|</entry>
373       <entry><emphasis role="bold">(</emphasis>&id;[<emphasis role="bold">,</emphasis>&id;]…<emphasis role="bold">:</emphasis> &term;<emphasis role="bold">)</emphasis></entry>
374       <entry/>
375      </row>
376     </tbody>
377    </tgroup>
378   </table>
379
380   <table frame="topbot" rowsep="0" colsep="0" role="grammar">
381     <title>Pattern matching</title>
382     <tgroup cols="4">
383     <tbody>
384       <row>
385         <entry id="grammar.match_branch">&match_branch;</entry>
386         <entry>::=</entry>
387         <entry>&match_pattern; <emphasis role="bold">⇒</emphasis> &term;</entry>
388         <entry />
389       </row>
390      <row>
391       <entry id="grammar.match_pattern">&match_pattern;</entry>
392       <entry>::=</entry>
393       <entry>&id;</entry>
394       <entry>0-ary constructor</entry>
395      </row>
396      <row>
397       <entry/>
398       <entry>|</entry>
399       <entry><emphasis role="bold">(</emphasis>&id; &id; [&id;]…<emphasis role="bold">)</emphasis></entry>
400       <entry>n-ary constructor (binds the n arguments)</entry>
401      </row>
402      <row>
403       <entry/>
404       <entry>|</entry>
405       <entry>&id; &id; [&id;]…</entry>
406       <entry>n-ary constructor (binds the n arguments)</entry>
407      </row>
408      <row>
409       <entry/>
410       <entry>|</entry>
411       <entry><emphasis role="bold">_</emphasis></entry>
412       <entry>any remaining constructor (ignoring its arguments)</entry>
413      </row>
414     </tbody>
415    </tgroup>
416   </table>
417   </para>
418
419   </sect2>
420   </sect1>
421
422   <sect1 id="axiom_definition_declaration">
423    <title>Definitions and declarations</title>
424    <sect2 id="axiom">
425     <title><emphasis role="bold">axiom</emphasis> &id;<emphasis role="bold">:</emphasis> &term;</title>
426     <titleabbrev>axiom</titleabbrev>
427     <para><userinput>axiom H: P</userinput></para>
428     <para><command>H</command> is declared as an axiom that states <command>P</command></para>
429   </sect2>
430   <sect2 id="definition">
431     <title><emphasis role="bold">definition</emphasis> &id;[<emphasis role="bold">:</emphasis> &term;] [<emphasis role="bold">≝</emphasis> &term;]</title>
432     <titleabbrev>definition</titleabbrev>
433     <para><userinput>definition f: T ≝ t</userinput></para>
434     <para><command>f</command> is defined as <command>t</command>;
435      <command>T</command> is its type. An error is raised if the type of
436      <command>t</command> is not convertible to <command>T</command>.</para>
437     <para><command>T</command> is inferred from <command>t</command> if
438       omitted.</para>
439     <para><command>t</command> can be omitted only if <command>T</command> is
440      given. In this case Matita enters in interactive mode and
441      <command>f</command> must be defined by means of tactics.</para>
442     <para>Notice that the command is equivalent to <command>theorem f: T ≝ t</command>.</para>
443   </sect2>
444   <sect2 id="letrec">
445     <title><emphasis role="bold">letrec</emphasis> &TODO;</title>
446     <titleabbrev>&TODO;</titleabbrev>
447     <para>&TODO;</para>
448   </sect2>
449   <sect2 id="inductive">
450     <title>[<emphasis role="bold">inductive</emphasis>|<emphasis role="bold">coinductive</emphasis>] &id; [&args2;]… <emphasis role="bold">:</emphasis> &term; <emphasis role="bold">≝</emphasis> [<emphasis role="bold">|</emphasis>] [&id;<emphasis role="bold">:</emphasis>&term;] [<emphasis role="bold">|</emphasis> &id;<emphasis role="bold">:</emphasis>&term;]…
451 [<emphasis role="bold">with</emphasis> &id; <emphasis role="bold">:</emphasis> &term; <emphasis role="bold">≝</emphasis> [<emphasis role="bold">|</emphasis>] [&id;<emphasis role="bold">:</emphasis>&term;] [<emphasis role="bold">|</emphasis> &id;<emphasis role="bold">:</emphasis>&term;]…]…
452 </title>
453     <titleabbrev>(co)inductive types declaration</titleabbrev>
454     <para><userinput>inductive i x y z: S ≝ k1:T1 | … | kn:Tn with i' : S' ≝ k1':T1' | … | km':Tm'</userinput></para>
455     <para>Declares a family of two mutually inductive types
456      <command>i</command> and <command>i'</command> whose types are
457      <command>S</command> and <command>S'</command>, which must be convertible
458      to sorts.</para>
459     <para>The constructors <command>ki</command> of type <command>Ti</command>
460      and <command>ki'</command> of type <command>Ti'</command> are also
461      simultaneously declared. The declared types <command>i</command> and
462      <command>i'</command> may occur in the types of the constructors, but
463      only in strongly positive positions according to the rules of the
464      calculus.</para>
465     <para>The whole family is parameterized over the arguments <command>x,y,z</command>.</para>
466     <para>If the keyword <command>coinductive</command> is used, the declared
467      types are considered mutually coinductive.</para>
468     <para>Elimination principles for the record are automatically generated
469      by Matita, if allowed by the typing rules of the calculus according to
470      the sort <command>S</command>. If generated,
471      they are named <command>i_ind</command>, <command>i_rec</command> and
472      <command>i_rect</command> according to the sort of their induction
473      predicate.</para> 
474   </sect2>
475   <sect2 id="record">
476     <title><emphasis role="bold">record</emphasis> &id; [&args2;]… <emphasis role="bold">:</emphasis> &term; <emphasis role="bold">≝</emphasis><emphasis role="bold">{</emphasis>[&id; [<emphasis role="bold">:</emphasis>|<emphasis role="bold">:&gt;</emphasis>] &term;] [<emphasis role="bold">;</emphasis>&id; [<emphasis role="bold">:</emphasis>|<emphasis role="bold">:&gt;</emphasis>] &term;]…<emphasis role="bold">}</emphasis></title>
477     <titleabbrev>record</titleabbrev>
478     <para><userinput>record id x y z: S ≝ { f1: T1; …; fn:Tn }</userinput></para>
479     <para>Declares a new record family <command>id</command> parameterized over
480      <command>x,y,z</command>.</para>
481     <para><command>S</command> is the type of the record
482      and it must be convertible to a sort.</para>
483     <para>Each field <command>fi</command> is declared by giving its type
484      <command>Ti</command>. A record without any field is admitted.</para>
485     <para>Elimination principles for the record are automatically generated
486      by Matita, if allowed by the typing rules of the calculus according to
487      the sort <command>S</command>. If generated,
488      they are named <command>i_ind</command>, <command>i_rec</command> and
489      <command>i_rect</command> according to the sort of their induction
490      predicate.</para> 
491     <para>For each field <command>fi</command> a record projection
492      <command>fi</command> is also automatically generated if projection
493      is allowed by the typing rules of the calculus according to the
494      sort <command>S</command>, the type <command>T1</command> and
495      the definability of depending record projections.</para>
496     <para>If the type of a field is declared with <command>:&gt;</command>,
497      the corresponding record projection becomes an implicit coercion.
498      This is just syntactic sugar and it has the same effect of declaring the
499      record projection as a coercion later on.</para>
500   </sect2>
501   </sect1>
502
503   <sect1 id="proofs">
504    <title>Proofs</title>
505    <sect2 id="theorem">
506     <title><emphasis role="bold">theorem</emphasis> &id;[<emphasis role="bold">:</emphasis> &term;] [<emphasis role="bold">≝</emphasis> &term;]</title>
507     <titleabbrev>theorem</titleabbrev>
508     <para><userinput>theorem f: P ≝ p</userinput></para>
509     <para>Proves a new theorem <command>f</command> whose thesis is
510      <command>P</command>.</para>
511     <para>If <command>p</command> is provided, it must be a proof term for
512      <command>P</command>. Otherwise an interactive proof is started.</para>
513     <para><command>P</command> can be omitted only if the proof is not
514      interactive.</para>
515     <para>Proving a theorem already proved in the library is an error.
516      To provide an alternative name and proof for the same theorem, use
517      <command>variant f: P ≝ p</command>.</para>
518     <para>A warning is raised if the name of the theorem cannot be obtained
519       by mangling the name of the constants in its thesis.</para>
520     <para>Notice that the command is equivalent to <command>definition f: T ≝ t</command>.</para>
521    </sect2>
522    <sect2 id="variant">
523     <title><emphasis role="bold">variant</emphasis> &id;<emphasis role="bold">:</emphasis> &term; <emphasis role="bold">≝</emphasis> &term;</title>
524     <titleabbrev>variant</titleabbrev>
525     <para><userinput>variant f: T ≝ t</userinput></para>
526     <para>Same as <command>theorem f: T ≝ t</command>, but it does not
527      complain if the theorem has already been proved. To be used to give
528      an alternative name or proof to a theorem.</para>
529    </sect2>
530    <sect2 id="lemma">
531     <title><emphasis role="bold">lemma</emphasis> &id;[<emphasis role="bold">:</emphasis> &term;] [<emphasis role="bold">≝</emphasis> &term;]</title>
532     <titleabbrev>lemma</titleabbrev>
533     <para><userinput>lemma f: T ≝ t</userinput></para>
534     <para>Same as <command>theorem f: T ≝ t</command></para>
535    </sect2>
536    <sect2 id="fact">
537     <title><emphasis role="bold">fact</emphasis> &id;[<emphasis role="bold">:</emphasis> &term;] [<emphasis role="bold">≝</emphasis> &term;]</title>
538     <titleabbrev>fact</titleabbrev>
539     <para><userinput>fact f: T ≝ t</userinput></para>
540     <para>Same as <command>theorem f: T ≝ t</command></para>
541    </sect2>
542    <sect2 id="remark">
543     <title><emphasis role="bold">remark</emphasis> &id;[<emphasis role="bold">:</emphasis> &term;] [<emphasis role="bold">≝</emphasis> &term;]</title>
544     <titleabbrev>remark</titleabbrev>
545     <para><userinput>remark f: T ≝ t</userinput></para>
546     <para>Same as <command>theorem f: T ≝ t</command></para>
547    </sect2>
548   </sect1>
549
550   <sect1 id="tacticargs">
551    <title>Tactic arguments</title>
552    <para>This section documents the syntax of some recurring arguments for
553     tactics.</para>
554
555     <sect2 id="introsspec">
556     <title>intros-spec</title>
557     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
558       <title>intros-spec</title>
559       <tgroup cols="4">
560       <tbody>
561        <row>
562         <entry id="grammar.intros-spec">&intros-spec;</entry>
563         <entry>::=</entry>
564         <entry>[&nat;] [<emphasis role="bold">(</emphasis>[&id;]…<emphasis role="bold">)</emphasis>]</entry>
565        </row>
566       </tbody>
567      </tgroup>
568     </table>
569         <para>The natural number is the number of new hypotheses to be introduced. The list of identifiers gives the name for the first hypotheses.</para>
570     </sect2>
571
572     <sect2 id="pattern">
573     <title>pattern</title>
574     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
575       <title>pattern</title>
576       <tgroup cols="4">
577       <tbody>
578        <row>
579         <entry id="grammar.pattern">&pattern;</entry>
580         <entry>::=</entry>
581         <entry><emphasis role="bold">in</emphasis>
582           [&id;[<emphasis role="bold">:</emphasis> &path;]]…
583           [<emphasis role="bold">⊢</emphasis> &path;]]</entry>
584         <entry>simple pattern</entry>
585        </row>
586        <row>
587         <entry/>
588         <entry>|</entry>
589         <entry><emphasis role="bold">in match</emphasis> &path;
590           [<emphasis role="bold">in</emphasis>
591           [&id;[<emphasis role="bold">:</emphasis> &path;]]…
592           [<emphasis role="bold">⊢</emphasis> &path;]]</entry>
593         <entry>full pattern</entry>
594        </row>
595       </tbody>
596      </tgroup>
597     </table>
598     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
599       <title>path</title>
600       <tgroup cols="4">
601       <tbody>
602        <row>
603         <entry id="grammar.path">&path;</entry>
604         <entry>::=</entry>
605         <entry><emphasis>〈〈any &sterm; without occurrences of <emphasis role="bold">Set</emphasis>, <emphasis role="bold">Prop</emphasis>, <emphasis role="bold">CProp</emphasis>, <emphasis role="bold">Type</emphasis>, &id;, &uri; and user provided notation; however, <emphasis role="bold">%</emphasis> is now an additional production for &sterm;〉〉</emphasis></entry>
606        </row>
607       </tbody>
608      </tgroup>
609     </table>
610     <para>A <emphasis>path</emphasis> locates zero or more subterms of a given term by mimicking the term structure up to:</para>
611     <orderedlist>
612       <listitem><para>Occurrences of the subterms to locate that are
613        represented by <emphasis role="bold">%</emphasis>.</para></listitem>
614       <listitem><para>Subterms without any occurrence of subterms to locate
615        that can be represented by <emphasis role="bold">?</emphasis>.
616        </para></listitem>
617     </orderedlist>
618     <para>Warning: the format for a path for a <emphasis role="bold">match</emphasis> … <emphasis role="bold">with</emphasis>
619      expression is restricted to: <emphasis role="bold">match</emphasis> &path;
620      <emphasis role="bold">with</emphasis>
621      <emphasis role="bold">[</emphasis>
622      <emphasis role="bold">_</emphasis>
623      <emphasis role="bold">⇒</emphasis>
624      &path;
625      <emphasis role="bold">|</emphasis> …
626      <emphasis role="bold">|</emphasis>
627      <emphasis role="bold">_</emphasis>
628      <emphasis role="bold">⇒</emphasis>
629      &path;
630      <emphasis role="bold">]</emphasis>
631      Its semantics is the following: the n-th 
632      &quot;<emphasis role="bold">_</emphasis>
633      <emphasis role="bold">⇒</emphasis>
634      &path;&quot; branch is matched against the n-th constructor of the
635      inductive data type. The head λ-abstractions of &path; are matched
636      against the corresponding constructor arguments. 
637     </para>
638     <para>For instance, the path
639       <userinput>∀_,_:?.(? ? % ?)→(? ? ? %)</userinput>
640        locates at once the subterms
641       <userinput>x+y</userinput> and <userinput>x*y</userinput> in the
642       term <userinput>∀x,y:nat.x+y=1→0=x*y</userinput>
643       (where the notation <userinput>A=B</userinput> hides the term
644       <userinput>(eq T A B)</userinput> for some type <userinput>T</userinput>).
645     </para>
646     <para>A <emphasis>simple pattern</emphasis> extends paths to locate
647      subterms in a whole sequent. In particular, the pattern
648      <userinput>in H: p  K: q ⊢ r</userinput> locates at once all the subterms
649      located by the pattern <userinput>r</userinput> in the conclusion of the
650      sequent and by the patterns <userinput>p</userinput> and
651      <userinput>q</userinput> in the hypotheses <userinput>H</userinput>
652      and <userinput>K</userinput> of the sequent.
653     </para>
654     <para>If no list of hypotheses is provided in a simple pattern, no subterm
655      is selected in the hypothesis. If the <userinput>⊢ p</userinput>
656      part of the pattern is not provided, no subterm will be matched in the
657      conclusion if at least one hypothesis is provided; otherwise the whole
658      conclusion is selected.
659     </para>
660     <para>Finally, a <emphasis>full pattern</emphasis> is interpreted in three
661      steps. In the first step the <userinput>match T in</userinput>
662      part is ignored and a set <emphasis>S</emphasis> of subterms is
663      located as for the case of
664      simple patterns. In the second step the term <userinput>T</userinput>
665      is parsed and interpreted in the context of each subterm
666      <emphasis>s ∈ S</emphasis>. In the last term for each
667      <emphasis>s ∈ S</emphasis> the interpreted term <userinput>T</userinput>
668      computed in the previous step is looked for. The final set of subterms
669      located by the full pattern is the set of occurrences of
670      the interpreted <userinput>T</userinput> in the subterms <emphasis>s</emphasis>.
671     </para>
672     <para>A full pattern can always be replaced by a simple pattern,
673       often at the cost of increased verbosity or decreased readability.</para>
674     <para>Example: the pattern
675       <userinput>⊢ in match x+y in ∀_,_:?.(? ? % ?)</userinput>
676       locates only the first occurrence of <userinput>x+y</userinput>
677       in the sequent <userinput>x,y: nat ⊢ ∀z,w:nat. (x+y) * (z+w) =
678       z * (x+y) + w * (x+y)</userinput>. The corresponding simple pattern
679       is <userinput>⊢ ∀_,_:?.(? ? (? % ?) ?)</userinput>.
680     </para>
681     <para>Every tactic that acts on subterms of the selected sequents have
682      a pattern argument for uniformity. To automatically generate a simple
683      pattern:</para>
684     <orderedlist>
685      <listitem><para>Select in the current goal the subterms to pass to the
686       tactic by using the mouse. In order to perform a multiple selection of
687       subterms, hold the Ctrl key while selecting every subterm after the
688       first one.</para></listitem>
689      <listitem><para>From the contextual menu select &quot;Copy&quot;.</para></listitem>
690      <listitem><para>From the &quot;Edit&quot; or the contextual menu select
691       &quot;Paste as pattern&quot;</para></listitem>
692     </orderedlist>
693     </sect2>
694
695     <sect2 id="reduction-kind">
696     <title>reduction-kind</title>
697     <para>Reduction kinds are normalization functions that transform a term
698      to a convertible but simpler one. Each reduction kind can be used both
699      as a tactic argument and as a stand-alone tactic.</para>
700     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
701       <title>reduction-kind</title>
702       <tgroup cols="4">
703       <tbody>
704        <row>
705         <entry id="grammar.reduction-kind">&reduction-kind;</entry>
706         <entry>::=</entry>
707         <entry><emphasis role="bold">normalize</emphasis></entry>
708         <entry>Computes the βδιζ-normal form</entry>
709        </row>
710        <row>
711         <entry/>
712         <entry>|</entry>
713         <entry><emphasis role="bold">simplify</emphasis></entry>
714         <entry>Computes a form supposed to be simpler</entry>
715        </row>
716        <row>
717         <entry/>
718         <entry>|</entry>
719         <entry><emphasis role="bold">unfold</emphasis> [&sterm;]</entry>
720         <entry>δ-reduces the constant or variable if specified, or that
721          in head position</entry>
722        </row>
723        <row>
724         <entry/>
725         <entry>|</entry>
726         <entry><emphasis role="bold">whd</emphasis></entry>
727         <entry>Computes the βδιζ-weak-head normal form</entry>
728        </row>
729       </tbody>
730      </tgroup>
731     </table>
732     </sect2>
733
734     <sect2 id="auto-params">
735     <title>auto-params</title>
736     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
737       <title>auto-params</title>
738       <tgroup cols="4">
739       <tbody>
740        <row>
741         <entry id="grammar.autoparams">&autoparams;</entry>
742         <entry>::=</entry>
743         <entry>[&simpleautoparam;]…
744                [<emphasis role="bold">by</emphasis>
745                 &term; [,&term;]…]
746         </entry>
747        </row>
748       </tbody>
749      </tgroup>
750     </table>
751     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
752       <title>simple-auto-param</title>
753       <tgroup cols="4">
754       <tbody>
755        <row>
756         <entry id="grammar.simpleautoparam">&simpleautoparam;</entry>
757         <entry>::=</entry>
758         <entry><emphasis role="bold">depth=&nat;</emphasis></entry>
759         <entry>Give a bound to the depth of the search tree</entry>
760        </row>
761        <row>
762         <entry/>
763         <entry>|</entry>
764         <entry><emphasis role="bold">width=&nat;</emphasis></entry>
765         <entry>The maximal width of the search tree</entry>
766        </row>
767        <row>
768         <entry/>
769         <entry>|</entry>
770         <entry><emphasis role="bold">library</emphasis></entry>
771         <entry>Search everywhere (not only in included files)</entry>
772        </row>
773        <row>
774         <entry/>
775         <entry>|</entry>
776         <entry><emphasis role="bold">type</emphasis></entry>
777         <entry>Try to close also goals of sort Type, otherwise only goals
778                living in sort Prop are attacked.
779         </entry>
780        </row>
781        <row>
782         <entry/>
783         <entry>|</entry>
784         <entry><emphasis role="bold">paramodulation</emphasis></entry>
785         <entry>Try to close the goal performing unit-equality paramodulation
786         </entry>
787        </row>
788        <row>
789         <entry/>
790         <entry>|</entry>
791         <entry><emphasis role="bold">timeout=&nat;</emphasis></entry>
792         <entry>Timeout in seconds
793         </entry>
794        </row>
795       </tbody>
796      </tgroup>
797     </table>
798     </sect2>
799
800     <sect2 id="justification">
801     <title>justification</title>
802     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
803       <title>justification</title>
804       <tgroup cols="4">
805       <tbody>
806        <row>
807         <entry id="grammar.justification">&justification;</entry>
808   <entry>::=</entry>
809         <entry><emphasis role="bold">using</emphasis> &term;</entry>
810         <entry>Proof term manually provided</entry>
811        </row>
812        <row>
813         <entry/>
814         <entry>|</entry>
815         <entry>&autoparams;</entry>
816         <entry>Call automation</entry>
817        </row>
818       </tbody>
819      </tgroup>
820     </table>
821     </sect2>
822   </sect1>
823
824 </chapter>
825