author | schirmer |
Fri, 17 Mar 2006 17:38:38 +0100 | |
changeset 19284 | 4c86109423d5 |
parent 17957 | d31acb64aa9a |
child 21226 | a607ae87ee81 |
permissions | -rw-r--r-- |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
1 |
(* Title: HOL/Record.thy |
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
2 |
ID: $Id$ |
16114 | 3 |
Author: Wolfgang Naraschewski, Norbert Schirmer and Markus Wenzel, TU Muenchen |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
4 |
*) |
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
5 |
|
15131 | 6 |
theory Record |
15140 | 7 |
imports Product_Type |
16417 | 8 |
uses ("Tools/record_package.ML") |
15131 | 9 |
begin |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
10 |
|
14700
2f885b7e5ba7
reimplementation of HOL records; only one type is created for
schirmer
parents:
14080
diff
changeset
|
11 |
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
|
12 |
by simp |
11826 | 13 |
|
14700
2f885b7e5ba7
reimplementation of HOL records; only one type is created for
schirmer
parents:
14080
diff
changeset
|
14 |
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
|
15 |
by simp |
11826 | 16 |
|
14700
2f885b7e5ba7
reimplementation of HOL records; only one type is created for
schirmer
parents:
14080
diff
changeset
|
17 |
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
|
18 |
by simp |
14080
9a50427d7165
Added split_paired_All rule for splitting variables bound by
berghofe
parents:
13421
diff
changeset
|
19 |
|
11821 | 20 |
|
11833 | 21 |
subsection {* Concrete record syntax *} |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
22 |
|
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
23 |
nonterminals |
5198 | 24 |
ident field_type field_types field fields update updates |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
25 |
syntax |
11821 | 26 |
"_constify" :: "id => ident" ("_") |
27 |
"_constify" :: "longid => ident" ("_") |
|
5198 | 28 |
|
11821 | 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'(| _ |'))") |
|
10093 | 33 |
"_record_type_scheme" :: "[field_types, type] => type" ("(3'(| _,/ (2... ::/ _) |'))") |
5198 | 34 |
|
11821 | 35 |
"_field" :: "[ident, 'a] => field" ("(2_ =/ _)") |
36 |
"" :: "field => fields" ("_") |
|
37 |
"_fields" :: "[field, fields] => fields" ("_,/ _") |
|
38 |
"_record" :: "fields => 'a" ("(3'(| _ |'))") |
|
10093 | 39 |
"_record_scheme" :: "[fields, 'a] => 'a" ("(3'(| _,/ (2... =/ _) |'))") |
5198 | 40 |
|
10641 | 41 |
"_update_name" :: idt |
11821 | 42 |
"_update" :: "[ident, 'a] => update" ("(2_ :=/ _)") |
43 |
"" :: "update => updates" ("_") |
|
44 |
"_updates" :: "[update, updates] => updates" ("_,/ _") |
|
10093 | 45 |
"_record_update" :: "['a, updates] => 'b" ("_/(3'(| _ |'))" [900,0] 900) |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
46 |
|
10331 | 47 |
syntax (xsymbols) |
11821 | 48 |
"_record_type" :: "field_types => type" ("(3\<lparr>_\<rparr>)") |
10093 | 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) |
|
9729 | 53 |
|
16114 | 54 |
use "Tools/record_package.ML" |
55 |
setup RecordPackage.setup |
|
10641 | 56 |
|
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
57 |
end |
14700
2f885b7e5ba7
reimplementation of HOL records; only one type is created for
schirmer
parents:
14080
diff
changeset
|
58 |