-
Notifications
You must be signed in to change notification settings - Fork 0
/
THoareA.v
706 lines (600 loc) · 17 KB
/
THoareA.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
Require Export EnvLibA.
Require Export RelLibA.
Require Export PRelLibA.
Require Export Coq.Program.Equality.
Require Import Coq.Init.Specif.
Require Import Coq.Arith.PeanoNat.
Require Import Omega.
Require Import Coq.Lists.List.
(*
Require Import Coq.Strings.String.
Require Import Coq.Logic.EqdepFacts.
Require Import Coq.Logic.ProofIrrelevance.
*)
Require Import StaticSemA.
Require Import DynamicSemA.
Require Import TRInductA.
Require Import WeakenA.
Require Import TSoundnessA.
Require Import IdModTypeA.
Require Import DetermA.
Require Import AbbrevA.
Require Import HoareA.
Module THoare (IdT: IdModType) <: IdModType.
Definition Id := IdT.Id.
Definition IdEqDec := IdT.IdEqDec.
Definition IdEq := IdT.IdEq.
Definition W := IdT.W.
Definition Loc_PI := IdT.Loc_PI.
Definition BInit := IdT.BInit.
Definition WP := IdT.WP.
Module HoareI := Hoare IdT.
Export HoareI.
(*
Open Scope string_scope.
*)
Import ListNotations.
Definition THoareTriple_Eval
(P : W -> Prop) (Q : Value -> W -> Prop)
(fenv: funEnv) (env: valEnv)
(e: Exp) : Prop :=
forall (ftenv: funTC) (tenv: valTC)
(k1: FEnvTyping fenv ftenv)
(k2: EnvTyping env tenv)
(t: VTyp)
(k3: ExpTyping ftenv tenv fenv e t)
(s s': W) (v: Value),
EClosure fenv env (Conf Exp s e) (Conf Exp s' (Val v)) ->
P s -> Q v s'.
Definition THoarePrmsTriple_Eval
(P : W -> Prop) (Q : list Value -> W -> Prop)
(fenv: funEnv) (env: valEnv)
(ps: Prms) : Prop :=
forall (ftenv: funTC) (tenv: valTC)
(k1: FEnvTyping fenv ftenv)
(k2: EnvTyping env tenv)
(pt: PTyp)
(k3: PrmsTyping ftenv tenv fenv ps pt)
(s s': W) (vs: list Value),
PrmsClosure fenv env (Conf Prms s ps) (Conf Prms s'
(PS (map Val vs))) ->
P s -> Q vs s'.
Inductive QFClosure :
funEnv -> AConfig QFun -> AConfig QFun -> Type :=
| QFC_Base : forall (fenv: funEnv) (p: AConfig QFun),
QFClosure fenv p p
| QFC_Step : forall (fenv: funEnv) (p1 p2: AConfig QFun),
QFStep fenv p1 p2 ->
QFClosure fenv p1 p2.
Definition THoareFunTripleA_Eval
(P: W -> Prop) (Q: Value -> W -> Prop)
(fenv: funEnv)
(qf: QFun) : Prop :=
forall (ftenv: funTC)
(k1: FEnvTyping fenv ftenv)
(ft: FTyp)
(k2: QFunTyping ftenv fenv qf ft)
(s s': W) (f: Fun),
QFClosure fenv (Conf QFun s qf) (Conf QFun s' (QF f)) ->
match f with
| FC fenv' tenv' e0 e1 x n =>
forall vs: list Value,
let env' := mkVEnv tenv' vs in
EnvTyping env' tenv' ->
match n with
| 0 =>
THoareTriple_Eval P Q fenv' (mkVEnv tenv' vs) e0
| S n' =>
THoareTriple_Eval P Q ((x,FC fenv' tenv' e0 e1 x n')::fenv')
(mkVEnv tenv' vs) e1
end
end.
Definition THoareFunTriple_Eval
(P: W -> Prop) (Q: Value -> W -> Prop)
(fenv: funEnv) (env: valEnv)
(qf: QFun) : Prop :=
forall (ftenv: funTC)
(k1: FEnvTyping fenv ftenv)
(ft: FTyp)
(k2: QFunTyping ftenv fenv qf ft)
(s s': W) (f: Fun),
QFClosure fenv (Conf QFun s qf) (Conf QFun s' (QF f)) ->
match f with
| FC fenv' tenv' e0 e1 x n =>
EnvTyping env tenv' ->
match n with
| 0 =>
THoareTriple_Eval P Q fenv' env e0
| S n' =>
THoareTriple_Eval P Q ((x,FC fenv' tenv' e0 e1 x n')::fenv')
env e1
end
end.
(***********************************************************************)
Definition IHoareTriple_Eval
(P : W -> Prop) (Q : Value -> W -> Prop)
(e: Exp) : Prop :=
forall (ftenv: funTC) (tenv: valTC)
(fenv: funEnv) (env: valEnv)
(k1: FEnvTyping fenv ftenv)
(k2: EnvTyping env tenv)
(t: VTyp)
(k3: ExpTyping ftenv tenv fenv e t)
(s: W),
P s -> Q (extractRunValue ftenv tenv fenv e t k3 k1 env k2 s)
(extractRunState ftenv tenv fenv e t k3 k1 env k2 s).
Definition IHoarePrmsTriple_Eval
(P : W -> Prop) (Q : list Value -> W -> Prop)
(ps: Prms) : Prop :=
forall (ftenv: funTC) (tenv: valTC)
(fenv: funEnv) (env: valEnv)
(k1: FEnvTyping fenv ftenv)
(k2: EnvTyping env tenv)
(pt: PTyp)
(k3: PrmsTyping ftenv tenv fenv ps pt)
(s: W),
P s -> Q (extractPRunValue ftenv tenv fenv ps pt k3 k1 env k2 s)
(extractPRunState ftenv tenv fenv ps pt k3 k1 env k2 s).
(*************************************************************************)
(*
Lemma THoare_weaken (P : W -> Prop) (Q : Value -> W -> Prop)
(fenv fenv': funEnv) (env env': valEnv)
(e: Exp) :
THoareTriple_Eval P Q (fenv++fenv') (env++env') e ->
THoareTriple_Eval P Q fenv env e.
unfold THoareTriple_Eval.
intros.
*)
Lemma BindN_VHTT1 (P0 P1: W -> Prop) (P2: Value -> W -> Prop)
(fenv: funEnv) (env: valEnv)
(e1 e2: Exp) :
THoareTriple_Eval P0 (fun _ => P1) fenv env e1 ->
THoareTriple_Eval P1 P2 fenv env e2 ->
THoareTriple_Eval P0 P2 fenv env (BindN e1 e2) .
unfold THoareTriple_Eval.
intros.
eapply BindN_BStepT1 in X.
destruct X as [s1 X].
destruct X as [v1 X].
inversion k3; subst.
eapply (H0 ftenv tenv).
auto.
auto.
eauto.
eauto.
eapply (H ftenv tenv).
auto.
auto.
eauto.
eauto.
auto.
eauto.
eauto.
eauto.
Qed.
Lemma BindN_VHTT2 (P0: W -> Prop) (P1 P2: Value -> W -> Prop)
(fenv: funEnv) (env: valEnv)
(e1 e2: Exp) :
THoareTriple_Eval P0 P1 fenv env e1 ->
(forall v: Value, THoareTriple_Eval (P1 v) P2 fenv env e2) ->
THoareTriple_Eval P0 P2 fenv env (BindN e1 e2) .
unfold THoareTriple_Eval.
intros.
eapply BindN_BStepT1 in X.
destruct X as [s1 X].
destruct X as [v1 X].
inversion k3; subst.
eapply (H0 v1 ftenv tenv).
auto.
auto.
eauto.
eauto.
eapply (H ftenv tenv).
auto.
auto.
eauto.
eauto.
auto.
eauto.
eauto.
eauto.
Qed.
Lemma BindS_VHTT1 (P0: W -> Prop) (P1 P2: Value -> W -> Prop)
(fenv: funEnv) (env: valEnv)
(e1 e2: Exp) (x: Id) :
THoareTriple_Eval P0 P1 fenv env e1 ->
(forall v, THoareTriple_Eval (P1 v) P2 fenv ((x,v)::env) e2) ->
THoareTriple_Eval P0 P2 fenv env (BindS x e1 e2).
Proof.
unfold THoareTriple_Eval.
intros.
eapply BindS_BStepT1 in X.
destruct X as [s1 X].
destruct X as [v1 X].
inversion k3; subst.
eapply (H0 v1 ftenv tenv').
auto.
econstructor.
assert (v1 = extractRunValue ftenv tenv fenv e1 t1 X0 k1 env k2 s).
eapply (proj2 (EvalElim ftenv tenv fenv e1 t1 X0 k1 env k2 s s1 v1 X)).
rewrite H2.
exact (extractRunTyping ftenv tenv fenv e1 t1 X0 k1 env k2 s).
auto.
eauto.
eauto.
eapply (H ftenv tenv).
auto.
auto.
eauto.
eauto.
auto.
eauto.
eauto.
eauto.
Qed.
Lemma Apply_VHTT1 (P0: W -> Prop) (P1: list Value -> W -> Prop)
(P2: Value -> W -> Prop)
(fenv: funEnv) (env: valEnv) (f: Fun) (es: list Exp) :
THoarePrmsTriple_Eval P0 P1 fenv env (PS es) ->
match f with
| FC fenv' tenv' e0 e1 x n =>
length tenv' = length es /\
match n with
| 0 => (forall vs: list Value,
THoareTriple_Eval (P1 vs) P2 fenv' (mkVEnv tenv' vs) e0)
| S n' => (forall vs: list Value,
THoareTriple_Eval (P1 vs) P2 ((x,FC fenv' tenv' e0 e1 x n')::fenv')
(mkVEnv tenv' vs) e1)
end
end ->
THoareTriple_Eval P0 P2 fenv env (Apply (QF f) (PS es)).
Proof.
unfold THoareTriple_Eval, THoarePrmsTriple_Eval.
intros.
generalize (Apply_BStepT1 ftenv tenv fenv env f es v s s' k1 k2 t k3).
intro P.
destruct f.
destruct H0.
specialize (P H0 X).
destruct P as [s1 P].
destruct P as [vs P].
inversion k3; subst.
inversion X1; subst.
specialize (H ftenv tenv k1 k2 (PT (map snd fps)) X2 s s1 vs P H1).
assert (tenv0 = fps).
inversion X3; subst.
auto.
auto.
inversion H3; subst.
clear H4.
assert (length es = length (map Val vs)) as W.
eapply PrmsClos_aux0.
eauto.
rewrite map_length with (f:=Val) in W.
assert (EnvTyping (mkVEnv fps vs) fps) as Q.
eapply mkEnvTyping_aux0.
rewrite <- W.
auto.
eapply prmsTyping_aux4.
eauto.
eauto.
eauto.
eauto.
destruct n.
inversion X3; subst.
eapply H2.
eauto.
eauto.
eauto.
eauto.
auto.
inversion X3; subst.
eapply H2.
eauto.
instantiate (1:= (x, FT fps t) :: ftenv0).
econstructor.
auto.
auto.
eauto.
eauto.
auto.
eauto.
auto.
Qed.
Lemma Apply_VHTT2 (P0: W -> Prop) (P1: list Value -> W -> Prop)
(P2: Value -> W -> Prop)
(fenv: funEnv) (env: valEnv) (f: Fun) (es: list Exp) :
THoarePrmsTriple_Eval P0 P1 fenv env (PS es) ->
(forall vs,
THoareTriple_Eval (P1 vs) P2 fenv env
(Apply (QF f) (PS (map Val vs)))) ->
THoareTriple_Eval P0 P2 fenv env (Apply (QF f) (PS es)).
Proof.
unfold THoareTriple_Eval, THoarePrmsTriple_Eval.
intros.
inversion k3; subst.
generalize (Apply_BStepT2t ftenv tenv fenv env f es v s s' k1 k2 t
(PT (map snd fps)) k3 X2).
intro P.
specialize (P X).
destruct P as [s1 P].
destruct P as [vs P].
inversion k3; subst.
destruct P as [Q1 Q2].
specialize (H ftenv tenv k1 k2 (PT (map snd fps)) X2 s s1 vs Q2 H1).
assert (ExpTyping ftenv tenv fenv (Apply (QF f) (PS (map Val vs))) t).
econstructor.
reflexivity.
auto.
eauto.
assert (FT fps t = FT fps0 t).
eapply QFunStrongTyping.
eauto.
auto.
eauto.
auto.
inversion H2; subst.
auto.
eapply H0.
eauto.
eauto.
eauto.
eauto.
auto.
Qed.
Lemma QFun_VHTT (P1: W -> Prop) (P2: Value -> W -> Prop)
(fenv: funEnv) (env: valEnv) (x: Id) (f: Fun) (es: list Exp) :
findET fenv x f ->
THoareTriple_Eval P1 P2 fenv env (Apply (QF f) (PS es)) ->
THoareTriple_Eval P1 P2 fenv env (Apply (FVar x) (PS es)).
Proof.
unfold THoareTriple_Eval.
intros.
assert (sigT2 (findET ftenv x) (fun t: FTyp => FunTyping f t)).
{- eapply ExRelValT1.
eassumption.
assumption.
}
destruct X1 as [ft Z1 Z2].
inversion k3; subst.
inversion X2; subst.
eapply MatchEnvs2BT_find1 in X4.
destruct X4 as [Z3 Z4].
destruct ft.
inversion Z1; subst.
inversion Z4; subst.
rewrite H1 in H2.
inversion H2; subst.
eapply H.
- exact k1.
- exact k2.
- instantiate (1:=t).
econstructor.
+ reflexivity.
+ assumption.
+ instantiate (1:=fps).
econstructor.
auto.
+ auto.
- clear H2.
instantiate (1:=s).
inversion X0; subst.
inversion X4; subst.
inversion X6; subst.
inversion X7; subst.
inversion X; subst.
rewrite H2 in H3.
inversion H3; subst.
auto.
- auto.
Qed.
Lemma Apply_VHTT3 (P0: W -> Prop) (P1: list Value -> W -> Prop)
(P2: Value -> W -> Prop)
(fenv: funEnv) (env: valEnv) (x: Id) (f: Fun)
(es: list Exp) :
THoarePrmsTriple_Eval P0 P1 fenv env (PS es) ->
findET fenv x f->
(forall vs ,
THoareTriple_Eval (P1 vs) P2 fenv env
(Apply (QF f) (PS (map Val vs)))) ->
THoareTriple_Eval P0 P2 fenv env (Apply (FVar x) (PS es)).
Proof.
intros.
eapply QFun_VHTT.
eauto.
eapply Apply_VHTT2.
eauto.
auto.
Qed.
Lemma Prms_VHTT1 (P0: W -> Prop) (P1: Value -> W -> Prop)
(P2: list Value -> W -> Prop)
(fenv: funEnv) (env: valEnv)
(e: Exp) (es: list Exp) :
THoareTriple_Eval P0 P1 fenv env e ->
(forall v: Value,
THoarePrmsTriple_Eval (P1 v) (fun vs => P2 (v::vs)) fenv env (PS es)) ->
THoarePrmsTriple_Eval P0 P2 fenv env (PS (e::es)).
Proof.
unfold THoareTriple_Eval, THoarePrmsTriple_Eval.
intros.
inversion k3; subst.
inversion X0; subst.
rename y into t.
rename l' into ts.
destruct vs.
eapply PrmsClos_aux0 in X.
simpl in X.
intuition.
eapply Prms_BStepT2 in X.
destruct X as [s1 X].
specialize (H ftenv tenv k1 k2 t X1 s s1 v X H1).
assert (PrmsTyping ftenv tenv fenv (PS es) (PT ts)).
constructor.
auto.
specialize (H0 v ftenv tenv k1 k2 (PT ts) X3 s1 s' vs p H).
auto.
eauto.
eauto.
eauto.
Defined.
Lemma IfTheElse_VHTT1 (P0: W -> Prop) (P1 P2: Value -> W -> Prop)
(fenv: funEnv) (env: valEnv)
(e1 e2 e3: Exp) :
THoareTriple_Eval P0 P1 fenv env e1 ->
THoareTriple_Eval (P1 (cst bool true)) P2 fenv env e2 ->
THoareTriple_Eval (P1 (cst bool false)) P2 fenv env e3 ->
THoareTriple_Eval P0 P2 fenv env (IfThenElse e1 e2 e3).
Proof.
unfold THoareTriple_Eval.
intros.
generalize (IfThenElse_BStepT1
ftenv tenv fenv env e1 e2 e3 v s s' k1 k2 t k3 X).
intro.
inversion k3; subst.
specialize (H ftenv tenv k1 k2 Bool X1 s).
specialize (H0 ftenv tenv k1 k2 t X2).
specialize (H1 ftenv tenv k1 k2 t X3).
destruct X0.
destruct s0 as [s1 X0 X4].
eapply H0.
exact X4.
eapply H.
exact X0.
exact H2.
destruct s0 as [s1 X0 X4].
eapply H1.
exact X4.
eapply H.
exact X0.
exact H2.
Qed.
End THoare.
(*
Lemma Fun_VHT_unpack (P1: list Value -> W -> Prop)
(P2: Value -> W -> Prop)
(fenv: funEnv) (env: valEnv) (f: Fun) :
(forall env, THoareFunTriple_Eval (P1 (map snd env)) P2 fenv env (QF f)) ->
match f with
| FC fenv' tenv' e0 e1 x n =>
(* length tenv' = length es /\ *)
match n with
| 0 => (forall vs: list Value,
THoareTriple_Eval (P1 vs) P2 fenv' (mkVEnv tenv' vs) e0)
| S n' => (forall vs: list Value,
THoareTriple_Eval (P1 vs) P2 ((x,FC fenv' tenv' e0 e1 x n')::fenv')
(mkVEnv tenv' vs) e1)
end
end.
Proof.
unfold THoareFunTriple_Eval, THoareTriple_Eval.
intros.
destruct f.
destruct n.
intros.
Lemma Apply_VHTT2 (P0: W -> Prop) (P1: list Value -> W -> Prop)
(P2: Value -> W -> Prop)
(fenv: funEnv) (env: valEnv) (f: Fun) (es: list Exp) :
THoarePrmsTriple_Eval P0 P1 fenv env (PS es) ->
(forall env, THoareFunTriple_Eval (P1 (map snd env)) P2 fenv env (QF f)) ->
THoareTriple_Eval P0 P2 fenv env (Apply (QF f) (PS es)).
Proof.
unfold THoareFunTriple_Eval, THoareTriple_Eval.
intros.
inversion k3; subst.
specialize (H0 env ftenv k1 (FT fps t) X1 s s f).
Lemma QFun_VHTT2 (P1: W -> Prop) (P2: Value -> W -> Prop)
(fenv: funEnv) (env: valEnv) (x: Id) (f: Fun) (es: list Exp) :
findET fenv x f ->
THoareTriple_Eval P1 P2 fenv env (Apply (FVar x) (PS es)) ->
THoareTriple_Eval P1 P2 fenv env (Apply (QF f) (PS es)).
Proof.
unfold THoareTriple_Eval.
intros.
inversion k3; subst.
inversion X2; subst.
eapply H.
eauto.
eauto.
instantiate (1:= t).
econstructor.
reflexivity.
auto.
instantiate (1:=fps).
econstructor.
inversion X; subst.
assert (exists ls1 ls2, findE ls1 x = None /\
fenv = ls1 ++ ((x,f) :: ls2)).
{- eapply findE_Some in H1.
auto.
}
assert (sigT2 (findET ftenv x) (fun t: FTyp => FunTyping f t)).
{- eapply ExRelValT1.
eassumption.
assumption.
}
destruct X5 as [ft Z1 Z2].
inversion Z1; subst.
assert (exists ls1 ls2, findE ls1 x = None /\
ftenv = ls1 ++ ((x,ft) :: ls2)).
{- eapply findE_Some in H3.
auto.
}
instantiate (1:=f).
econstructor.
auto.
(******)
Focus 4.
inversion X; subst.
destruct fenv.
simpl in H1.
inversion H1.
simpl.
assert (sigT2 (findET ftenv x) (fun t: FTyp => FunTyping f t)).
eapply ExRelValT1.
eassumption.
assumption.
destruct X1 as [ft Z1 Z2].
inversion k3; subst.
inversion X2; subst.
(* eapply MatchEnvs2BT_find1 in X4.
destruct X4 as [Z3 Z4].
*)
destruct ft.
inversion Z2; subst.
inversion X4; subst.
rewrite H1 in H2.
inversion H2; subst.
eapply H.
eauto.
eauto.
instantiate (1:= t).
econstructor.
reflexivity.
auto.
Lemma Apply_VHTT2 (P0: W -> Prop) (P1: list Value -> W -> Prop)
(P2: Value -> W -> Prop)
(fenv: funEnv) (env: valEnv) (qf: QFun) (es: list Exp) :
THoarePrmsTriple_Eval P0 P1 fenv env (PS es) ->
(forall env, THoareFunTriple_Eval (P1 (map snd env)) P2 fenv env qf) ->
THoareTriple_Eval P0 P2 fenv env (Apply qf (PS es)).
Proof.
unfold THoareTriple_Eval, THoareFunTriple_Eval.
intros.
Admitted.
Lemma Apply_VHTT3 (P0: W -> Prop) (P1: list Value -> W -> Prop)
(P2: Value -> W -> Prop)
(fenv: funEnv) (env: valEnv) fname f (es: list Exp) :
THoarePrmsTriple_Eval P0 P1 fenv env (PS es) ->
findET fenv fname f->
forall vs , THoareTriple_Eval (P1 vs) P2 fenv env
(Apply (QF f) (PS (map Val vs))) ->
THoareTriple_Eval P0 P2 fenv env (Apply (FVar fname) (PS es)).
Proof.
Admitted.
Lemma BindMS_VHTT1 (P1: W -> Prop)
(P2: Value -> W -> Prop)
(fenv fenv': funEnv) (env env': valEnv) e :
THoareTriple_Eval P1 P2 (fenv'++fenv) (env'++env) e ->
THoareTriple_Eval P1 P2 fenv env (BindMS fenv' env' e).
Admitted.
*)