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;
wenzelm@4870
     1
(*  Title:      HOL/Record.thy
wenzelm@4870
     2
    ID:         $Id$
wenzelm@16114
     3
    Author:     Wolfgang Naraschewski, Norbert Schirmer and Markus Wenzel, TU Muenchen
wenzelm@4870
     4
*)
wenzelm@4870
     5
nipkow@15131
     6
theory Record
nipkow@15140
     7
imports Product_Type
haftmann@16417
     8
uses ("Tools/record_package.ML")
nipkow@15131
     9
begin
wenzelm@4870
    10
schirmer@14700
    11
lemma prop_subst: "s = t \<Longrightarrow> PROP P t \<Longrightarrow> PROP P s"
schirmer@14700
    12
  by simp
wenzelm@11826
    13
schirmer@14700
    14
lemma rec_UNIV_I: "\<And>x. x\<in>UNIV \<equiv> True"
schirmer@14700
    15
  by simp
wenzelm@11826
    16
schirmer@14700
    17
lemma rec_True_simp: "(True \<Longrightarrow> PROP P) \<equiv> PROP P"
schirmer@14700
    18
  by simp
berghofe@14080
    19
wenzelm@11821
    20
wenzelm@11833
    21
subsection {* Concrete record syntax *}
wenzelm@4870
    22
wenzelm@4870
    23
nonterminals
wenzelm@5198
    24
  ident field_type field_types field fields update updates
wenzelm@4870
    25
syntax
wenzelm@11821
    26
  "_constify"           :: "id => ident"                        ("_")
wenzelm@11821
    27
  "_constify"           :: "longid => ident"                    ("_")
wenzelm@5198
    28
wenzelm@11821
    29
  "_field_type"         :: "[ident, type] => field_type"        ("(2_ ::/ _)")
wenzelm@11821
    30
  ""                    :: "field_type => field_types"          ("_")
wenzelm@11821
    31
  "_field_types"        :: "[field_type, field_types] => field_types"    ("_,/ _")
wenzelm@11821
    32
  "_record_type"        :: "field_types => type"                ("(3'(| _ |'))")
wenzelm@10093
    33
  "_record_type_scheme" :: "[field_types, type] => type"        ("(3'(| _,/ (2... ::/ _) |'))")
wenzelm@5198
    34
wenzelm@11821
    35
  "_field"              :: "[ident, 'a] => field"               ("(2_ =/ _)")
wenzelm@11821
    36
  ""                    :: "field => fields"                    ("_")
wenzelm@11821
    37
  "_fields"             :: "[field, fields] => fields"          ("_,/ _")
wenzelm@11821
    38
  "_record"             :: "fields => 'a"                       ("(3'(| _ |'))")
wenzelm@10093
    39
  "_record_scheme"      :: "[fields, 'a] => 'a"                 ("(3'(| _,/ (2... =/ _) |'))")
wenzelm@5198
    40
wenzelm@10641
    41
  "_update_name"        :: idt
wenzelm@11821
    42
  "_update"             :: "[ident, 'a] => update"              ("(2_ :=/ _)")
wenzelm@11821
    43
  ""                    :: "update => updates"                  ("_")
wenzelm@11821
    44
  "_updates"            :: "[update, updates] => updates"       ("_,/ _")
wenzelm@10093
    45
  "_record_update"      :: "['a, updates] => 'b"                ("_/(3'(| _ |'))" [900,0] 900)
wenzelm@4870
    46
wenzelm@10331
    47
syntax (xsymbols)
wenzelm@11821
    48
  "_record_type"        :: "field_types => type"                ("(3\<lparr>_\<rparr>)")
wenzelm@10093
    49
  "_record_type_scheme" :: "[field_types, type] => type"        ("(3\<lparr>_,/ (2\<dots> ::/ _)\<rparr>)")
wenzelm@10093
    50
  "_record"             :: "fields => 'a"                               ("(3\<lparr>_\<rparr>)")
wenzelm@10093
    51
  "_record_scheme"      :: "[fields, 'a] => 'a"                 ("(3\<lparr>_,/ (2\<dots> =/ _)\<rparr>)")
wenzelm@10093
    52
  "_record_update"      :: "['a, updates] => 'b"                ("_/(3\<lparr>_\<rparr>)" [900,0] 900)
wenzelm@9729
    53
wenzelm@16114
    54
use "Tools/record_package.ML"
wenzelm@16114
    55
setup RecordPackage.setup
wenzelm@10641
    56
wenzelm@4870
    57
end
schirmer@14700
    58