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