author | webertj |
Fri, 01 Jun 2007 23:21:40 +0200 | |
changeset 23193 | 1f2d94b6a8ef |
parent 16417 | 9bc16273c2d4 |
child 24893 | b8ef7afe3a6b |
permissions | -rw-r--r-- |
1478 | 1 |
(* Title: ZF/Coind/Values.thy |
916 | 2 |
ID: $Id$ |
1478 | 3 |
Author: Jacob Frost, Cambridge University Computer Laboratory |
916 | 4 |
Copyright 1995 University of Cambridge |
5 |
*) |
|
6 |
||
16417 | 7 |
theory Values imports Language Map begin |
916 | 8 |
|
9 |
(* Values, values environments and associated operators *) |
|
10 |
||
11 |
consts |
|
12595 | 12 |
Val :: i |
13 |
ValEnv :: i |
|
14 |
Val_ValEnv :: i; |
|
6112 | 15 |
|
16 |
codatatype |
|
12595 | 17 |
"Val" = v_const ("c \<in> Const") |
18 |
| v_clos ("x \<in> ExVar","e \<in> Exp","ve \<in> ValEnv") |
|
933 | 19 |
and |
12595 | 20 |
"ValEnv" = ve_mk ("m \<in> PMap(ExVar,Val)") |
21 |
monos PMap_mono |
|
22 |
type_intros A_into_univ mapQU |
|
916 | 23 |
|
24 |
consts |
|
12595 | 25 |
ve_owr :: "[i,i,i] => i" |
26 |
ve_dom :: "i=>i" |
|
27 |
ve_app :: "[i,i] => i" |
|
6046 | 28 |
|
29 |
||
30 |
primrec "ve_owr(ve_mk(m), x, v) = ve_mk(map_owr(m,x,v))" |
|
31 |
||
32 |
primrec "ve_dom(ve_mk(m)) = domain(m)" |
|
33 |
||
34 |
primrec "ve_app(ve_mk(m), a) = map_app(m,a)" |
|
35 |
||
36 |
constdefs |
|
37 |
ve_emp :: i |
|
38 |
"ve_emp == ve_mk(map_emp)" |
|
916 | 39 |
|
12595 | 40 |
|
41 |
(* Elimination rules *) |
|
42 |
||
43 |
lemma ValEnvE: |
|
44 |
"[| ve \<in> ValEnv; !!m.[| ve=ve_mk(m); m \<in> PMap(ExVar,Val) |] ==> Q |] ==> Q" |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12595
diff
changeset
|
45 |
apply (unfold Part_def Val_def ValEnv_def, clarify) |
12595 | 46 |
apply (erule Val_ValEnv.cases) |
47 |
apply (auto simp add: Val_def Part_def Val_ValEnv.con_defs) |
|
48 |
done |
|
49 |
||
50 |
lemma ValE: |
|
51 |
"[| v \<in> Val; |
|
52 |
!!c. [| v = v_const(c); c \<in> Const |] ==> Q; |
|
53 |
!!e ve x. |
|
54 |
[| v = v_clos(x,e,ve); x \<in> ExVar; e \<in> Exp; ve \<in> ValEnv |] ==> Q |
|
55 |
|] ==> |
|
56 |
Q" |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12595
diff
changeset
|
57 |
apply (unfold Part_def Val_def ValEnv_def, clarify) |
12595 | 58 |
apply (erule Val_ValEnv.cases) |
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12595
diff
changeset
|
59 |
apply (auto simp add: ValEnv_def Part_def Val_ValEnv.con_defs) |
12595 | 60 |
done |
61 |
||
62 |
(* Nonempty sets *) |
|
63 |
||
64 |
lemma v_closNE [simp]: "v_clos(x,e,ve) \<noteq> 0" |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12595
diff
changeset
|
65 |
by (unfold QPair_def QInl_def QInr_def Val_ValEnv.con_defs, blast) |
12595 | 66 |
|
67 |
declare v_closNE [THEN notE, elim!] |
|
68 |
||
69 |
||
70 |
lemma v_constNE [simp]: "c \<in> Const ==> v_const(c) \<noteq> 0" |
|
71 |
apply (unfold QPair_def QInl_def QInr_def Val_ValEnv.con_defs) |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12595
diff
changeset
|
72 |
apply (drule constNEE, auto) |
12595 | 73 |
done |
916 | 74 |
|
75 |
||
12595 | 76 |
(* Proving that the empty set is not a value *) |
916 | 77 |
|
12595 | 78 |
lemma ValNEE: "v \<in> Val ==> v \<noteq> 0" |
79 |
by (erule ValE, auto) |
|
80 |
||
81 |
(* Equalities for value environments *) |
|
82 |
||
83 |
lemma ve_dom_owr [simp]: |
|
84 |
"[| ve \<in> ValEnv; v \<noteq>0 |] ==> ve_dom(ve_owr(ve,x,v)) = ve_dom(ve) Un {x}" |
|
85 |
apply (erule ValEnvE) |
|
86 |
apply (auto simp add: map_domain_owr) |
|
87 |
done |
|
88 |
||
89 |
lemma ve_app_owr [simp]: |
|
90 |
"ve \<in> ValEnv |
|
91 |
==> ve_app(ve_owr(ve,y,v),x) = (if x=y then v else ve_app(ve,x))" |
|
92 |
by (erule ValEnvE, simp add: map_app_owr) |
|
93 |
||
94 |
(* Introduction rules for operators on value environments *) |
|
95 |
||
96 |
lemma ve_appI: "[| ve \<in> ValEnv; x \<in> ve_dom(ve) |] ==> ve_app(ve,x):Val" |
|
97 |
by (erule ValEnvE, simp add: pmap_appI) |
|
98 |
||
99 |
lemma ve_domI: "[| ve \<in> ValEnv; x \<in> ve_dom(ve) |] ==> x \<in> ExVar" |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12595
diff
changeset
|
100 |
apply (erule ValEnvE, simp) |
12595 | 101 |
apply (blast dest: pmap_domainD) |
102 |
done |
|
103 |
||
104 |
lemma ve_empI: "ve_emp \<in> ValEnv" |
|
105 |
apply (unfold ve_emp_def) |
|
106 |
apply (rule Val_ValEnv.intros) |
|
107 |
apply (rule pmap_empI) |
|
108 |
done |
|
109 |
||
110 |
lemma ve_owrI: |
|
111 |
"[|ve \<in> ValEnv; x \<in> ExVar; v \<in> Val |] ==> ve_owr(ve,x,v):ValEnv" |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12595
diff
changeset
|
112 |
apply (erule ValEnvE, simp) |
12595 | 113 |
apply (blast intro: pmap_owrI Val_ValEnv.intros) |
114 |
done |
|
115 |
||
116 |
end |