]> matita.cs.unibo.it Git - helm.git/blob - help/C/sec_commands.xml
made executable again
[helm.git] / 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</userinput></para>
80    <para>
81      <variablelist>
82        <varlistentry>
83          <term>Synopsis:</term>
84          <listitem>
85            <para><emphasis role="bold">coercion</emphasis> &uri;</para>
86          </listitem>
87        </varlistentry>
88        <varlistentry>
89          <term>Action:</term>
90          <listitem>
91            <para>Declares <command>u</command> as an implicit coercion
92             from the type of its last argument (source)
93             to its codomain (target). Every time a term <command>x</command>
94             of type source is used with expected type target, Matita
95             automatically replaces <command>x</command> with
96             <command>(u ? … ? x)</command> to avoid a typing error.</para>
97            <para>Implicit coercions are not displayed to the user:
98             <command>(u ? … ? x)</command> is rendered simply
99             as <command>x</command>.</para>
100            <para>When a coercion <command>u</command> is declared
101             from source <command>s</command> to target <command>t</command>
102             and there is already a coercion <command>u'</command> of
103             target <command>s</command> or source <command>t</command>,
104             a composite implicit coercion is automatically computed
105             by Matita.</para>
106          </listitem>
107        </varlistentry>
108      </variablelist>
109    </para>
110  </sect1>
111  <sect1 id="command_default">
112    <title>default</title>
113    <para><userinput>default &quot;s&quot; u<subscript>1</subscript> … u<subscript>n</subscript></userinput></para>
114    <para>
115      <variablelist>
116        <varlistentry>
117          <term>Synopsis:</term>
118          <listitem>
119            <para><emphasis role="bold">default</emphasis>
120             &qstring; &uri; [&uri;]…
121            </para>
122          </listitem>
123        </varlistentry>
124        <varlistentry>
125          <term>Action:</term>
126          <listitem>
127            <para>It registers a cluster of related definitions and
128             theorems to be used by tactics and the rendering engine.
129             Some functionalities of Matita are not available when some
130             clusters have not been registered. Overloading a cluster
131             registration is possible: the last registration will be the
132             default one, but the previous ones are still in effect.</para>
133            <para>
134             <command>s</command> is an identifier of the cluster and
135             <command>u<subscript>1</subscript> … u<subscript>n</subscript></command>
136             are the URIs of the definitions and theorems of the cluster.
137             The number <command>n</command> of required URIs depends on the
138             cluster. The following clusters are supported.
139            </para>
140            <table>
141             <title>clusters</title>
142             <tgroup cols="6">
143             <thead>
144              <row>
145               <entry>name</entry>
146               <entry>expected object for 1st URI</entry>
147               <entry>expected object for 2nd URI</entry>
148               <entry>expected object for 3rd URI</entry>
149               <entry>expected object for 4th URI</entry>
150               <entry>expected object for 5th URI</entry>
151               <entry>expected object for 6th URI</entry>
152               <entry>expected object for 7th URI</entry>
153               <entry>expected object for 8th URI</entry>
154               <entry>expected object for 9th URI</entry>
155               <entry>expected object for 10th URI</entry>
156               <entry>expected object for 11th URI</entry>
157              </row>
158             </thead>
159             <tbody>
160              <row>
161               <entry>equality</entry>
162               <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>
163               <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>
164               <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>
165               <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>
166               <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>
167               <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>
168               <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>
169               <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>
170               <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>
171               <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>
172               <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>
173              </row>
174              <row>
175               <entry>true</entry>
176               <entry>an inductive type of type <emphasis role="bold">Prop</emphasis> with only one constructor that has no arguments</entry>
177               <entry/>
178               <entry/>
179               <entry/>
180               <entry/>
181              </row>
182              <row>
183               <entry>false</entry>
184               <entry>an inductive type of type <emphasis role="bold">Prop</emphasis> without constructors</entry>
185               <entry/>
186               <entry/>
187               <entry/>
188               <entry/>
189              </row>
190              <row>
191               <entry>absurd</entry>
192               <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>
193               <entry/>
194               <entry/>
195               <entry/>
196               <entry/>
197              </row>
198             </tbody>
199             </tgroup>
200            </table>
201          </listitem>
202        </varlistentry>
203      </variablelist>
204    </para>
205  </sect1>
206  <sect1 id="command_hint">
207    <title>hint</title>
208    <para><userinput>hint</userinput></para>
209    <para>
210      <variablelist>
211        <varlistentry>
212          <term>Synopsis:</term>
213          <listitem>
214            <para><emphasis role="bold">hint</emphasis>
215            </para>
216          </listitem>
217        </varlistentry>
218        <varlistentry>
219          <term>Action:</term>
220          <listitem>
221            <para>Displays a list of theorems that can be successfully
222             applied to the current selected sequent. The command is
223             removed from the script, but the window that displays the
224             theorems allow to add to the script the application of the
225             selected theorem.
226            </para>
227          </listitem>
228        </varlistentry>
229      </variablelist>
230    </para>
231  </sect1>
232  <sect1 id="command_include">
233    <title>include</title>
234    <para><userinput>include &quot;s&quot;</userinput></para>
235    <para>
236      <variablelist>
237        <varlistentry>
238          <term>Synopsis:</term>
239          <listitem>
240            <para><emphasis role="bold">include</emphasis> &qstring;</para>
241          </listitem>
242        </varlistentry>
243        <varlistentry>
244          <term>Action:</term>
245          <listitem>
246            <para>Every <link linkend="command_coercion">coercion</link>,
247             <link linkend="notation">notation</link> and
248             <link linkend="interpretation">interpretation</link> that was active
249             when the file <command>s</command> was compiled last time
250             is made active. The same happens for declarations of
251             <link linkend="command_default">default definitions and
252             theorems</link> and disambiguation
253             hints (<link linkend="command_alias">aliases</link>).
254             On the contrary, theorem and definitions declared in a file can be
255            immediately used without including it.</para>
256           <para>The file <command>s</command> is automatically compiled
257            if it is not compiled yet and if it is handled by a
258            <link linkend="developments">development</link>.
259           </para>
260          </listitem>
261        </varlistentry>
262      </variablelist>
263    </para>
264  </sect1>
265  <sect1 id="command_include_first">
266    <title>include' &quot;s&quot;</title>
267    <para><userinput></userinput></para>
268    <para>
269      <variablelist>
270        <varlistentry>
271          <term>Synopsis:</term>
272          <listitem>
273            <para><emphasis role="bold">include'</emphasis> &qstring;</para>
274          </listitem>
275        </varlistentry>
276        <varlistentry>
277          <term>Action:</term>
278          <listitem>
279            <para>Not documented (&TODO;), do not use it.</para>
280          </listitem>
281        </varlistentry>
282      </variablelist>
283    </para>
284  </sect1>
285  <sect1 id="command_set">
286    <title>set</title>
287    <para><userinput>set &quot;baseuri&quot; &quot;s&quot;</userinput></para>
288    <para>
289      <variablelist>
290        <varlistentry>
291          <term>Synopsis:</term>
292          <listitem>
293            <para><emphasis role="bold">set</emphasis> &qstring; &qstring;</para>
294          </listitem>
295        </varlistentry>
296        <varlistentry>
297          <term>Action:</term>
298          <listitem>
299            <para>Sets to <command>s</command> the baseuri of all the
300             theorems and definitions stated in the current file.
301             The baseuri should be <command>a/b/c/foo</command>
302             if the file is named <command>foo</command> and it is in
303             the subtree <command>a/b/c</command> of the current
304             <link linkend="developments">development</link>.
305             This requirement is not enforced, but it could be in the future.
306            </para>
307            <para>Currently, <command>baseuri</command> is the only
308             property that can be set even if the parser accepts
309             arbitrary property names.</para>
310          </listitem>
311        </varlistentry>
312      </variablelist>
313    </para>
314  </sect1>
315  <sect1 id="command_whelp">
316    <title>whelp</title>
317    <para><userinput>whelp locate &quot;s&quot;</userinput></para>
318    <para><userinput>whelp hint t</userinput></para>
319    <para><userinput>whelp elim t</userinput></para>
320    <para><userinput>whelp match t</userinput></para>
321    <para><userinput>whelp instance t</userinput></para>
322    <para>
323      <variablelist>
324        <varlistentry>
325          <term>Synopsis:</term>
326          <listitem>
327            <para><emphasis role="bold">whelp</emphasis>
328             [<emphasis role="bold">locate</emphasis> &qstring;
329             | <emphasis role="bold">hint</emphasis> &term;
330             | <emphasis role="bold">elim</emphasis> &term;
331             | <emphasis role="bold">match</emphasis> &term;
332             | <emphasis role="bold">instance</emphasis> &term;
333             ]
334            </para>
335          </listitem>
336        </varlistentry>
337        <varlistentry>
338          <term>Action:</term>
339          <listitem>
340            <para>Performs the corresponding <link linkend="whelp">query</link>,
341             showing the result in the CIC browser. The command is removed
342             from the script.
343            </para>
344          </listitem>
345        </varlistentry>
346      </variablelist>
347    </para>
348  </sect1>
349  <sect1 id="command_qed">
350    <title>qed</title>
351    <para><userinput></userinput></para>
352    <para>
353      <variablelist>
354        <varlistentry>
355          <term>Synopsis:</term>
356          <listitem>
357            <para><emphasis role="bold">qed</emphasis>
358            </para>
359          </listitem>
360        </varlistentry>
361        <varlistentry>
362          <term>Action:</term>
363          <listitem>
364            <para>Saves and indexes the current interactive theorem or
365             definition.
366             In order to do this, the set of sequents still to be proved
367             must be empty.</para>
368          </listitem>
369        </varlistentry>
370      </variablelist>
371    </para>
372  </sect1>
373 </chapter>
374