author | chaieb |
Wed, 15 Jul 2009 16:31:44 +0200 | |
changeset 32158 | 4dc119d4fc8b |
parent 31723 | f5cafe803b55 |
child 32743 | c4e9a48bc50e |
permissions | -rw-r--r-- |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
1 |
(* Title: HOL/Record.thy |
16114 | 2 |
Author: Wolfgang Naraschewski, Norbert Schirmer and Markus Wenzel, TU Muenchen |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
3 |
*) |
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
4 |
|
22817 | 5 |
header {* Extensible records with structural subtyping *} |
6 |
||
15131 | 7 |
theory Record |
15140 | 8 |
imports Product_Type |
31723
f5cafe803b55
discontinued ancient tradition to suffix certain ML module names with "_package"
haftmann
parents:
25705
diff
changeset
|
9 |
uses ("Tools/record.ML") |
15131 | 10 |
begin |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
11 |
|
14700
2f885b7e5ba7
reimplementation of HOL records; only one type is created for
schirmer
parents:
14080
diff
changeset
|
12 |
lemma prop_subst: "s = t \<Longrightarrow> PROP P t \<Longrightarrow> PROP P s" |
2f885b7e5ba7
reimplementation of HOL records; only one type is created for
schirmer
parents:
14080
diff
changeset
|
13 |
by simp |
11826 | 14 |
|
14700
2f885b7e5ba7
reimplementation of HOL records; only one type is created for
schirmer
parents:
14080
diff
changeset
|
15 |
lemma rec_UNIV_I: "\<And>x. x\<in>UNIV \<equiv> True" |
2f885b7e5ba7
reimplementation of HOL records; only one type is created for
schirmer
parents:
14080
diff
changeset
|
16 |
by simp |
11826 | 17 |
|
14700
2f885b7e5ba7
reimplementation of HOL records; only one type is created for
schirmer
parents:
14080
diff
changeset
|
18 |
lemma rec_True_simp: "(True \<Longrightarrow> PROP P) \<equiv> PROP P" |
2f885b7e5ba7
reimplementation of HOL records; only one type is created for
schirmer
parents:
14080
diff
changeset
|
19 |
by simp |
14080
9a50427d7165
Added split_paired_All rule for splitting variables bound by
berghofe
parents:
13421
diff
changeset
|
20 |
|
25705 | 21 |
lemma K_record_comp: "(\<lambda>x. c) \<circ> f = (\<lambda>x. c)" |
22 |
by (simp add: comp_def) |
|
11821 | 23 |
|
22817 | 24 |
|
11833 | 25 |
subsection {* Concrete record syntax *} |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
26 |
|
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
27 |
nonterminals |
5198 | 28 |
ident field_type field_types field fields update updates |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
29 |
syntax |
11821 | 30 |
"_constify" :: "id => ident" ("_") |
31 |
"_constify" :: "longid => ident" ("_") |
|
5198 | 32 |
|
11821 | 33 |
"_field_type" :: "[ident, type] => field_type" ("(2_ ::/ _)") |
34 |
"" :: "field_type => field_types" ("_") |
|
35 |
"_field_types" :: "[field_type, field_types] => field_types" ("_,/ _") |
|
36 |
"_record_type" :: "field_types => type" ("(3'(| _ |'))") |
|
10093 | 37 |
"_record_type_scheme" :: "[field_types, type] => type" ("(3'(| _,/ (2... ::/ _) |'))") |
5198 | 38 |
|
11821 | 39 |
"_field" :: "[ident, 'a] => field" ("(2_ =/ _)") |
40 |
"" :: "field => fields" ("_") |
|
41 |
"_fields" :: "[field, fields] => fields" ("_,/ _") |
|
42 |
"_record" :: "fields => 'a" ("(3'(| _ |'))") |
|
10093 | 43 |
"_record_scheme" :: "[fields, 'a] => 'a" ("(3'(| _,/ (2... =/ _) |'))") |
5198 | 44 |
|
10641 | 45 |
"_update_name" :: idt |
11821 | 46 |
"_update" :: "[ident, 'a] => update" ("(2_ :=/ _)") |
47 |
"" :: "update => updates" ("_") |
|
48 |
"_updates" :: "[update, updates] => updates" ("_,/ _") |
|
10093 | 49 |
"_record_update" :: "['a, updates] => 'b" ("_/(3'(| _ |'))" [900,0] 900) |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
50 |
|
10331 | 51 |
syntax (xsymbols) |
11821 | 52 |
"_record_type" :: "field_types => type" ("(3\<lparr>_\<rparr>)") |
10093 | 53 |
"_record_type_scheme" :: "[field_types, type] => type" ("(3\<lparr>_,/ (2\<dots> ::/ _)\<rparr>)") |
54 |
"_record" :: "fields => 'a" ("(3\<lparr>_\<rparr>)") |
|
55 |
"_record_scheme" :: "[fields, 'a] => 'a" ("(3\<lparr>_,/ (2\<dots> =/ _)\<rparr>)") |
|
56 |
"_record_update" :: "['a, updates] => 'b" ("_/(3\<lparr>_\<rparr>)" [900,0] 900) |
|
9729 | 57 |
|
31723
f5cafe803b55
discontinued ancient tradition to suffix certain ML module names with "_package"
haftmann
parents:
25705
diff
changeset
|
58 |
use "Tools/record.ML" |
f5cafe803b55
discontinued ancient tradition to suffix certain ML module names with "_package"
haftmann
parents:
25705
diff
changeset
|
59 |
setup Record.setup |
10641 | 60 |
|
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
61 |
end |