66 by (asm_simp_tac (simpset() addsimps [sup_PTS_eq,approx_val_def] addsplits [option.split,val_.split,ty.split]) 1); |
66 by (asm_simp_tac (simpset() addsimps [sup_PTS_eq,approx_val_def] addsplits [option.split,val_.split,ty.split]) 1); |
67 by(blast_tac (claset() addIs [conf_widen]) 1); |
67 by(blast_tac (claset() addIs [conf_widen]) 1); |
68 qed_spec_mp "approx_val_imp_approx_val_sup"; |
68 qed_spec_mp "approx_val_imp_approx_val_sup"; |
69 |
69 |
70 |
70 |
71 Goal |
71 Goalw [approx_loc_def,list_all2_def] |
72 "\\<lbrakk> wf_prog wt G; approx_loc G hp loc LT; idx < length LT ; val = loc ! idx ; G \\<turnstile> LT ! idx <=o at\\<rbrakk> \ |
72 "\\<lbrakk> wf_prog wt G; approx_loc G hp loc LT; idx < length LT ; val = loc ! idx ; G \\<turnstile> LT ! idx <=o at\\<rbrakk> \ |
73 \\\<Longrightarrow> approx_val G hp val at"; |
73 \\\<Longrightarrow> approx_val G hp val at"; |
74 by (fast_tac (claset() addIs [approx_val_imp_approx_val_sup] addss (simpset() addsimps |
74 by (fast_tac (claset() addIs [approx_val_imp_approx_val_sup] addss (simpset() addsimps |
75 [split_def,approx_loc_def,all_set_conv_all_nth])) 1); |
75 [split_def,all_set_conv_all_nth])) 1); |
76 qed "approx_loc_imp_approx_val_sup"; |
76 qed "approx_loc_imp_approx_val_sup"; |
77 |
77 |
78 |
78 |
79 (** approx_loc **) |
79 (** approx_loc **) |
80 |
80 |
81 Goal |
81 Goalw [approx_loc_def] |
82 "approx_loc G hp (s#xs) (l#ls) = \ |
82 "approx_loc G hp (s#xs) (l#ls) = \ |
83 \ ((length xs = length ls) \\<and> (approx_val G hp s l) \\<and> (approx_loc G hp xs ls))"; |
83 \ (approx_val G hp s l \\<and> approx_loc G hp xs ls)"; |
84 by (fast_tac (claset() addss (simpset() addsimps [approx_loc_def])) 1); |
84 by (Simp_tac 1); |
85 qed "approx_loc_Cons"; |
85 qed "approx_loc_Cons"; |
86 |
86 AddIffs [approx_loc_Cons]; |
87 |
87 |
88 Goalw [approx_stk_def,approx_loc_def] |
88 |
|
89 Goalw [approx_stk_def,approx_loc_def,list_all2_def] |
89 "\\<lbrakk> wf_prog wt G \\<rbrakk> \ |
90 "\\<lbrakk> wf_prog wt G \\<rbrakk> \ |
90 \\\<Longrightarrow> (\\<forall>tt'\\<in>set (zip tys_n ts). tt' \\<in> widen G) \\<longrightarrow> \ |
91 \\\<Longrightarrow> (\\<forall>tt'\\<in>set (zip tys_n ts). tt' \\<in> widen G) \\<longrightarrow> \ |
91 \ length tys_n = length ts \\<longrightarrow> approx_stk G hp s tys_n \\<longrightarrow> approx_loc G hp s (map Some ts)"; |
92 \ length tys_n = length ts \\<longrightarrow> approx_stk G hp s tys_n \\<longrightarrow> approx_loc G hp s (map Some ts)"; |
92 by (force_tac (claset() addIs [approx_val_imp_approx_val_assConvertible], simpset() |
93 by (force_tac (claset() addIs [approx_val_imp_approx_val_assConvertible], simpset() |
93 addsimps [all_set_conv_all_nth,split_def]) 1); |
94 addsimps [all_set_conv_all_nth,split_def]) 1); |
94 qed_spec_mp "assConv_approx_stk_imp_approx_loc"; |
95 qed_spec_mp "assConv_approx_stk_imp_approx_loc"; |
95 |
96 |
96 |
97 |
97 Goalw [approx_loc_def] |
98 Goalw [approx_loc_def,list_all2_def] |
98 "\\<forall> lvars. approx_loc G hp lvars lt \\<longrightarrow> hp \\<le>| hp' \\<longrightarrow> approx_loc G hp' lvars lt"; |
99 "\\<forall> lvars. approx_loc G hp lvars lt \\<longrightarrow> hp \\<le>| hp' \\<longrightarrow> approx_loc G hp' lvars lt"; |
99 by (exhaust_tac "lt" 1); |
100 by (exhaust_tac "lt" 1); |
100 by (Asm_simp_tac 1); |
101 by (Asm_simp_tac 1); |
101 by (force_tac (claset() addIs [approx_val_imp_approx_val_sup_heap], |
102 by (force_tac (claset() addIs [approx_val_imp_approx_val_sup_heap], |
102 simpset() addsimps [neq_Nil_conv]) 1); |
103 simpset() addsimps [neq_Nil_conv]) 1); |
103 qed_spec_mp "approx_loc_imp_approx_loc_sup_heap"; |
104 qed_spec_mp "approx_loc_imp_approx_loc_sup_heap"; |
104 |
105 |
105 |
106 |
106 Goalw [sup_loc_def,approx_loc_def] |
107 Goalw [sup_loc_def,approx_loc_def,list_all2_def] |
107 "wf_prog wt G \\<Longrightarrow> approx_loc G hp lvars lt \\<longrightarrow> G \\<turnstile> lt <=l lt' \\<longrightarrow> approx_loc G hp lvars lt'"; |
108 "wf_prog wt G \\<Longrightarrow> approx_loc G hp lvars lt \\<longrightarrow> G \\<turnstile> lt <=l lt' \\<longrightarrow> approx_loc G hp lvars lt'"; |
108 by (auto_tac (claset() , simpset() addsimps [all_set_conv_all_nth,split_def])); |
109 by (auto_tac (claset() , simpset() addsimps [all_set_conv_all_nth,split_def])); |
109 by (auto_tac (claset() addEs [approx_val_imp_approx_val_sup] , simpset())); |
110 by (auto_tac (claset() addEs [approx_val_imp_approx_val_sup] , simpset())); |
110 qed_spec_mp "approx_loc_imp_approx_loc_sup"; |
111 qed_spec_mp "approx_loc_imp_approx_loc_sup"; |
111 |
112 |
112 |
113 |
113 Goalw [approx_loc_def] |
114 Goalw [approx_loc_def,list_all2_def] |
114 "\\<forall>loc idx x X. (approx_loc G hp loc LT) \\<longrightarrow> (approx_val G hp x X) \ |
115 "\\<forall>loc idx x X. (approx_loc G hp loc LT) \\<longrightarrow> (approx_val G hp x X) \ |
115 \ \\<longrightarrow> (approx_loc G hp (loc[idx:=x]) (LT[idx:=X]))"; |
116 \ \\<longrightarrow> (approx_loc G hp (loc[idx:=x]) (LT[idx:=X]))"; |
116 by (fast_tac (claset() addDs [set_update_subset RS subsetD] |
117 by (fast_tac (claset() addDs [set_update_subset RS subsetD] |
117 addss (simpset() addsimps [zip_update])) 1); |
118 addss (simpset() addsimps [zip_update])) 1); |
118 qed_spec_mp "approx_loc_imp_approx_loc_subst"; |
119 qed_spec_mp "approx_loc_imp_approx_loc_subst"; |
119 |
120 |
120 |
121 |
121 Goal |
122 Goalw [approx_loc_def,list_all2_def] |
122 "\\<forall>L1 l2 L2. length l1=length L1 \ |
123 "\\<forall>L1 l2 L2. length l1=length L1 \ |
123 \ \\<longrightarrow> approx_loc G hp (l1@l2) (L1@L2) = (approx_loc G hp l1 L1 \\<and> approx_loc G hp l2 L2)"; |
124 \ \\<longrightarrow> approx_loc G hp (l1@l2) (L1@L2) = (approx_loc G hp l1 L1 \\<and> approx_loc G hp l2 L2)"; |
124 by (induct_tac "l1" 1); |
125 by(simp_tac (simpset() addcongs [conj_cong] addsimps [zip_append]) 1); |
125 by (fast_tac (claset() addDs [] addss (simpset() addsimps [approx_loc_def])) 1); |
126 by(Blast_tac 1); |
126 br allI 1; |
|
127 by (exhaust_tac "L1" 1); |
|
128 by (asm_full_simp_tac (simpset() addsimps []) 1); |
|
129 by (asm_full_simp_tac (simpset() addsimps []) 1); |
|
130 by (Clarify_tac 1); |
|
131 by (asm_full_simp_tac (simpset() addsimps [approx_loc_Cons]) 1); |
|
132 by (case_tac "length l2 = length L2" 1); |
|
133 by (asm_full_simp_tac (simpset() addsimps []) 1); |
|
134 by (asm_full_simp_tac (simpset() addsimps [approx_loc_def]) 1); |
|
135 qed_spec_mp "approx_loc_append"; |
127 qed_spec_mp "approx_loc_append"; |
136 |
128 |
137 |
129 |
138 (** approx_stk **) |
130 (** approx_stk **) |
139 |
131 |
140 Goalw [approx_stk_def,approx_loc_def] |
132 Goalw [approx_stk_def,approx_loc_def,list_all2_def] |
141 "approx_stk G hp (rev s) (rev t) = approx_stk G hp s t"; |
133 "approx_stk G hp (rev s) (rev t) = approx_stk G hp s t"; |
142 by (fast_tac (claset() addss (simpset() addsimps [zip_rev,rev_map RS sym])) 1); |
134 by (fast_tac (claset() addss (simpset() addsimps [zip_rev,rev_map RS sym])) 1); |
143 qed_spec_mp "approx_stk_rev_lem"; |
135 qed_spec_mp "approx_stk_rev_lem"; |
144 |
136 |
145 Goal |
137 Goal |
158 by (fast_tac (claset() addIs [approx_loc_imp_approx_loc_sup]) 1); |
150 by (fast_tac (claset() addIs [approx_loc_imp_approx_loc_sup]) 1); |
159 qed_spec_mp "approx_stk_imp_approx_stk_sup"; |
151 qed_spec_mp "approx_stk_imp_approx_stk_sup"; |
160 |
152 |
161 Goalw [approx_stk_def,approx_loc_def] |
153 Goalw [approx_stk_def,approx_loc_def] |
162 "approx_stk G hp [] []"; |
154 "approx_stk G hp [] []"; |
163 by (asm_full_simp_tac (simpset() addsimps []) 1); |
155 by (Simp_tac 1); |
164 qed "approx_stk_Nil"; |
156 qed "approx_stk_Nil"; |
165 |
157 AddIffs [approx_stk_Nil]; |
166 |
158 |
167 Goalw [approx_stk_def,approx_loc_def] |
159 Goalw [approx_stk_def,approx_loc_def] |
168 "approx_stk G hp (x # stk) (S#ST) = (approx_stk G hp stk ST \\<and> approx_val G hp x (Some S))"; |
160 "approx_stk G hp (x # stk) (S#ST) = (approx_val G hp x (Some S) \\<and> approx_stk G hp stk ST)"; |
169 by (fast_tac (claset() addss (simpset())) 1); |
161 by (Simp_tac 1); |
170 qed "approx_stk_Cons"; |
162 qed "approx_stk_Cons"; |
171 |
163 AddIffs [approx_stk_Cons]; |
172 Goal |
164 |
173 "\\<lbrakk> approx_stk G hp stk (S#ST') \\<rbrakk> \ |
165 Goalw [approx_stk_def,approx_loc_def] |
174 \ \\<Longrightarrow> \\<exists>s stk'. stk = s#stk' \\<and> approx_stk G hp stk' ST' \\<and> approx_val G hp s (Some S)"; |
166 "approx_stk G hp stk (S#ST') = \ |
175 by (exhaust_tac "stk" 1); |
167 \ (\\<exists>s stk'. stk = s#stk' \\<and> approx_val G hp s (Some S) \\<and> approx_stk G hp stk' ST')"; |
176 by (fast_tac (claset() addss (simpset() addsimps [approx_stk_def,approx_loc_def])) 1); |
168 by (asm_full_simp_tac (simpset() addsimps [list_all2_Cons2]) 1); |
177 by (fast_tac (claset() addss (simpset() addsimps [approx_stk_Cons])) 1); |
|
178 qed "approx_stk_Cons_lemma"; |
169 qed "approx_stk_Cons_lemma"; |
179 |
170 AddIffs [approx_stk_Cons_lemma]; |
180 Goal |
171 |
181 "\\<forall>ST' stk. approx_stk G hp stk (S@ST') \ |
172 |
182 \ \\<longrightarrow> (\\<exists>s stk'. stk = s@stk' \\<and> length s = length S \\<and> length stk' = length ST' \\<and> \ |
173 Goalw [approx_stk_def,approx_loc_def] |
|
174 "approx_stk G hp stk (S@ST') \ |
|
175 \ \\<Longrightarrow> (\\<exists>s stk'. stk = s@stk' \\<and> length s = length S \\<and> length stk' = length ST' \\<and> \ |
183 \ approx_stk G hp s S \\<and> approx_stk G hp stk' ST')"; |
176 \ approx_stk G hp s S \\<and> approx_stk G hp stk' ST')"; |
184 by (induct_tac "S" 1); |
177 by(asm_full_simp_tac (simpset() addsimps [list_all2_append2]) 1); |
185 by (fast_tac (claset() addDs [] addss (simpset() addsimps [approx_stk_def,approx_loc_def])) 1); |
|
186 by (Clarify_tac 1); |
|
187 by (asm_full_simp_tac (simpset() addsimps []) 1); |
|
188 bd approx_stk_Cons_lemma 1; |
|
189 by (Clarify_tac 1); |
|
190 by (eres_inst_tac [("x","ST'")] allE 1); |
|
191 by (eres_inst_tac [("x","stk'")] allE 1); |
|
192 by (Clarify_tac 1); |
|
193 by (res_inst_tac [("x","s#sa")] exI 1); |
|
194 by (res_inst_tac [("x","stk'a")] exI 1); |
|
195 by (asm_full_simp_tac (simpset() addsimps [approx_stk_Cons]) 1); |
|
196 qed_spec_mp "approx_stk_append_lemma"; |
178 qed_spec_mp "approx_stk_append_lemma"; |
197 |
179 |
198 |
180 |
199 (** oconf **) |
181 (** oconf **) |
200 |
182 |