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_coercion">
78 <title>coercion</title>
79 <para><userinput>coercion u</userinput></para>
83 <term>Synopsis:</term>
85 <para><emphasis role="bold">coercion</emphasis> &uri;</para>
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
111 <sect1 id="command_default">
112 <title>default</title>
113 <para><userinput>default "s" u<subscript>1</subscript> … u<subscript>n</subscript></userinput></para>
117 <term>Synopsis:</term>
119 <para><emphasis role="bold">default</emphasis>
120 &qstring; &uri; [&uri;]…
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>
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.
141 <title>clusters</title>
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>
155 <entry>equality</entry>
156 <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>
157 <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>
158 <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>
159 <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>
160 <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>
164 <entry>an inductive type of type <emphasis role="bold">Prop</emphasis> with only one constructor that has no arguments</entry>
172 <entry>an inductive type of type <emphasis role="bold">Prop</emphasis> without constructors</entry>
179 <entry>absurd</entry>
180 <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>
194 <sect1 id="command_hint">
196 <para><userinput>hint</userinput></para>
200 <term>Synopsis:</term>
202 <para><emphasis role="bold">hint</emphasis>
209 <para>Displays a list of theorems that can be successfully
210 applied to the current selected sequent. The command is
211 removed from the script, but the window that displays the
212 theorems allow to add to the script the application of the
220 <sect1 id="command_include">
221 <title>include</title>
222 <para><userinput>include "s"</userinput></para>
226 <term>Synopsis:</term>
228 <para><emphasis role="bold">include</emphasis> &qstring;</para>
234 <para>Every <link linkend="command_coercion">coercion</link>,
235 <link linkend="notation">notation</link> and
236 <link linkend="interpretation">interpretation</link> that was active
237 when the file <command>s</command> was compiled last time
238 is made active. The same happens for declarations of
239 <link linkend="command_default">default definitions and
240 theorems</link> and disambiguation
241 hints (<link linkend="command_alias">aliases</link>).
242 On the contrary, theorem and definitions declared in a file can be
243 immediately used without including it.</para>
244 <para>The file <command>s</command> is automatically compiled
245 if it is not compiled yet and if it is handled by a
246 <link linkend="developments">development</link>.
253 <sect1 id="command_include_first">
254 <title>include' "s"</title>
255 <para><userinput></userinput></para>
259 <term>Synopsis:</term>
261 <para><emphasis role="bold">include'</emphasis> &qstring;</para>
267 <para>Not documented (&TODO;), do not use it.</para>
273 <sect1 id="command_set">
275 <para><userinput>set "baseuri" "s"</userinput></para>
279 <term>Synopsis:</term>
281 <para><emphasis role="bold">set</emphasis> &qstring; &qstring;</para>
287 <para>Sets to <command>s</command> the baseuri of all the
288 theorems and definitions stated in the current file.
289 The baseuri should be <command>a/b/c/foo</command>
290 if the file is named <command>foo</command> and it is in
291 the subtree <command>a/b/c</command> of the current
292 <link linkend="developments">development</link>.
293 This requirement is not enforced, but it could be in the future.
295 <para>Currently, <command>baseuri</command> is the only
296 property that can be set even if the parser accepts
297 arbitrary property names.</para>
303 <sect1 id="command_whelp">
305 <para><userinput>whelp locate "s"</userinput></para>
306 <para><userinput>whelp hint t</userinput></para>
307 <para><userinput>whelp elim t</userinput></para>
308 <para><userinput>whelp match t</userinput></para>
309 <para><userinput>whelp instance t</userinput></para>
313 <term>Synopsis:</term>
315 <para><emphasis role="bold">whelp</emphasis>
316 [<emphasis role="bold">locate</emphasis> &qstring;
317 | <emphasis role="bold">hint</emphasis> &term;
318 | <emphasis role="bold">elim</emphasis> &term;
319 | <emphasis role="bold">match</emphasis> &term;
320 | <emphasis role="bold">instance</emphasis> &term;
328 <para>Performs the corresponding <link linkend="whelp">query</link>,
329 showing the result in the CIC browser. The command is removed
337 <sect1 id="command_qed">
339 <para><userinput></userinput></para>
343 <term>Synopsis:</term>
345 <para><emphasis role="bold">qed</emphasis>
352 <para>Saves and indexes the current interactive theorem or
354 In order to do this, the set of sequents still to be proved
355 must be empty.</para>