# source:src/Clight/CexecComplete.ma@2695

Last change on this file since 2695 was 2677, checked in by campbell, 7 years ago

Retain the pointer for the function called in front-end call states
so that we can do sensible stack costs.

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