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 with ariety saturation nocomposites</userinput></para>
83 <term>Synopsis:</term>
86 <emphasis role="bold">coercion</emphasis>
87 (&uri; | &term; <emphasis role="bold">with</emphasis>)
89 [ <emphasis role="bold">nocomposites</emphasis> ]
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>
122 <sect1 id="command_default">
123 <title>default</title>
124 <para><userinput>default "s" u<subscript>1</subscript> … u<subscript>n</subscript></userinput></para>
128 <term>Synopsis:</term>
130 <para><emphasis role="bold">default</emphasis>
131 &qstring; &uri; [&uri;]…
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>
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.
152 <title>clusters</title>
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>
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>
187 <entry>an inductive type of type <emphasis role="bold">Prop</emphasis> with only one constructor that has no arguments</entry>
195 <entry>an inductive type of type <emphasis role="bold">Prop</emphasis> without constructors</entry>
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>
217 <sect1 id="command_hint">
219 <para><userinput>hint</userinput></para>
223 <term>Synopsis:</term>
225 <para><emphasis role="bold">hint</emphasis>
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
243 <sect1 id="command_include">
244 <title>include</title>
245 <para><userinput>include "s"</userinput></para>
249 <term>Synopsis:</term>
251 <para><emphasis role="bold">include</emphasis> &qstring;</para>
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.
275 <sect1 id="command_include_first">
276 <title>include' "s"</title>
277 <para><userinput></userinput></para>
281 <term>Synopsis:</term>
283 <para><emphasis role="bold">include'</emphasis> &qstring;</para>
289 <para>Not documented (&TODO;), do not use it.</para>
295 <sect1 id="command_whelp">
297 <para><userinput>whelp locate "s"</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>
305 <term>Synopsis:</term>
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;
320 <para>Performs the corresponding <link linkend="whelp">query</link>,
321 showing the result in the CIC browser. The command is removed
329 <sect1 id="command_qed">
331 <para><userinput></userinput></para>
335 <term>Synopsis:</term>
337 <para><emphasis role="bold">qed</emphasis>
344 <para>Saves and indexes the current interactive theorem or
346 In order to do this, the set of sequents still to be proved
347 must be empty.</para>