src/HOL/Record.thy
author wenzelm
Fri Oct 21 18:14:36 2005 +0200 (2005-10-21)
changeset 17957 d31acb64aa9a
parent 16417 9bc16273c2d4
child 21226 a607ae87ee81
permissions -rw-r--r--
avoid home-grown meta_allE;
     1 (*  Title:      HOL/Record.thy
     2     ID:         $Id$
     3     Author:     Wolfgang Naraschewski, Norbert Schirmer and Markus Wenzel, TU Muenchen
     4 *)
     5 
     6 theory Record
     7 imports Product_Type
     8 uses ("Tools/record_package.ML")
     9 begin
    10 
    11 lemma prop_subst: "s = t \<Longrightarrow> PROP P t \<Longrightarrow> PROP P s"
    12   by simp
    13 
    14 lemma rec_UNIV_I: "\<And>x. x\<in>UNIV \<equiv> True"
    15   by simp
    16 
    17 lemma rec_True_simp: "(True \<Longrightarrow> PROP P) \<equiv> PROP P"
    18   by simp
    19 
    20 
    21 subsection {* Concrete record syntax *}
    22 
    23 nonterminals
    24   ident field_type field_types field fields update updates
    25 syntax
    26   "_constify"           :: "id => ident"                        ("_")
    27   "_constify"           :: "longid => ident"                    ("_")
    28 
    29   "_field_type"         :: "[ident, type] => field_type"        ("(2_ ::/ _)")
    30   ""                    :: "field_type => field_types"          ("_")
    31   "_field_types"        :: "[field_type, field_types] => field_types"    ("_,/ _")
    32   "_record_type"        :: "field_types => type"                ("(3'(| _ |'))")
    33   "_record_type_scheme" :: "[field_types, type] => type"        ("(3'(| _,/ (2... ::/ _) |'))")
    34 
    35   "_field"              :: "[ident, 'a] => field"               ("(2_ =/ _)")
    36   ""                    :: "field => fields"                    ("_")
    37   "_fields"             :: "[field, fields] => fields"          ("_,/ _")
    38   "_record"             :: "fields => 'a"                       ("(3'(| _ |'))")
    39   "_record_scheme"      :: "[fields, 'a] => 'a"                 ("(3'(| _,/ (2... =/ _) |'))")
    40 
    41   "_update_name"        :: idt
    42   "_update"             :: "[ident, 'a] => update"              ("(2_ :=/ _)")
    43   ""                    :: "update => updates"                  ("_")
    44   "_updates"            :: "[update, updates] => updates"       ("_,/ _")
    45   "_record_update"      :: "['a, updates] => 'b"                ("_/(3'(| _ |'))" [900,0] 900)
    46 
    47 syntax (xsymbols)
    48   "_record_type"        :: "field_types => type"                ("(3\<lparr>_\<rparr>)")
    49   "_record_type_scheme" :: "[field_types, type] => type"        ("(3\<lparr>_,/ (2\<dots> ::/ _)\<rparr>)")
    50   "_record"             :: "fields => 'a"                               ("(3\<lparr>_\<rparr>)")
    51   "_record_scheme"      :: "[fields, 'a] => 'a"                 ("(3\<lparr>_,/ (2\<dots> =/ _)\<rparr>)")
    52   "_record_update"      :: "['a, updates] => 'b"                ("_/(3\<lparr>_\<rparr>)" [900,0] 900)
    53 
    54 use "Tools/record_package.ML"
    55 setup RecordPackage.setup
    56 
    57 end
    58