]> matita.cs.unibo.it Git - helm.git/commitdiff
New syntax for match patterns in terms and in patterns.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Sun, 28 Oct 2007 22:25:56 +0000 (22:25 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Sun, 28 Oct 2007 22:25:56 +0000 (22:25 +0000)
helm/software/matita/help/C/sec_terms.xml

index 05385f666b3a41ad4267a1977c0e8c8dac9aa4d5..3cae2f84c1866ad13d858e14eb32953176c38c13 100644 (file)
       <entry>&id; &id; [&id;]…</entry>
       <entry>n-ary constructor (binds the n arguments)</entry>
      </row>
+     <row>
+      <entry/>
+      <entry>|</entry>
+      <entry><emphasis role="bold">_</emphasis></entry>
+      <entry>any remaining constructor (ignoring its arguments)</entry>
+     </row>
     </tbody>
    </tgroup>
   </table>
        <row>
         <entry/>
         <entry>|</entry>
-        <entry><emphasis role="bold">in match</emphasis> &term;
+        <entry><emphasis role="bold">in match</emphasis> &path;
           [<emphasis role="bold">in</emphasis>
           [&id;[<emphasis role="bold">:</emphasis> &path;]]…
           [<emphasis role="bold">⊢</emphasis> &path;]]</entry>
        <row>
        <entry id="grammar.path">&path;</entry>
        <entry>::=</entry>
-        <entry><emphasis>〈〈any &sterm; whithout occurrences of <emphasis role="bold">Set</emphasis>, <emphasis role="bold">Prop</emphasis>, <emphasis role="bold">CProp</emphasis>, <emphasis role="bold">Type</emphasis>, &id;, &uri; and user provided notation; however, <emphasis role="bold">%</emphasis> is now an additional production for &sterm;〉〉</emphasis></entry>
+        <entry><emphasis>〈〈any &sterm; without occurrences of <emphasis role="bold">Set</emphasis>, <emphasis role="bold">Prop</emphasis>, <emphasis role="bold">CProp</emphasis>, <emphasis role="bold">Type</emphasis>, &id;, &uri; and user provided notation; however, <emphasis role="bold">%</emphasis> is now an additional production for &sterm;〉〉</emphasis></entry>
        </row>
       </tbody>
      </tgroup>
        that can be represented by <emphasis role="bold">?</emphasis>.
        </para></listitem>
     </orderedlist>
+    <para>Warning: the format for a path for a <emphasis role="bold">match</emphasis> … <emphasis role="bold">with</emphasis>
+     expression is restricted to: <emphasis role="bold">match</emphasis> &path;
+     <emphasis role="bold">with</emphasis>
+     <emphasis role="bold">[</emphasis>
+     <emphasis role="bold">_</emphasis>
+     <emphasis role="bold">⇒</emphasis>
+     &path;
+     <emphasis role="bold">|</emphasis> …
+     <emphasis role="bold">|</emphasis>
+     <emphasis role="bold">_</emphasis>
+     <emphasis role="bold">⇒</emphasis>
+     &path;
+     <emphasis role="bold">]</emphasis>
+     Its semantics is the following: the n-th 
+     &quot;<emphasis role="bold">_</emphasis>
+     <emphasis role="bold">⇒</emphasis>
+     &path;&quot; branch is matched against the n-th constructor of the
+     inductive data type. The head λ-abstractions of &path; are matched
+     against the corresponding constructor arguments. 
+    </para>
     <para>For instance, the path
       <userinput>∀_,_:?.(? ? % ?)→(? ? ? %)</userinput>
        locates at once the subterms