]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/help/C/sec_commands.xml
more work on q
[helm.git] / helm / software / matita / help / C / sec_commands.xml
1
2 <!-- ============ Commands ====================== -->
3 <chapter id="sec_commands">
4  <title>Other commands</title>
5  <sect1 id="command_alias">
6    <title>alias</title>
7    <para><userinput>alias id &quot;s&quot; = &quot;def&quot;</userinput></para>
8    <para><userinput>alias symbol &quot;s&quot; (instance n) = &quot;def&quot;</userinput></para>
9    <para><userinput>alias num (instance n) = &quot;def&quot;</userinput></para>
10    <para>
11      <variablelist>
12        <varlistentry>
13          <term>Synopsis:</term>
14          <listitem>
15            <para><emphasis role="bold">alias</emphasis>
16             [<emphasis role="bold">id</emphasis> &qstring; <emphasis role="bold">=</emphasis> &qstring;
17             | <emphasis role="bold">symbol</emphasis> &qstring; [<emphasis role="bold">(instance</emphasis> &nat;<emphasis role="bold">)</emphasis>] <emphasis role="bold">=</emphasis> &qstring;
18             | <emphasis role="bold">num</emphasis> [<emphasis role="bold">(instance</emphasis> &nat;<emphasis role="bold">)</emphasis>] <emphasis role="bold">=</emphasis> &qstring;
19             ]
20            </para>
21          </listitem>
22        </varlistentry>
23        <varlistentry>
24          <term>Action:</term>
25          <listitem>
26            <para>Used to give an hint to the disambiguating parser.
27             When the parser is faced to the identifier (or symbol)
28             <command>s</command> or to any number, it will prefer
29             interpretations that &quot;map <command>s</command> (or the
30             number) to <command>def</command>&quot;. For identifiers,
31             &quot;def&quot; is the URI of the interpretation.
32             E.g.: <command>cic:/matita/nat/nat.ind#xpointer(1/1/1)</command>
33             for the first constructor of the first inductive type defined
34             in the block of inductive type(s)
35             <command>cic:/matita/nat/nat.ind</command>.
36             For symbols and numbers, &quot;def&quot; is the label used to
37             mark the wanted
38             <link linkend="interpretation">interpretation</link>.
39            </para>
40           <para>When a symbol or a number occurs several times in the
41            term to be parsed, it is possible to give an hint only for the
42            instance <command>n</command>. When the instance is omitted,
43            the hint is valid for every occurrence.
44           </para>
45           <para>
46            Hints are automatically inserted in the script by Matita every
47            time the user is interactively asked a question to disambiguate
48            a term. This way the user won't be posed the same question twice
49            when the script will be executed again.</para>
50          </listitem>
51        </varlistentry>
52      </variablelist>
53    </para>
54  </sect1>
55  <sect1 id="command_check">
56    <title>check</title>
57    <para><userinput>check t</userinput></para>
58    <para>
59      <variablelist>
60        <varlistentry>
61          <term>Synopsis:</term>
62          <listitem>
63            <para><emphasis role="bold">check</emphasis> &term;</para>
64          </listitem>
65        </varlistentry>
66        <varlistentry>
67          <term>Action:</term>
68          <listitem>
69            <para>Opens a CIC browser window that shows <command>t</command>
70             together with its type. The command is immediately removed from
71             the script.</para>
72          </listitem>
73        </varlistentry>
74      </variablelist>
75    </para>
76  </sect1>
77  <sect1 id="command_coercion">
78    <title>coercion</title>
79    <para><userinput>coercion u with ariety saturation nocomposites</userinput></para>
80    <para>
81      <variablelist>
82        <varlistentry>
83          <term>Synopsis:</term>
84          <listitem>
85                  <para>
86                          <emphasis role="bold">coercion</emphasis> 
87                          (&uri; | &term; <emphasis role="bold">with</emphasis>)
88                          [ &nat; [&nat;]] 
89                          [ <emphasis role="bold">nocomposites</emphasis> ]
90                  </para>
91          </listitem>
92        </varlistentry>
93        <varlistentry>
94          <term>Action:</term>
95          <listitem>
96                  <para>Declares <command>u</command> as an implicit coercion.
97                  If the type of <command>u</command> is         
98                  <command>∀x1:T1. … ∀x(n-1):T(n-1).Tn</command> the coercion target is
99                  <command>T(n - ariety)</command> while its source is 
100                  <command>T(n - ariety - saturation - 1)</command>.
101             Every time a term <command>x</command>
102             of type source is used with expected type target, Matita
103             automatically replaces <command>x</command> with
104             <command>(u ? … ? x ? … ?)</command> to avoid a typing error.</para>
105             Note that the number of <command>?</command> added after 
106             <command>x</command> is saturation.
107            <para>Implicit coercions are not displayed to the user:
108             <command>(u ? … ? x)</command> is rendered simply
109             as <command>x</command>.</para>
110            <para>When a coercion <command>u</command> is declared
111             from source <command>s</command> to target <command>t</command>
112             and there is already a coercion <command>u'</command> of
113             target <command>s</command> or source <command>t</command>,
114             a composite implicit coercion is automatically computed
115             by Matita unless <emphasis role="bold">nocomposites</emphasis> 
116             is specified.</para>
117          </listitem>
118        </varlistentry>
119      </variablelist>
120    </para>
121  </sect1>
122  <sect1 id="command_default">
123    <title>default</title>
124    <para><userinput>default &quot;s&quot; u<subscript>1</subscript> … u<subscript>n</subscript></userinput></para>
125    <para>
126      <variablelist>
127        <varlistentry>
128          <term>Synopsis:</term>
129          <listitem>
130            <para><emphasis role="bold">default</emphasis>
131             &qstring; &uri; [&uri;]…
132            </para>
133          </listitem>
134        </varlistentry>
135        <varlistentry>
136          <term>Action:</term>
137          <listitem>
138            <para>It registers a cluster of related definitions and
139             theorems to be used by tactics and the rendering engine.
140             Some functionalities of Matita are not available when some
141             clusters have not been registered. Overloading a cluster
142             registration is possible: the last registration will be the
143             default one, but the previous ones are still in effect.</para>
144            <para>
145             <command>s</command> is an identifier of the cluster and
146             <command>u<subscript>1</subscript> … u<subscript>n</subscript></command>
147             are the URIs of the definitions and theorems of the cluster.
148             The number <command>n</command> of required URIs depends on the
149             cluster. The following clusters are supported.
150            </para>
151            <table>
152             <title>clusters</title>
153             <tgroup cols="6">
154             <thead>
155              <row>
156               <entry>name</entry>
157               <entry>expected object for 1st URI</entry>
158               <entry>expected object for 2nd URI</entry>
159               <entry>expected object for 3rd URI</entry>
160               <entry>expected object for 4th URI</entry>
161               <entry>expected object for 5th URI</entry>
162               <entry>expected object for 6th URI</entry>
163               <entry>expected object for 7th URI</entry>
164               <entry>expected object for 8th URI</entry>
165               <entry>expected object for 9th URI</entry>
166               <entry>expected object for 10th URI</entry>
167               <entry>expected object for 11th URI</entry>
168              </row>
169             </thead>
170             <tbody>
171              <row>
172               <entry>equality</entry>
173               <entry>an inductive type (say, of type <command>eq</command>) of type ∀A:Type.A <emphasis role="bold">→</emphasis> <emphasis role="bold">Prop</emphasis> with one family parameter and one constructor of type ∀x:A.eq A x</entry>
174               <entry>a theorem of type <emphasis role="bold">∀</emphasis>A.<emphasis role="bold">∀</emphasis>x,y:A.eq A x y <emphasis role="bold">→</emphasis> eq A y x</entry>
175               <entry>a theorem of type <emphasis role="bold">∀</emphasis>A.<emphasis role="bold">∀</emphasis>x,y,z:A.eq A x y <emphasis role="bold">→</emphasis> eq A y z <emphasis role="bold">→</emphasis> eq A x z</entry>
176               <entry><emphasis role="bold">∀</emphasis>A.<emphasis role="bold">∀</emphasis>a.<emphasis role="bold">∀</emphasis> P:A <emphasis role="bold">→</emphasis> <emphasis role="bold">Prop</emphasis>.P x <emphasis role="bold">→</emphasis> <emphasis role="bold">∀</emphasis>y.eq A x y <emphasis role="bold">→</emphasis> P y</entry>
177               <entry><emphasis role="bold">∀</emphasis>A.<emphasis role="bold">∀</emphasis>a.<emphasis role="bold">∀</emphasis> P:A <emphasis role="bold">→</emphasis> <emphasis role="bold">Prop</emphasis>.P x <emphasis role="bold">→</emphasis> <emphasis role="bold">∀</emphasis>y.eq A y x <emphasis role="bold">→</emphasis> P y</entry>
178               <entry><emphasis role="bold">∀</emphasis>A.<emphasis role="bold">∀</emphasis>a.<emphasis role="bold">∀</emphasis> P:A <emphasis role="bold">→</emphasis> <emphasis role="bold">Set</emphasis>.P x <emphasis role="bold">→</emphasis> <emphasis role="bold">∀</emphasis>y.eq A x y <emphasis role="bold">→</emphasis> P y</entry>
179               <entry><emphasis role="bold">∀</emphasis>A.<emphasis role="bold">∀</emphasis>a.<emphasis role="bold">∀</emphasis> P:A <emphasis role="bold">→</emphasis> <emphasis role="bold">Set</emphasis>.P x <emphasis role="bold">→</emphasis> <emphasis role="bold">∀</emphasis>y.eq A y x <emphasis role="bold">→</emphasis> P y</entry>
180               <entry><emphasis role="bold">∀</emphasis>A.<emphasis role="bold">∀</emphasis>a.<emphasis role="bold">∀</emphasis> P:A <emphasis role="bold">→</emphasis> <emphasis role="bold">Type</emphasis>.P x <emphasis role="bold">→</emphasis> <emphasis role="bold">∀</emphasis>y.eq A x y <emphasis role="bold">→</emphasis> P y</entry>
181               <entry><emphasis role="bold">∀</emphasis>A.<emphasis role="bold">∀</emphasis>a.<emphasis role="bold">∀</emphasis> P:A <emphasis role="bold">→</emphasis> <emphasis role="bold">Type</emphasis>.P x <emphasis role="bold">→</emphasis> <emphasis role="bold">∀</emphasis>y.eq A y x <emphasis role="bold">→</emphasis> P y</entry>
182               <entry><emphasis role="bold">∀</emphasis>A.<emphasis role="bold">∀</emphasis>B.<emphasis role="bold">∀</emphasis> f:A <emphasis role="bold">→</emphasis> B.<emphasis role="bold">∀</emphasis>x,y:A.eq A x y <emphasis role="bold">→</emphasis> eq B (f x) (f y)</entry>
183               <entry><emphasis role="bold">∀</emphasis>A.<emphasis role="bold">∀</emphasis>B.<emphasis role="bold">∀</emphasis> f:A <emphasis role="bold">→</emphasis> B.<emphasis role="bold">∀</emphasis>x,y:A.eq A x y <emphasis role="bold">→</emphasis> eq B (f y) (f x)</entry>
184              </row>
185              <row>
186               <entry>true</entry>
187               <entry>an inductive type of type <emphasis role="bold">Prop</emphasis> with only one constructor that has no arguments</entry>
188               <entry/>
189               <entry/>
190               <entry/>
191               <entry/>
192              </row>
193              <row>
194               <entry>false</entry>
195               <entry>an inductive type of type <emphasis role="bold">Prop</emphasis> without constructors</entry>
196               <entry/>
197               <entry/>
198               <entry/>
199               <entry/>
200              </row>
201              <row>
202               <entry>absurd</entry>
203               <entry>a theorem of type <emphasis role="bold">∀</emphasis>A:Prop.<emphasis role="bold">∀</emphasis>B:Prop.A <emphasis role="bold">→</emphasis> Not A <emphasis role="bold">→</emphasis> B</entry>
204               <entry/>
205               <entry/>
206               <entry/>
207               <entry/>
208              </row>
209             </tbody>
210             </tgroup>
211            </table>
212          </listitem>
213        </varlistentry>
214      </variablelist>
215    </para>
216  </sect1>
217  <sect1 id="command_hint">
218    <title>hint</title>
219    <para><userinput>hint</userinput></para>
220    <para>
221      <variablelist>
222        <varlistentry>
223          <term>Synopsis:</term>
224          <listitem>
225            <para><emphasis role="bold">hint</emphasis>
226            </para>
227          </listitem>
228        </varlistentry>
229        <varlistentry>
230          <term>Action:</term>
231          <listitem>
232            <para>Displays a list of theorems that can be successfully
233             applied to the current selected sequent. The command is
234             removed from the script, but the window that displays the
235             theorems allow to add to the script the application of the
236             selected theorem.
237            </para>
238          </listitem>
239        </varlistentry>
240      </variablelist>
241    </para>
242  </sect1>
243  <sect1 id="command_include">
244    <title>include</title>
245    <para><userinput>include &quot;s&quot;</userinput></para>
246    <para>
247      <variablelist>
248        <varlistentry>
249          <term>Synopsis:</term>
250          <listitem>
251            <para><emphasis role="bold">include</emphasis> &qstring;</para>
252          </listitem>
253        </varlistentry>
254        <varlistentry>
255          <term>Action:</term>
256          <listitem>
257            <para>Every <link linkend="command_coercion">coercion</link>,
258             <link linkend="notation">notation</link> and
259             <link linkend="interpretation">interpretation</link> that was active
260             when the file <command>s</command> was compiled last time
261             is made active. The same happens for declarations of
262             <link linkend="command_default">default definitions and
263             theorems</link> and disambiguation
264             hints (<link linkend="command_alias">aliases</link>).
265             On the contrary, theorem and definitions declared in a file can be
266            immediately used without including it.</para>
267           <para>The file <command>s</command> is automatically compiled
268           if it is not compiled yet.
269           </para>
270          </listitem>
271        </varlistentry>
272      </variablelist>
273    </para>
274  </sect1>
275  <sect1 id="command_include_first">
276    <title>include' &quot;s&quot;</title>
277    <para><userinput></userinput></para>
278    <para>
279      <variablelist>
280        <varlistentry>
281          <term>Synopsis:</term>
282          <listitem>
283            <para><emphasis role="bold">include'</emphasis> &qstring;</para>
284          </listitem>
285        </varlistentry>
286        <varlistentry>
287          <term>Action:</term>
288          <listitem>
289            <para>Not documented (&TODO;), do not use it.</para>
290          </listitem>
291        </varlistentry>
292      </variablelist>
293    </para>
294  </sect1>
295  <sect1 id="command_whelp">
296    <title>whelp</title>
297    <para><userinput>whelp locate &quot;s&quot;</userinput></para>
298    <para><userinput>whelp hint t</userinput></para>
299    <para><userinput>whelp elim t</userinput></para>
300    <para><userinput>whelp match t</userinput></para>
301    <para><userinput>whelp instance t</userinput></para>
302    <para>
303      <variablelist>
304        <varlistentry>
305          <term>Synopsis:</term>
306          <listitem>
307            <para><emphasis role="bold">whelp</emphasis>
308             [<emphasis role="bold">locate</emphasis> &qstring;
309             | <emphasis role="bold">hint</emphasis> &term;
310             | <emphasis role="bold">elim</emphasis> &term;
311             | <emphasis role="bold">match</emphasis> &term;
312             | <emphasis role="bold">instance</emphasis> &term;
313             ]
314            </para>
315          </listitem>
316        </varlistentry>
317        <varlistentry>
318          <term>Action:</term>
319          <listitem>
320            <para>Performs the corresponding <link linkend="whelp">query</link>,
321             showing the result in the CIC browser. The command is removed
322             from the script.
323            </para>
324          </listitem>
325        </varlistentry>
326      </variablelist>
327    </para>
328  </sect1>
329  <sect1 id="command_qed">
330    <title>qed</title>
331    <para><userinput></userinput></para>
332    <para>
333      <variablelist>
334        <varlistentry>
335          <term>Synopsis:</term>
336          <listitem>
337            <para><emphasis role="bold">qed</emphasis>
338            </para>
339          </listitem>
340        </varlistentry>
341        <varlistentry>
342          <term>Action:</term>
343          <listitem>
344            <para>Saves and indexes the current interactive theorem or
345             definition.
346             In order to do this, the set of sequents still to be proved
347             must be empty.</para>
348          </listitem>
349        </varlistentry>
350      </variablelist>
351    </para>
352  </sect1>
353 </chapter>
354