From 53d918bdbe4135cee1764f27f5c5c8a585bf3481 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Mon, 5 Jun 2006 11:08:49 +0000 Subject: [PATCH] Record syntax is now described. More &TODO; put here and there. --- helm/software/matita/help/C/matita.xml | 1 + .../matita/help/C/sec_gettingstarted.xml | 4 ++ helm/software/matita/help/C/sec_terms.xml | 60 ++++++++++++++++--- 3 files changed, 58 insertions(+), 7 deletions(-) diff --git a/helm/software/matita/help/C/matita.xml b/helm/software/matita/help/C/matita.xml index 41d763c93..8934ffffd 100644 --- a/helm/software/matita/help/C/matita.xml +++ b/helm/software/matita/help/C/matita.xml @@ -29,6 +29,7 @@ term"> match_pattern"> args"> + args2"> sterm"> ]> diff --git a/helm/software/matita/help/C/sec_gettingstarted.xml b/helm/software/matita/help/C/sec_gettingstarted.xml index c1feb6d92..886603ab2 100644 --- a/helm/software/matita/help/C/sec_gettingstarted.xml +++ b/helm/software/matita/help/C/sec_gettingstarted.xml @@ -88,6 +88,10 @@ Authoring + + How to use developments + &TODO; + &TODO; diff --git a/helm/software/matita/help/C/sec_terms.xml b/helm/software/matita/help/C/sec_terms.xml index 5e29eb41e..e9c1c054c 100644 --- a/helm/software/matita/help/C/sec_terms.xml +++ b/helm/software/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 -- 2.39.2