2 <!-- ============ Commands ====================== -->
3 <chapter id="sec_commands">
4 <title>Other commands</title>
5 <sect1 id="command_alias">
7 <para><userinput>alias id "s" = "def"</userinput></para>
8 <para><userinput>alias symbol "s" (instance n) = "def"</userinput></para>
9 <para><userinput>alias num (instance n) = "def"</userinput></para>
13 <term>Synopsis:</term>
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;
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 "map <command>s</command> (or the
30 number) to <command>def</command>". For identifiers,
31 "def" 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, "def" is the label used to
38 <link linkend="interpretation">interpretation</link>.
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.
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>
55 <sect1 id="command_check">
57 <para><userinput>check t</userinput></para>
61 <term>Synopsis:</term>
63 <para><emphasis role="bold">check</emphasis> &term;</para>
69 <para>Opens a CIC browser window that shows <command>t</command>
70 together with its type. The command is immediately removed from
77 <sect1 id="command_eval">
79 <para><userinput>eval red on t</userinput></para>
83 <term>Synopsis:</term>
85 <para><emphasis role="bold">eval</emphasis>
87 <emphasis role="bold">on</emphasis>
94 <para>Opens a CIC browser window that shows
97 together with its type.</para>
103 <sect1 id="command_prefer_coercion">
104 <title>prefer coercion</title>
105 <para><userinput>prefer coercion u</userinput></para>
109 <term>Synopsis:</term>
112 <emphasis role="bold">prefer coercion</emphasis>
120 <para>The already declared coercion <command>u</command>
121 is preferred to other coercions with the same source and target.
128 <sect1 id="command_coercion">
129 <title>coercion</title>
130 <para><userinput>coercion u with ariety saturation nocomposites</userinput></para>
134 <term>Synopsis:</term>
137 <emphasis role="bold">coercion</emphasis>
138 (&uri; | &term; <emphasis role="bold">with</emphasis>)
140 [ <emphasis role="bold">nocomposites</emphasis> ]
147 <para>Declares <command>u</command> as an implicit coercion.
148 If the type of <command>u</command> is
149 <command>∀x1:T1. … ∀x(n-1):T(n-1).Tn</command> the coercion target is
150 <command>T(n - ariety)</command> while its source is
151 <command>T(n - ariety - saturation - 1)</command>.
152 Every time a term <command>x</command>
153 of type source is used with expected type target, Matita
154 automatically replaces <command>x</command> with
155 <command>(u ? … ? x ? … ?)</command> to avoid a typing error.</para>
156 Note that the number of <command>?</command> added after
157 <command>x</command> is saturation.
158 <para>Implicit coercions are not displayed to the user:
159 <command>(u ? … ? x)</command> is rendered simply
160 as <command>x</command>.</para>
161 <para>When a coercion <command>u</command> is declared
162 from source <command>s</command> to target <command>t</command>
163 and there is already a coercion <command>u'</command> of
164 target <command>s</command> or source <command>t</command>,
165 a composite implicit coercion is automatically computed
166 by Matita unless <emphasis role="bold">nocomposites</emphasis>
173 <sect1 id="command_default">
174 <title>default</title>
175 <para><userinput>default "s" u<subscript>1</subscript> … u<subscript>n</subscript></userinput></para>
179 <term>Synopsis:</term>
181 <para><emphasis role="bold">default</emphasis>
182 &qstring; &uri; [&uri;]…
189 <para>It registers a cluster of related definitions and
190 theorems to be used by tactics and the rendering engine.
191 Some functionalities of Matita are not available when some
192 clusters have not been registered. Overloading a cluster
193 registration is possible: the last registration will be the
194 default one, but the previous ones are still in effect.</para>
196 <command>s</command> is an identifier of the cluster and
197 <command>u<subscript>1</subscript> … u<subscript>n</subscript></command>
198 are the URIs of the definitions and theorems of the cluster.
199 The number <command>n</command> of required URIs depends on the
200 cluster. The following clusters are supported.
203 <title>clusters</title>
208 <entry>expected object for 1st URI</entry>
209 <entry>expected object for 2nd URI</entry>
210 <entry>expected object for 3rd URI</entry>
211 <entry>expected object for 4th URI</entry>
212 <entry>expected object for 5th URI</entry>
213 <entry>expected object for 6th URI</entry>
214 <entry>expected object for 7th URI</entry>
215 <entry>expected object for 8th URI</entry>
216 <entry>expected object for 9th URI</entry>
217 <entry>expected object for 10th URI</entry>
218 <entry>expected object for 11th URI</entry>
223 <entry>equality</entry>
224 <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>
225 <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>
226 <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>
227 <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>
228 <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>
229 <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>
230 <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>
231 <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>
232 <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>
233 <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>
234 <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>
238 <entry>an inductive type of type <emphasis role="bold">Prop</emphasis> with only one constructor that has no arguments</entry>
246 <entry>an inductive type of type <emphasis role="bold">Prop</emphasis> without constructors</entry>
253 <entry>absurd</entry>
254 <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>
268 <sect1 id="command_hint">
270 <para><userinput>hint</userinput></para>
274 <term>Synopsis:</term>
276 <para><emphasis role="bold">hint</emphasis>
283 <para>Displays a list of theorems that can be successfully
284 applied to the current selected sequent. The command is
285 removed from the script, but the window that displays the
286 theorems allow to add to the script the application of the
294 <sect1 id="command_include">
295 <title>include</title>
296 <para><userinput>include "s"</userinput></para>
300 <term>Synopsis:</term>
302 <para><emphasis role="bold">include</emphasis> &qstring;</para>
308 <para>Every <link linkend="command_coercion">coercion</link>,
309 <link linkend="notation">notation</link> and
310 <link linkend="interpretation">interpretation</link> that was active
311 when the file <command>s</command> was compiled last time
312 is made active. The same happens for declarations of
313 <link linkend="command_default">default definitions and
314 theorems</link> and disambiguation
315 hints (<link linkend="command_alias">aliases</link>).
316 On the contrary, theorem and definitions declared in a file can be
317 immediately used without including it.</para>
318 <para>The file <command>s</command> is automatically compiled
319 if it is not compiled yet.
326 <sect1 id="command_include_first">
327 <title>include' "s"</title>
328 <para><userinput></userinput></para>
332 <term>Synopsis:</term>
334 <para><emphasis role="bold">include'</emphasis> &qstring;</para>
340 <para>Not documented (&TODO;), do not use it.</para>
346 <sect1 id="command_whelp">
348 <para><userinput>whelp locate "s"</userinput></para>
349 <para><userinput>whelp hint t</userinput></para>
350 <para><userinput>whelp elim t</userinput></para>
351 <para><userinput>whelp match t</userinput></para>
352 <para><userinput>whelp instance t</userinput></para>
356 <term>Synopsis:</term>
358 <para><emphasis role="bold">whelp</emphasis>
359 [<emphasis role="bold">locate</emphasis> &qstring;
360 | <emphasis role="bold">hint</emphasis> &term;
361 | <emphasis role="bold">elim</emphasis> &term;
362 | <emphasis role="bold">match</emphasis> &term;
363 | <emphasis role="bold">instance</emphasis> &term;
371 <para>Performs the corresponding <link linkend="whelp">query</link>,
372 showing the result in the CIC browser. The command is removed
380 <sect1 id="command_qed">
382 <para><userinput></userinput></para>
386 <term>Synopsis:</term>
388 <para><emphasis role="bold">qed</emphasis>
395 <para>Saves and indexes the current interactive theorem or
397 In order to do this, the set of sequents still to be proved
398 must be empty.</para>