]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/help/C/sec_terms.xml
Syntax highlighting for focus/unfocus
[helm.git] / helm / software / matita / help / C / sec_terms.xml
index e9402f2371d3757eaa4e479e269bb7d351e17882..3171544a22c2773a7295dad6374e62ce3b08f7a1 100644 (file)
 <!-- =========== Terms, declarations and definitions ============ -->
 
 <chapter id="sec_terms">
-  <title>Terms, axioms, definitions, declarations and proofs</title>
+  <title>Syntax</title>
+  <para>To describe syntax in this manual we use the following conventions:</para>
+  <orderedlist>
+   <listitem>Non terminal symbols are emphasized and have a link to their definition. E.g.: &term;</listitem>
+   <listitem>Terminal symbols are in bold. E.g.: <emphasis role="bold">theorem</emphasis></listitem>
+   <listitem>Optional sequences of elements are put in square brackets.
+    E.g.: [<emphasis role="bold">in</emphasis> &term;]</listitem>
+   <listitem>Alternatives are put in square brakets and they are separated
+    by vertical bars. E.g.: [<emphasis role="bold">&lt;</emphasis>|<emphasis role="bold">&gt;</emphasis>]</listitem>
+   <listitem>Repetition of sequences of elements are given by putting the
+    first sequence in square brackets, that are followed by three dots.
+    E.g.: [<emphasis role="bold">and</emphasis> &term;]…</listitem>
+  </orderedlist>
+  <sect1 id="terms_and_co">
+  <title>Terms &amp; co.</title>
+  <sect2 id="lexical">
+  <title>Lexical conventions</title>
+  <table>
+    <tgroup>
+     <thead />
+    <tbody>
+     <row>
+      <entry id="id">&id;</entry>
+      <entry>::=</entry>
+      <entry><emphasis>〈〈&TODO;〉〉</emphasis></entry>
+     </row>
+    </tbody>
+   </tgroup>
+  </table>
+  <table>
+    <tgroup>
+     <thead />
+    <tbody>
+     <row>
+      <entry id="nat">&nat;</entry>
+      <entry>::=</entry>
+      <entry><emphasis>〈〈&TODO;〉〉</emphasis></entry>
+     </row>
+    </tbody>
+   </tgroup>
+  </table>
+  <table>
+    <tgroup>
+     <thead />
+    <tbody>
+     <row>
+      <entry id="uri">&uri;</entry>
+      <entry>::=</entry>
+      <entry><emphasis>〈〈&TODO;〉〉</emphasis></entry>
+     </row>
+    </tbody>
+   </tgroup>
+  </table>
+  </sect2>
+  <sect2 id="terms">
+  <title>Terms</title>
+  <table>
+    <tgroup>
+     <thead />
+    <tbody>
+     <row>
+      <entry id="term">&term;</entry>
+      <entry>::=</entry>
+      <entry>&id;</entry>
+      <entry>identifier</entry>
+     </row>
+     <row>
+      <entry/>
+      <entry>|</entry>
+      <entry>&uri;</entry>
+      <entry>a qualified reference</entry>
+     </row>
+     <row>
+      <entry/>
+      <entry>|</entry>
+      <entry><emphasis role="bold">Prop</emphasis></entry>
+      <entry>the impredicative sort of propositions</entry>
+     </row>
+     <row>
+      <entry/>
+      <entry>|</entry>
+      <entry><emphasis role="bold">Set</emphasis></entry>
+      <entry>the impredicate sort of datatypes</entry>
+     </row>
+     <row>
+      <entry/>
+      <entry>|</entry>
+      <entry><emphasis role="bold">Type</emphasis></entry>
+      <entry>one predicative sort of datatypes</entry>
+     </row>
+     <row>
+      <entry/>
+      <entry>|</entry>
+      <entry>&term; &term;</entry>
+      <entry>application</entry>
+     </row>
+     <row>
+      <entry/>
+      <entry>|</entry>
+      <entry><emphasis role="bold">λ</emphasis>&id;[<emphasis role="bold">:</emphasis> &term;]<emphasis role="bold">.</emphasis>&term;</entry>
+      <entry>λ-abstraction</entry>
+     </row>
+     <row>
+      <entry/>
+      <entry>|</entry>
+      <entry><emphasis role="bold">Π</emphasis>&id;[<emphasis role="bold">:</emphasis> &term;]<emphasis role="bold">.</emphasis>&term;</entry>
+      <entry>dependent product meant to define a datatype</entry>
+     </row>
+     <row>
+      <entry/>
+      <entry>|</entry>
+      <entry><emphasis role="bold">∀</emphasis>&id;[<emphasis role="bold">:</emphasis> &term;]<emphasis role="bold">.</emphasis>&term;</entry>
+      <entry>dependent product meant to define a proposition</entry>
+     </row>
+     <row>
+      <entry/>
+      <entry>|</entry>
+      <entry>&term; <emphasis role="bold">→</emphasis> &term;</entry>
+      <entry>non-dependent product (logical implication or function space)</entry>
+     </row>
+     <row>
+      <entry/>
+      <entry>|</entry>
+      <entry><emphasis role="bold">let</emphasis> [&id;|(&id;<emphasis role="bold">:</emphasis> &term;)] <emphasis role="bold">≝</emphasis> &term; <emphasis role="bold">in</emphasis> &term;</entry>
+      <entry>local definition</entry>
+     </row>
+     <row>
+      <entry/>
+      <entry>|</entry>
+        <entry><emphasis role="bold">match</emphasis> &term; 
+        [ <emphasis role="bold">in</emphasis> &term; ]
+        [ <emphasis role="bold">return</emphasis> &term; ]
+        <emphasis role="bold">with</emphasis>
+      </entry>
+      <entry>case analysis</entry>
+     </row>
+     <row>
+      <entry/>
+      <entry/>
+      <entry>
+       <emphasis role="bold">[</emphasis> 
+       &term_pattern; <emphasis role="bold"> ⇒ </emphasis> &term;
+         [
+         <emphasis role="bold">|</emphasis>
+         &term_pattern; <emphasis role="bold"> ⇒ </emphasis> &term;
+         ]…<emphasis role="bold">]</emphasis> </entry>
+      <entry/>
+     </row>
+     <row>
+      <entry/>
+      <entry>|</entry>
+      <entry><emphasis role="bold">let</emphasis>
+      [<emphasis role="bold">co</emphasis>]<emphasis role="bold">rec</emphasis>
+      &id; [&id;]… [<emphasis role="bold">on</emphasis> &nat;]
+      [<emphasis role="bold">:</emphasis> &term;]
+      <emphasis role="bold">≝</emphasis> &term;
+      </entry>
+      <entry>(co)recursive definitions</entry>
+     </row>
+     <row>
+      <entry/>
+      <entry/>
+      <entry>
+      [<emphasis role="bold">and</emphasis>
+      &id; [&id;]… [<emphasis role="bold">on</emphasis> &nat;]
+      [<emphasis role="bold">:</emphasis> &term;]
+      <emphasis role="bold">≝</emphasis> &term;]…
+      </entry>
+      <entry/>
+     </row>
+     <row>
+      <entry/>
+      <entry/>
+      <entry>
+      <emphasis role="bold">in</emphasis> &term;
+      </entry>
+      <entry/>
+     </row>
+    </tbody>
+   </tgroup>
+  </table>
 
-  <sect1 id="terms">
-    <title>Terms</title>
-    <!--<informaltable>
-     <tr>
-      <td>&lt;term&gt;</td>
-      <td>::=</td>
-      <td>&lt;id&gt;</td>
-      <td>identifier</td>
-     </tr>
-     <tr><td/><td>|</td><td>&lt;term&gt; &lt;term&gt;</td>
-      <td>application</td></tr>
-    </informaltable>-->
-       <table>
-         <tgroup>
-            <thead />
-           <tbody>
-             <row>
-               <entry>&lt;term&gt;</entry>
-               <entry>::=</entry>
-               <entry>&lt;id&gt;</entry>
-               <entry>identifier</entry>
-             </row>
-             <row>
-               <entry/>
-               <entry>|</entry>
-               <entry>&lt;term&gt; &lt;term&gt;</entry>
-               <entry>application</entry>
-             </row>
-             <row>
-               <entry/>
-               <entry>|</entry>
-               <entry>λ&lt;id&gt;[: &lt;term&gt;].&lt;term&gt;</entry>
-               <entry>λ-abstraction</entry>
-             </row>
-             <row>
-               <entry/>
-               <entry>|</entry>
-               <entry>Π&lt;id&gt;[: &lt;term&gt;].&lt;term&gt;</entry>
-               <entry>dependent product meant to define a datatype</entry>
-             </row>
-             <row>
-               <entry/>
-               <entry>|</entry>
-               <entry>∀&lt;id&gt;[: &lt;term&gt;].&lt;term&gt;</entry>
-               <entry>dependent product meant to define a proposition</entry>
-             </row>
-             <row>
-               <entry/>
-               <entry>|</entry>
-               <entry>&lt;term&gt; → &lt;term&gt;</entry>
-               <entry>non-dependent product (logical implication or function space)</entry>
-             </row>
-             <row>
-               <entry/>
-               <entry>|</entry>
-               <entry>let [&lt;id&gt;|(&lt;id&gt;: &lt;term&gt;)] ≝ &lt;term&gt; in &lt;term&gt;</entry>
-               <entry>local definition</entry>
-             </row>
-             <row>
-               <entry/>
-               <entry>|</entry>
-               <entry>let [co]rec &lt;id&gt; ≝ &lt;term&gt; in &lt;term&gt;</entry>
-               <entry>local definition</entry>
-             </row>
-             <row>
-               <entry/>
-               <entry>|</entry>
-               <entry>...</entry>
-               <entry>&TODO;</entry>
-             </row>
-           </tbody>
-         </tgroup>
-       </table>
+  <table>
+    <tgroup>
+     <thead />
+    <tbody>
+     <row>
+      <entry id="term_pattern">&term_pattern;</entry>
+      <entry>::=</entry>
+      <entry>&id;</entry>
+      <entry>0-ary constructor</entry>
+     </row>
+     <row>
+      <entry/>
+      <entry>|</entry>
+      <entry><emphasis role="bold">(</emphasis>&id; &id; [&id;]…<emphasis role="bold">)</emphasis></entry>
+      <entry>n-ary constructor (binds the n arguments)</entry>
+     </row>
+    </tbody>
+   </tgroup>
+  </table>
+  </sect2>
   </sect1>
 
-  <sect1 id="axiom">
-    <title>axiom &lt;id&gt;: &lt;term&gt;</title>
+  <sect1 id="axiom_definition_declaration">
+   <title>Definitions and declarations</title>
+   <sect2 id="axiom">
+    <title>axiom &id;: &term;</title>
     <titleabbrev>axiom</titleabbrev>
     <para><userinput>axiom H: P</userinput></para>
     <para><command>H</command> is declared as an axiom that states <command>P</command></para>
-  </sect1>
-
-  <sect1 id="definition">
-    <title>definition &lt;id&gt;[: &lt;term&gt;] [≝ &lt;term&gt;]</title>
+  </sect2>
+  <sect2 id="definition">
+    <title>definition &id;[: &term;] [≝ &term;]</title>
     <titleabbrev>definition</titleabbrev>
     <para><userinput>definition f: T ≝ t</userinput></para>
     <para><command>f</command> is defined as <command>t</command>;
      given. In this case Matita enters in interactive mode and
      <command>f</command> must be defined by means of tactics.</para>
     <para>Notice that the command is equivalent to <command>theorem f: T ≝ t</command>.</para>
-  </sect1>
-
-  <sect1 id="inductive">
-    <title>[co]inductive &lt;id&gt; (of inductive types)</title>
+  </sect2>
+  <sect2 id="inductive">
+    <title>[co]inductive &id; (of inductive types)</title>
     <titleabbrev>(co)inductive types declaration</titleabbrev>
     <para> &TODO; </para>
+  </sect2>
   </sect1>
 
   <sect1 id="proofs">
    <title>Proofs</title>
    <sect2 id="theorem">
-    <title>theorem &lt;id&gt;[: &lt;term&gt;] [≝ &lt;term&gt;]</title>
+    <title>theorem &id;[: &term;] [≝ &term;]</title>
     <titleabbrev>theorem</titleabbrev>
     <para><userinput>theorem f: P ≝ p</userinput></para>
     <para>Proves a new theorem <command>f</command> whose thesis is
     <para>Notice that the command is equivalent to <command>definition f: T ≝ t</command>.</para>
    </sect2>
    <sect2 id="variant">
-    <title>variant &lt;id&gt;[: &lt;term&gt;] [≝ &lt;term&gt;]</title>
+    <title>variant &id;[: &term;] [≝ &term;]</title>
     <titleabbrev>variant</titleabbrev>
     <para><userinput>variant f: T ≝ t</userinput></para>
     <para>Same as <command>theorem f: T ≝ t</command>, but it does not
      an alternative name or proof to a theorem.</para>
    </sect2>
    <sect2 id="lemma">
-    <title>lemma &lt;id&gt;[: &lt;term&gt;] [≝ &lt;term&gt;]</title>
+    <title>lemma &id;[: &term;] [≝ &term;]</title>
     <titleabbrev>lemma</titleabbrev>
     <para><userinput>lemma f: T ≝ t</userinput></para>
     <para>Same as <command>theorem f: T ≝ t</command></para>
    </sect2>
    <sect2 id="fact">
-    <title>fact &lt;id&gt;[: &lt;term&gt;] [≝ &lt;term&gt;]</title>
+    <title>fact &id;[: &term;] [≝ &term;]</title>
     <titleabbrev>fact</titleabbrev>
     <para><userinput>fact f: T ≝ t</userinput></para>
     <para>Same as <command>theorem f: T ≝ t</command></para>
    </sect2>
    <sect2 id="remark">
-    <title>remark &lt;id&gt;[: &lt;term&gt;] [≝ &lt;term&gt;]</title>
+    <title>remark &id;[: &term;] [≝ &term;]</title>
     <titleabbrev>remark</titleabbrev>
     <para><userinput>remark f: T ≝ t</userinput></para>
     <para>Same as <command>theorem f: T ≝ t</command></para>