source: Deliverables/D3.1/C-semantics/CexecComplete.ma @ 481

Last change on this file since 481 was 481, checked in by campbell, 8 years ago

Tcomp_ptr should take the memory region and use that to calculate its size.

File size: 18.5 KB
Line 
1include "Cexec.ma".
2include "Plogic/connectives.ma".
3
4ndefinition yields ≝ λA.λa:res A.λv':A.
5match a with [ OK v ⇒ v' = v | _ ⇒ False ].
6
7(* This tells us that some execution of a results in v'.
8   (There may be many possible executions due to I/O, but we're trying to prove
9   that one particular one exists corresponding to a derivation in the inductive
10   semantics.) *)
11nlet rec yieldsIO (A:Type) (a:IO io_out io_in A) (v':A) on a : Prop ≝
12match a with [ Value v ⇒ v' = v | Interact _ k ⇒ ∃r.yieldsIO A (k r) v' | _ ⇒ False ].
13
14ndefinition yields_sig : ∀A,P. res (Σx:A. P x) → A → Prop ≝
15λA,P,e,v. match e with [ OK v' ⇒ match v' with [ sig_intro v'' _ ⇒ v = v'' ] | _ ⇒ False].
16
17nlet rec yieldsIO_sig (A:Type) (P:A → Prop) (e:IO io_out io_in (Σx:A. P x)) (v:A) on e : Prop ≝
18match e with
19[ Value v' ⇒ match v' with [ sig_intro v'' _ ⇒ v = v'' ]
20| Interact _ k ⇒ ∃r.yieldsIO_sig A P (k r) v
21| _ ⇒ False].
22
23nlemma remove_io_sig: ∀A. ∀P:A → Prop. ∀a,v',p.
24yieldsIO A a v' →
25yieldsIO_sig A P (io_inject io_out io_in A (λx.P x) (Some ? a) p) v'.
26#A P a; nelim a;
27##[ #a k IH v' p H; nwhd in H ⊢ %; nelim H; #r H'; @ r; napply IH; napply H';
28##| #v v' p H; napply H;
29##| #a b; *;
30##] nqed.
31
32nlemma yields_eq: ∀A,a,v'. yields A a v' → a = OK ? v'.
33#A a v'; ncases a; //; nwhd in ⊢ (% → ?); *;
34nqed.
35
36nlemma yields_sig_eq: ∀A,P,e,v. yields_sig A P e v → ∃p. e = OK ? (sig_intro … v p).
37#A P e v; ncases e;
38##[ #vp; ncases vp; #v' p H; nwhd in H; nrewrite > H; @ p; napply refl;
39##| *;
40##] nqed.
41
42nlemma is_pointer_compat_true: ∀m,b,sp.
43  pointer_compat (block_space m b) sp →
44  is_pointer_compat (block_space m b) sp = true.
45#m b sp H; nwhd in ⊢ (??%?);
46nelim (pointer_compat_dec (block_space m b) sp);
47##[ //
48##| #H'; napply False_ind; napply (absurd … H H');
49##] nqed.
50
51nlemma ms_eq_dec_true: ∀s. ms_eq_dec s s = inl ???.
52##[ #s; ncases s; napply refl;
53##| ##skip
54##] nqed.
55
56ntheorem is_det: ∀p,s,s'.
57initial_state p s → initial_state p s' → s = s'.
58#p s s' H1 H2;
59ninversion H1; #b1 f1 e11 e12 e13;
60ninversion H2; #b2 f2 e21 e22 e23;
61nrewrite > e11 in e21;
62#e1; nrewrite > (?:b1 = b2) in e12;
63##[ nrewrite > e22; #e2; nrewrite > (?:f2 = f1);
64  ##[ //;
65  ##| ndestruct (e2) skip (e22 e23); //;
66  ##]
67##| ndestruct (e1) skip (e11); //
68##] nqed.
69
70nlemma remove_res_sig: ∀A. ∀P:A → Prop. ∀a,v',p.
71yields A a v' →
72yields_sig A P (err_inject A (λx.P x) (Some ? a) p) v'.
73#A P a; ncases a;
74##[ #v v' p H; napply H;
75##| #a b; *;
76##] nqed.
77
78
79ntheorem the_initial_state:
80  ∀p,s. initial_state p s → yields ? (make_initial_state p) s.
81#p s; ncases p; #fns main globs H;
82ninversion H;
83#b f e1 e2 e3;
84nwhd in ⊢ (??%?);
85nrewrite > e1;
86nwhd in ⊢ (??%?);
87nrewrite > e2;
88nwhd; napply refl;
89nqed.
90
91nlemma cast_complete: ∀m,v,ty,ty',v'.
92  cast m v ty ty' v' → yields ? (exec_cast m v ty ty') v'.
93#m v ty ty' v' H;
94nelim H;
95##[ #m i sz1 sz2 sg1 sg2; napply refl;
96##| #m f sz szi sg; napply refl;
97##| #m i sz sz' sg; napply refl;
98##| #m f sz sz'; napply refl;
99##| #m sp sp' ty ty' b ofs H1 H2 H3;
100    nelim H1; ##[ #sp1 ty1 ##| #sp1 ty1 n1 ##| #tys1 ty1; nletin sp1 ≝ Code ##]
101    nwhd in ⊢ (??%?);
102    ##[ ##1,2: nrewrite > (ms_eq_dec_true …); nwhd in ⊢ (??%?); ##]
103    nelim H2 in H3 ⊢ %; ##[ ##1,4,7: #sp2 ty2 ##| ##2,5,8: #sp2 ty2 n2 ##| ##3,6,9: #tys2 ty2; nletin sp2 ≝ Code ##]
104    #H3; nwhd in ⊢ (??%?);
105    nrewrite > (is_pointer_compat_true …); //;
106##| #m sz si ty'' H; ncases H; ##[ #sp1 ty1 ##| #sp1 ty1 n1 ##| #args rty ##] napply refl;
107##| #m t t' H H'; ncases H; ncases H'; //;
108##] nqed.
109
110(* Use to narrow down the choice of expression to just the lvalues. *)
111nlemma lvalue_expr: ∀ge,env,m,e,ty,sp,l,ofs,tr. ∀P:expr_descr → Prop.
112  eval_lvalue ge env m (Expr e ty) sp l ofs tr →
113  (∀id. P (Evar id)) → (∀e'. P (Ederef e')) → (∀e',id. P (Efield e' id)) →
114  P e.
115#ge env m e ty sp l ofs tr P H; napply (eval_lvalue_inv_ind … H);
116##[ #id l ty e1 e2 e3 e4 e5 e6; ndestruct; //
117##| #id sp l ty e1 e2 e3 e4 e5 e6 e7; ndestruct; //
118##| #e ty sp l ofs tr H e1 e2 e3 e4 e5; ndestruct; //
119##| #e id ty sp l ofs id' fs d tr H e1 e2;(* bogus? *) #_; #e3 e4 e5 e6 e7; ndestruct; //
120##| #e id ty sp l ofs id' fs tr H e1;(* bogus? *) #_; #e2 e3 e4 e5 e6; ndestruct; //
121##] nqed.
122
123nlemma bool_of_val_3_complete : ∀v,ty,r. bool_of_val v ty r → ∃b. r = of_bool b ∧ yields ? (exec_bool_of_val v ty) b.
124#v ty r H; nelim H; #v t H'; nelim H';
125  ##[ #i is s ne; @ true; @; //; nwhd; nrewrite > (eq_false … ne); //;
126  ##| #p b i i0 s; @ true; @; //
127  ##| #i p t ne; @ true; @; //; nwhd; nrewrite > (eq_false … ne); //;
128  ##| #p b i p0 t0; @ true; @; //
129  ##| #f s ne; @ true; @; //; nwhd; nrewrite > (Feq_zero_false … ne); //;
130  ##| #i s; @ false; @; //;
131  ##| #p t; @ false; @; //;
132  ##| #s; @ false; @; //; nwhd; nrewrite > (Feq_zero_true …); //;
133  ##]
134nqed.
135
136nlemma bool_of_true: ∀v,ty. is_true v ty → yields ? (exec_bool_of_val v ty) true.
137#v ty H; nelim H;
138  ##[ #i is s ne; nwhd; nrewrite > (eq_false … ne); //;
139  ##| #p b i i0 s; //
140  ##| #i p t ne; nwhd; nrewrite > (eq_false … ne); //;
141  ##| #p b i p0 t0; //
142  ##| #f s ne; nwhd; nrewrite > (Feq_zero_false … ne); //;
143  ##]
144nqed.
145
146nlemma bool_of_false: ∀v,ty. is_false v ty → yields ? (exec_bool_of_val v ty) false.
147#v ty H; nelim H;
148  ##[ #i s; //;
149  ##| #p t; //;
150  ##| #s; nwhd; nrewrite > (Feq_zero_true …); //;
151  ##]
152nqed.
153
154nlemma expr_lvalue_complete: ∀ge,env,m.
155(∀e,v,tr. eval_expr ge env m e v tr → yields ? (exec_expr ge env m e) (〈v,tr〉)) ∧
156(∀e,sp,l,off,tr. eval_lvalue ge env m e sp l off tr → yields ? (exec_lvalue ge env m e) (〈〈〈sp,l〉,off〉,tr〉)).
157#ge env m;
158napply (combined_expr_lvalue_ind ge env m
159  (λe,v,tr,H. yields ? (exec_expr ge env m e) (〈v,tr〉))
160  (λe,sp,l,off,tr,H. yields ? (exec_lvalue ge env m e) (〈〈〈sp,l〉,off〉,tr〉)));
161##[ #i ty; napply refl;
162##| #f ty; napply refl;
163##| #e ty sp l off v tr H1 H2; napply (lvalue_expr … H1);
164    ##[ #id ##| #e' ##| #e' id ##] #H3;
165    nwhd in ⊢ (??%?);
166    nrewrite > (yields_eq ??? H3);
167    nwhd in ⊢ (??%?); nrewrite > H2; napply refl;
168##| #e ty sp l off tr H1 H2; nwhd in ⊢ (??%?);
169    nrewrite > (yields_eq ??? H2);
170    napply refl;
171##| #ty' ty; napply refl;
172##| #op e ty v1 v tr H1 H2 H3; nwhd in ⊢ (??%?);
173    nrewrite > (yields_eq ??? H3);
174    nwhd in ⊢ (??%?); nrewrite > H2; napply refl;
175##| #op e1 e2 ty v1 v2 v tr1 tr2 H1 H2 e3 H4 H5; nwhd in ⊢ (??%?);
176    nrewrite > (yields_eq ??? H4); nwhd in ⊢ (??%?);
177    nrewrite > (yields_eq ??? H5); nwhd in ⊢ (??%?);
178    nrewrite > e3; napply refl;
179##| #e1 e2 e3 ty v1 v2 tr1 tr2 H1 H2 H3 H4 H5; nwhd in ⊢ (??%?);
180    nrewrite > (yields_eq ??? H4); nwhd in ⊢ (??%?);
181    nrewrite > (yields_eq ??? (bool_of_true ?? H2));
182    nrewrite > (yields_eq ??? H5);
183    napply refl;
184##| #e1 e2 e3 ty v1 v2 tr1 tr2 H1 H2 H3 H4 H5; nwhd in ⊢ (??%?);
185    nrewrite > (yields_eq ??? H4); nwhd in ⊢ (??%?);
186    nrewrite > (yields_eq ??? (bool_of_false ?? H2));
187    nrewrite > (yields_eq ??? H5);
188    napply refl;
189##| #e1 e2 ty v1 tr H1 H2 H3; nwhd in ⊢ (??%?);
190    nrewrite > (yields_eq ??? H3); nwhd in ⊢ (??%?);
191    nrewrite > (yields_eq ??? (bool_of_true ?? H2));
192    napply refl;   
193##| #e1 e2 ty v1 v2 v tr1 tr2 H1 H2 H3 H4 H5 H6; nwhd in ⊢ (??%?);
194    nrewrite > (yields_eq ??? H5); nwhd in ⊢ (??%?);
195    nrewrite > (yields_eq ??? (bool_of_false ?? H2));
196    nrewrite > (yields_eq ??? H6); nwhd in ⊢ (??%?);
197    nelim (bool_of_val_3_complete … H4); #b; *; #evb Hb;
198    nrewrite > (yields_eq ??? Hb); nwhd in ⊢ (??%?); nrewrite < evb;
199    napply refl;   
200##| #e1 e2 ty v1 tr H1 H2 H3; nwhd in ⊢ (??%?);
201    nrewrite > (yields_eq ??? H3); nwhd in ⊢ (??%?);
202    nrewrite > (yields_eq ??? (bool_of_false ?? H2));
203    napply refl;   
204##| #e1 e2 ty v1 v2 v tr1 tr2 H1 H2 H3 H4 H5 H6; nwhd in ⊢ (??%?);
205    nrewrite > (yields_eq ??? H5); nwhd in ⊢ (??%?);
206    nrewrite > (yields_eq ??? (bool_of_true ?? H2));
207    nrewrite > (yields_eq ??? H6); nwhd in ⊢ (??%?);
208    nelim (bool_of_val_3_complete … H4); #b; *; #evb Hb;
209    nrewrite > (yields_eq ??? Hb); nwhd in ⊢ (??%?); nrewrite < evb;
210    napply refl;
211##| #e ty ty' v1 v tr H1 H2 H3; nwhd in ⊢ (??%?);
212    nrewrite > (yields_eq ??? H3); nwhd in ⊢ (??%?);
213    nrewrite > (yields_eq ??? (cast_complete … H2));
214    napply refl;
215##| #e ty v l tr H1 H2; nwhd in ⊢ (??%?);
216    nrewrite > (yields_eq ??? H2); nwhd in ⊢ (??%?);
217    napply refl;
218   
219  (* lvalues *)
220##| #id l ty e1; nwhd in ⊢ (??%?); nrewrite > e1; napply refl;
221##| #id sp l ty e1 e2; nwhd in ⊢ (??%?); nrewrite > e1;
222    nrewrite > e2; napply refl;
223##| #e ty sp l ofs tr H1 H2; nwhd in ⊢ (??%?);
224    nrewrite > (yields_eq ??? H2);
225    napply refl;
226##| #e i ty sp l ofs id fList delta tr H1 H2 H3 H4; ncases e in H2 H4 ⊢ %;
227    #e' ty' H2; nwhd in H2:(??%?); nrewrite > H2; #H4; nwhd in ⊢ (??%?);
228    nrewrite > (yields_eq ??? H4); nwhd in ⊢ (??%?);
229    nrewrite > H3; napply refl;
230##| #e i ty sp l ofs id fList tr; ncases e; #e' ty' H1 H2;
231    nwhd in H2:(??%?); nrewrite > H2; #H3; nwhd in ⊢ (??%?);
232    nrewrite > (yields_eq ??? H3); napply refl;
233##] nqed.
234
235ntheorem expr_complete:  ∀ge,env,m.
236 ∀e,v,tr. eval_expr ge env m e v tr → yields ? (exec_expr ge env m e) (〈v,tr〉).
237#ge env m; nelim (expr_lvalue_complete ge env m); /2/; nqed.
238
239ntheorem exprlist_complete: ∀ge,env,m,es,vs,tr.
240  eval_exprlist ge env m es vs tr → yields ? (exec_exprlist ge env m es) (〈vs,tr〉).
241#ge env m es vs tr H; nelim H;
242##[ napply refl;
243##| #e et v vt tr trt H1 H2 H3; nwhd in ⊢ (??%?);
244    nrewrite > (yields_eq ??? (expr_complete … H1)); nwhd in ⊢ (??%?);
245    nrewrite > (yields_eq ??? H3);
246    napply refl;
247##] nqed.
248
249ntheorem lvalue_complete: ∀ge,env,m.
250 ∀e,sp,l,off,tr. eval_lvalue ge env m e sp l off tr → yields ? (exec_lvalue ge env m e) (〈〈〈sp,l〉,off〉,tr〉).
251#ge env m; nelim (expr_lvalue_complete ge env m); /2/; nqed.
252
253nlet rec P_typelist (P:type → Prop) (l:typelist) on l : Prop ≝
254match l with
255[ Tnil ⇒ True
256| Tcons h t ⇒ P h ∧ P_typelist P t
257].
258
259nlet rec type_ind2l
260  (P:type → Prop) (Q:typelist → Prop)
261  (vo:P Tvoid)
262  (it:∀i,s. P (Tint i s))
263  (fl:∀f. P (Tfloat f))
264  (pt:∀s,t. P t → P (Tpointer s t))
265  (ar:∀s,t,n. P t → P (Tarray s t n))
266  (fn:∀tl,t. Q tl → P t → P (Tfunction tl t))
267  (st:∀i,fl. P (Tstruct i fl))
268  (un:∀i,fl. P (Tunion i fl))
269  (cp:∀r,i. P (Tcomp_ptr r i))
270  (nl:Q Tnil)
271  (cs:∀t,tl. P t → Q tl → Q (Tcons t tl))
272 (t:type) on t : P t ≝
273  match t return λt'.P t' with
274  [ Tvoid ⇒ vo
275  | Tint i s ⇒ it i s
276  | Tfloat s ⇒ fl s
277  | Tpointer s t' ⇒ pt s t' (type_ind2l P Q vo it fl pt ar fn st un cp nl cs t')
278  | Tarray s t' n ⇒ ar s t' n (type_ind2l P Q vo it fl pt ar fn st un cp nl cs t')
279  | Tfunction tl t' ⇒ fn tl t' (typelist_ind2l P Q vo it fl pt ar fn st un cp nl cs tl) (type_ind2l P Q vo it fl pt ar fn st un cp nl cs t')
280  | Tstruct i fs ⇒ st i fs
281  | Tunion i fs ⇒ un i fs
282  | Tcomp_ptr r i ⇒ cp r i
283  ]
284and typelist_ind2l
285  (P:type → Prop) (Q:typelist → Prop)
286  (vo:P Tvoid)
287  (it:∀i,s. P (Tint i s))
288  (fl:∀f. P (Tfloat f))
289  (pt:∀s,t. P t → P (Tpointer s t))
290  (ar:∀s,t,n. P t → P (Tarray s t n))
291  (fn:∀tl,t. Q tl → P t → P (Tfunction tl t))
292  (st:∀i,fl. P (Tstruct i fl))
293  (un:∀i,fl. P (Tunion i fl))
294  (cp:∀r,i. P (Tcomp_ptr r i))
295  (nl:Q Tnil)
296  (cs:∀t,tl. P t → Q tl → Q (Tcons t tl))
297  (ts:typelist) on ts : Q ts ≝
298  match ts return λts'.Q ts' with
299  [ Tnil ⇒ nl
300  | Tcons t tl ⇒ cs t tl (type_ind2l P Q vo it fl pt ar fn st un cp nl cs t)
301                     (typelist_ind2l P Q vo it fl pt ar fn st un cp nl cs tl)
302  ].
303
304nlemma assert_type_eq_true: ∀t. ∃p.assert_type_eq t t = OK ? p.
305#t; nwhd in ⊢ (??(λ_.??%?)); ncases (type_eq_dec t t); #E;
306##[ @ E; //
307##| napply False_ind; napply (absurd ?? E); //
308##] nqed.
309
310nlemma alloc_vars_complete: ∀env,m,l,env',m'.
311  alloc_variables env m l env' m' →
312  ∃p.exec_alloc_variables env m l = sig_intro ?? (Some ? 〈env', m'〉) p.
313#env m l env' m' H; nelim H;
314##[ #env'' m''; @ ?; nwhd; //;
315##| #env1 m1 id ty l1 m2 loc m3 env2 H1 H2 H3;
316    nwhd in H1:(??%?) ⊢ (??(λ_.??%?));
317    ndestruct (H1);
318    nelim H3; #p3 e3; nrewrite > e3; nwhd in ⊢ (??(λ_.??%?)); @ ?; //;
319##] nqed.
320
321nlemma bind_params_complete: ∀e,m,params,vs,m2.
322  bind_parameters e m params vs m2 →
323  yields_sig ?? (exec_bind_parameters e m params vs) m2.
324#e m params vs m2 H; nelim H;
325##[ //;
326##| #env1 m1 id ty l v tl loc m2 m3 H1 H2 H3 H4;
327    napply remove_res_sig;
328    nrewrite > H1; nwhd in ⊢ (??%?);
329    nrewrite > H2; nwhd in ⊢ (??%?);
330    nelim (yields_sig_eq ???? H4); #p4 e4; nrewrite > e4;
331    napply refl;
332##] nqed.
333
334nlemma eventval_match_complete': ∀ev,ty,v.
335  eventval_match ev ty v → yields_sig ?? (check_eventval' v ty) ev.
336#ev ty v H; nelim H; //; nqed.
337
338nlemma eventval_list_match_complete: ∀vs,tys,evs.
339  eventval_list_match evs tys vs → yields_sig ?? (check_eventval_list vs tys) evs.
340#vs tys evs H; nelim H;
341##[ //
342##| #e etl ty tytl v vtl H1 H2 H3; napply remove_res_sig;
343    nelim (yields_sig_eq ???? (eventval_match_complete' … H1)); #p1 e1; nrewrite > e1; nwhd in ⊢ (??%?);
344    nelim (yields_sig_eq ???? H3); #p3 e3; nrewrite > e3; nwhd in ⊢ (??%?);
345    napply refl;
346##] nqed.
347
348nlemma dec_true: ∀P:Prop.∀f:P + ¬P.∀p:P.∀Q:(P + ¬P) → Prop. (∀p'.Q (inl ?? p')) → Q f.
349#P f p Q H; ncases f;
350##[ napply H
351##| #np; napply False_ind; napply (absurd ? p np);
352##] nqed.
353
354nlemma dec_false: ∀P:Prop.∀f:P + ¬P.∀p:¬P.∀Q:(P + ¬P) → Prop. (∀p'.Q (inr ?? p')) → Q f.
355#P f p Q H; ncases f;
356##[ #np; napply False_ind; napply (absurd ? np p);
357##| napply H
358##] nqed.
359
360ntheorem step_complete: ∀ge,s,tr,s'.
361  step ge s tr s' → yieldsIO ? (exec_step ge s) 〈tr,s'〉.
362#ge s tr s' H; nelim H;
363##[ #f e e1 k e2 m sp loc ofs v m' tr1 tr2 H1 H2 H3; nwhd in ⊢ (??%?);
364    nrewrite > (yields_eq ??? (lvalue_complete … H1)); nwhd in ⊢ (??%?);
365    nrewrite > (yields_eq ??? (expr_complete … H2)); nwhd in ⊢ (??%?);
366    nrewrite > H3; napply refl;
367##| #f e eargs k ef m vf vargs f' tr1 tr2 H1 H2 H3 H4; nwhd in ⊢ (??%?);
368    nrewrite > (yields_eq ??? (expr_complete … H1)); nwhd in ⊢ (??%?);
369    nrewrite > (yields_eq ??? (exprlist_complete … H2)); nwhd in ⊢ (??%?);
370    nrewrite > H3; nwhd in ⊢ (??%?);
371    nrewrite > H4; nelim (assert_type_eq_true (fun_typeof e)); #pty ety; nrewrite > ety;
372    napply refl;
373##| #f el ef eargs k env m sp loc ofs vf vargs f' tr1 tr2 tr3 H1 H2 H3 H4 H5; nwhd in ⊢ (??%?);
374    nrewrite > (yields_eq ??? (expr_complete … H2)); nwhd in ⊢ (??%?);
375    nrewrite > (yields_eq ??? (exprlist_complete … H3)); nwhd in ⊢ (??%?);
376    nrewrite > H4; nwhd in ⊢ (??%?);
377    nrewrite > H5; nelim (assert_type_eq_true (fun_typeof ef)); #pty ety; nrewrite > ety;
378    nwhd in ⊢ (??%?);
379    nrewrite > (yields_eq ??? (lvalue_complete … H1)); nwhd in ⊢ (??%?);
380    napply refl;
381##| #f s1 s2 k env m; napply refl
382##| ##5,6,7: #f s k env m; napply refl
383##| #f e s1 s2 k env m v tr H1 H2; nwhd in ⊢ (??%?);
384    nrewrite > (yields_eq ??? (expr_complete … H1)); nwhd in ⊢ (??%?);
385    nrewrite > (yields_eq ??? (bool_of_true ?? H2));
386    napply refl
387##| #f e s1 s2 k env m v tr H1 H2; nwhd in ⊢ (??%?);
388    nrewrite > (yields_eq ??? (expr_complete … H1)); nwhd in ⊢ (??%?);
389    nrewrite > (yields_eq ??? (bool_of_false ?? H2));
390    napply refl
391##| #f e s k env m v tr H1 H2; nwhd in ⊢ (??%?);
392    nrewrite > (yields_eq ??? (expr_complete … H1)); nwhd in ⊢ (??%?);
393    nrewrite > (yields_eq ??? (bool_of_false ?? H2));
394    napply refl
395##| #f e s k env m v tr H1 H2; nwhd in ⊢ (??%?);
396    nrewrite > (yields_eq ??? (expr_complete … H1)); nwhd in ⊢ (??%?);
397    nrewrite > (yields_eq ??? (bool_of_true ?? H2));
398    napply refl
399##| #f s1 e s2 k env m H; ncases H; #es1; nrewrite > es1; napply refl;
400##| ##13,14: #f e s k env m; napply refl
401##| #f s1 e s2 k env m v tr; *; #es1; nrewrite > es1; #H1 H2; nwhd in ⊢ (??%?);
402    nrewrite > (yields_eq ??? (expr_complete … H1)); nwhd in ⊢ (??%?);
403    nrewrite > (yields_eq ??? (bool_of_false ?? H2));
404    napply refl
405##| #f s1 e s2 k env m v tr; *; #es1; nrewrite > es1; #H1 H2; nwhd in ⊢ (??%?);
406    nrewrite > (yields_eq ??? (expr_complete … H1)); nwhd in ⊢ (??%?);
407    nrewrite > (yields_eq ??? (bool_of_true ?? H2));
408    napply refl
409##| #f e s k env m; napply refl;
410##| #f s1 e s2 s3 k env m nskip; nwhd in ⊢ (??%?); ncases (is_Sskip s1);
411    ##[ #H; napply False_ind; napply (absurd ? H nskip)
412    ##| #H; nwhd in ⊢ (??%?); napply refl ##]
413##| #f e s1 s2 k env m v tr H1 H2; nwhd in ⊢ (??%?);
414    nrewrite > (yields_eq ??? (expr_complete … H1)); nwhd in ⊢ (??%?);
415    nrewrite > (yields_eq ??? (bool_of_false ?? H2));
416    napply refl;
417##| #f e s1 s2 k env m v tr H1 H2; nwhd in ⊢ (??%?);
418    nrewrite > (yields_eq ??? (expr_complete … H1)); nwhd in ⊢ (??%?);
419    nrewrite > (yields_eq ??? (bool_of_true ?? H2));
420    napply refl;
421##| #f s1 e s2 s3 k env m; *; #es1; nrewrite > es1; napply refl;
422##| ##22,23: #f e s1 s2 k env m; napply refl;
423##| #f k env m H; nwhd in ⊢ (??%?); nrewrite > H; napply refl;
424##| #f e k env m v tr H1 H2; nwhd in ⊢ (??%?);
425    napply (dec_false ? (type_eq_dec (fn_return f) Tvoid) H1); #pf';
426    nwhd in ⊢ (??%?);
427    nrewrite > (yields_eq ??? (expr_complete … H2)); nwhd in ⊢ (??%?);
428    napply refl;
429##| #f k env m; ncases k;
430    ##[ #H1 H2; nwhd in ⊢ (??%?); nrewrite > H2; napply refl;
431    ##| #s' k'; nwhd in ⊢ (% → ?); *;
432    ##| ##3,4: #e' s' k'; nwhd in ⊢ (% → ?); *;
433    ##| ##5,6: #e' s1' s2' k'; nwhd in ⊢ (% → ?); *;
434    ##| #k'; nwhd in ⊢ (% → ?); *;
435    ##| #r f' env' k' H1 H2; nwhd in ⊢ (??%?); nrewrite > H2; napply refl
436    ##]
437##| #f e s k env m i tr H1; nwhd in ⊢ (??%?);
438    nrewrite > (yields_eq ??? (expr_complete … H1)); nwhd in ⊢ (??%?);
439    napply refl
440##| #f s k env m; *; #es; nrewrite > es; napply refl;
441##| #f k env m; napply refl
442##| #f l s k env m; napply refl
443##| #f l k env m s k' H1; nwhd in ⊢ (??%?); nrewrite > H1; napply refl;
444##| #f args k m1 env m2 m3 H1 H2; nwhd in ⊢ (??%?);
445    nelim (alloc_vars_complete … H1); #p1 e1; nrewrite > e1; nwhd in ⊢ (??%?);
446    nelim (yields_sig_eq ???? (bind_params_complete … H2)); #p2 e2; nrewrite > e2;
447    napply refl;
448##| #id tys rty args k m rv tr H; nwhd in ⊢ (??%?);
449    ninversion H; #f' args' rv' eargs erv H1 H2 e1 e2 e3 e4; nrewrite < e1 in H1 H2;
450    #H1 H2;
451    nelim (yields_sig_eq ???? (eventval_list_match_complete … H1)); #p1 e1; nrewrite > e1; nwhd in ⊢ (??%?);
452    nwhd; ninversion H2; #x e5 e6 e7; @ x; nwhd in ⊢ (??%?);
453    napply refl
454##| #v f env k m; napply refl
455##| #v f env k m1 m2 sp loc ofs ty H; nwhd in ⊢ (??%?);
456    nrewrite > H; napply refl
457##| #f l s k env m; napply refl
458##] nqed.
Note: See TracBrowser for help on using the repository browser.