From: Claudio Sacerdoti Coen Date: Mon, 5 Jun 2006 11:08:49 +0000 (+0000) Subject: Record syntax is now described. X-Git-Tag: 0.4.95@7852~1362 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=55676f08ab60b802d00ed47e8089d8622bc3dadb;p=helm.git Record syntax is now described. More &TODO; put here and there. --- diff --git a/matita/help/C/matita.xml b/matita/help/C/matita.xml index 41d763c93..8934ffffd 100644 --- a/matita/help/C/matita.xml +++ b/matita/help/C/matita.xml @@ -29,6 +29,7 @@ term"> match_pattern"> args"> + args2"> sterm"> ]> diff --git a/matita/help/C/sec_gettingstarted.xml b/matita/help/C/sec_gettingstarted.xml index c1feb6d92..886603ab2 100644 --- a/matita/help/C/sec_gettingstarted.xml +++ b/matita/help/C/sec_gettingstarted.xml @@ -88,6 +88,10 @@ Authoring + + How to use developments + &TODO; + &TODO; diff --git a/matita/help/C/sec_terms.xml b/matita/help/C/sec_terms.xml index 5e29eb41e..e9c1c054c 100644 --- a/matita/help/C/sec_terms.xml +++ b/matita/help/C/sec_terms.xml @@ -277,6 +277,26 @@ + + + + + + &args2; + ::= + &id; + + + + + | + (&id;[,&id;]…: &term;) + + + + +
+ @@ -303,13 +323,13 @@ Definitions and declarations - axiom &id;: &term; + <emphasis role="bold">axiom</emphasis> &id;<emphasis role="bold">:</emphasis> &term; axiom axiom H: P H is declared as an axiom that states P - definition &id;[: &term;] [≝ &term;] + <emphasis role="bold">definition</emphasis> &id;[<emphasis role="bold">:</emphasis> &term;] [<emphasis role="bold">≝</emphasis> &term;] definition definition f: T ≝ t f is defined as t; @@ -327,12 +347,38 @@ (co)inductive types declaration &TODO; + + <emphasis role="bold">record</emphasis> &id; [&args2;]… <emphasis role="bold">:</emphasis> &term; <emphasis role="bold">≝</emphasis><emphasis role="bold">{</emphasis>[&id; [<emphasis role="bold">:</emphasis>|<emphasis role="bold">:></emphasis>] &term;] [<emphasis role="bold">;</emphasis>&id; [<emphasis role="bold">:</emphasis>|<emphasis role="bold">:></emphasis>] &term;]…<emphasis role="bold">}</emphasis> + record + record id x y z: S ≝ { f1: T1; …; fn:Tn } + Declares a new record family id parameterized over + x,y,z. + S is the type of the record + and it must be convertible to a sort. + Each field fi is declared by giving its type + Ti. A record without any field is admitted. + Elimination principles for the record are automatically generated + by Matita, if allowed by the typing rules of the calculus according to + the sort S. If generated, + they are named id_ind, id_rec and + id_rect according to the sort of their induction + predicate. + For each field fi a record projection + fi is also automatically generated if projection + is allowed by the typing rules of the calculus according to the + sort S, the type T1 and + the definability of depending record projections. + If the type of a field is declared with :>, + the corresponding record projection becomes an implicit coercion. + This is just syntactic sugar and it has the same effect of declaring the + record projection as a coercion later on. + Proofs - theorem &id;[: &term;] [≝ &term;] + <emphasis role="bold">theorem</emphasis> &id;[<emphasis role="bold">:</emphasis> &term;] [<emphasis role="bold">≝</emphasis> &term;] theorem theorem f: P ≝ p Proves a new theorem f whose thesis is @@ -349,7 +395,7 @@ Notice that the command is equivalent to definition f: T ≝ t. - variant &id;[: &term;] [≝ &term;] + <emphasis role="bold">variant</emphasis> &id;[<emphasis role="bold">:</emphasis> &term;] [<emphasis role="bold">≝</emphasis> &term;] variant variant f: T ≝ t Same as theorem f: T ≝ t, but it does not @@ -357,19 +403,19 @@ an alternative name or proof to a theorem. - lemma &id;[: &term;] [≝ &term;] + <emphasis role="bold">lemma</emphasis> &id;[<emphasis role="bold">:</emphasis> &term;] [<emphasis role="bold">≝</emphasis> &term;] lemma lemma f: T ≝ t Same as theorem f: T ≝ t - fact &id;[: &term;] [≝ &term;] + <emphasis role="bold">fact</emphasis> &id;[<emphasis role="bold">:</emphasis> &term;] [<emphasis role="bold">≝</emphasis> &term;] fact fact f: T ≝ t Same as theorem f: T ≝ t - remark &id;[: &term;] [≝ &term;] + <emphasis role="bold">remark</emphasis> &id;[<emphasis role="bold">:</emphasis> &term;] [<emphasis role="bold">≝</emphasis> &term;] remark remark f: T ≝ t Same as theorem f: T ≝ t