58
58
intros.
59
59
rewrite denote_tc_assert_andp.
60
60
apply boxy_andp; auto.
61
+ apply extendM_refl.
61
62
Qed .
62
63
63
64
Lemma extend_tc_bool:
@@ -87,7 +88,6 @@ repeat match goal with |- boxy _ (match ?A with _ => _ end) => destruct A end;
87
88
try apply extend_prop.
88
89
Qed .
89
90
90
-
91
91
Lemma extend_tc_Zle:
92
92
forall {CS: compspecs} v i rho,
93
93
boxy extendM (denote_tc_assert (tc_Zle v i) rho).
@@ -131,16 +131,22 @@ rewrite H1 in H.
131
131
inv H; auto.
132
132
Qed .
133
133
134
- Lemma extend_andp: forall P Q,
135
- boxy extendM P -> boxy extendM Q -> boxy extendM (andp P Q).
134
+ Lemma extend_andp:
135
+ forall {A: Type } {JA : Join A} {PA: Perm_alg A} {SA : Sep_alg A} {AG: ageable A}
136
+ {XA: Age_alg A} {EO: Ext_ord A} {EA: Ext_alg A}
137
+ (P Q: pred A),
138
+ boxy extendM P -> boxy extendM Q -> boxy extendM (andp P Q).
136
139
Proof .
137
140
intros.
138
141
apply boxy_i; intros.
139
142
apply extendM_refl.
140
143
destruct H2; split; eapply boxy_e; eauto.
141
144
Qed .
142
145
143
- Lemma extend_orp: forall P Q,
146
+ Lemma extend_orp:
147
+ forall {A: Type } {JA : Join A} {PA: Perm_alg A} {SA : Sep_alg A} {AG: ageable A}
148
+ {XA: Age_alg A} {EO: Ext_ord A} {EA: Ext_alg A}
149
+ (P Q: pred A),
144
150
boxy extendM P -> boxy extendM Q -> boxy extendM (orp P Q).
145
151
Proof .
146
152
intros.
@@ -281,27 +287,14 @@ Proof.
281
287
intros.
282
288
unfold tc_nobinover.
283
289
unfold if_expr_signed.
284
- destruct (typeof e1); try apply extend_prop.
285
- destruct s; try apply extend_prop.
290
+ destruct (typeof e1) as [ | _ [ | ] _ | [ | ] _ | | | | | | ],
291
+ (typeof e2) as [ | _ [ | ] _ | [ | ] _ | | | | | | ];
292
+ try apply extend_prop;
286
293
destruct (eval_expr e1 any_environ); try apply extend_prop;
287
294
destruct (eval_expr e2 any_environ); try apply extend_prop;
288
- try apply extend_tc_nosignedover;
289
- simple_if_tac; try apply extend_prop; try apply extend_tc_nosignedover.
290
- destruct (typeof e2) as [ | _ [ | ] _ | | | | | | | ];
291
- try apply extend_prop.
292
- simple_if_tac; try apply extend_prop; try apply extend_tc_nosignedover.
293
- destruct (typeof e2) as [ | _ [ | ] _ | | | | | | | ];
294
295
try apply extend_tc_nosignedover.
296
+ all:
295
297
simple_if_tac; try apply extend_prop; try apply extend_tc_nosignedover.
296
- try destruct s; try apply extend_prop; try apply extend_tc_nosignedover.
297
- destruct (eval_expr e1 any_environ); try apply extend_prop;
298
- destruct (eval_expr e2 any_environ); try apply extend_prop;
299
- try apply extend_tc_nosignedover.
300
- all: simple_if_tac; try apply extend_prop; try apply extend_tc_nosignedover;
301
- destruct (typeof e2) as [ | _ [ | ] _ | | | | | | | ];
302
- try apply extend_prop;
303
- try apply extend_tc_nosignedover.
304
- all: simple_if_tac; try apply extend_prop; try apply extend_tc_nosignedover.
305
298
Qed .
306
299
307
300
Lemma boxy_orp {A} `{H : ageable A}:
@@ -325,6 +318,7 @@ Proof.
325
318
intros.
326
319
rewrite denote_tc_assert_orp.
327
320
apply boxy_orp; auto.
321
+ apply extendM_refl.
328
322
Qed .
329
323
330
324
@@ -356,6 +350,7 @@ Lemma extend_tc_andp':
356
350
Proof .
357
351
intros.
358
352
apply boxy_andp; auto.
353
+ apply extendM_refl.
359
354
Qed .
360
355
361
356
Ltac extend_tc_prover :=
@@ -675,25 +670,25 @@ Ltac tc_expr_cenv_sub_tac2 :=
675
670
unfold if_expr_signed.
676
671
intros.
677
672
destruct (typeof a1) as [ | _ [ | ] | [ | ] | [ | ] | | | | | ];
678
- destruct (typeof a2) as [ | _ [ | ] | | | | | | | ];
673
+ destruct (typeof a2) as [ | _ [ | ] | [ | ] | | | | | | ];
679
674
tc_expr_cenv_sub_tac; repeat tc_expr_cenv_sub_tac2.
680
675
Qed .
681
676
682
- Lemma tc_expr_cenv_sub a rho Delta w (T: @tc_expr CS Delta a rho w):
683
- @tc_expr CS' Delta a rho w
684
- with tc_lvalue_cenv_sub a rho Delta w (T: @tc_lvalue CS Delta a rho w):
685
- @tc_lvalue CS' Delta a rho w.
686
- Proof .
687
- - clear tc_expr_cenv_sub.
688
- unfold tc_expr in *.
689
- induction a;
690
- try solve [apply (denote_tc_assert_cenv_sub CSUB); auto];
691
- simpl in T|-*;
692
- tc_expr_cenv_sub_tac.
693
- + (* Ederef *)
694
- destruct (access_mode t) eqn:?H; auto.
677
+ Lemma tc_expr_cenv_sub_unop:
678
+ forall
679
+ (u : unary_operation)
680
+ (a : expr)
681
+ (t : type)
682
+ (rho : environ)
683
+ (Delta : tycontext)
684
+ (w : rmap)
685
+ (T : (@tc_expr CS Delta (Eunop u a t) rho) w)
686
+ (IHa : (@tc_expr CS Delta a rho) w -> (@tc_expr CS' Delta a rho) w),
687
+ (@tc_expr CS' Delta (Eunop u a t) rho) w.
688
+ Proof .
689
+ intros.
690
+ unfold tc_expr in *; simpl in T|-*.
695
691
tc_expr_cenv_sub_tac.
696
- + (* Eunop *)
697
692
destruct u; simpl in H|-*;
698
693
destruct (typeof a) as [ | [ | | | ] [ | ] | [ | ] | [ | ] | | | | | ];
699
694
tc_expr_cenv_sub_tac.
@@ -712,8 +707,24 @@ Ltac tc_expr_cenv_sub_tac2 :=
712
707
apply (denote_tc_nosignedover_eval_expr_cenv_sub CSUB rho
713
708
(Econst_long Int64.zero (Ctypes.Tlong Signed a0)) a w Z.sub Unsigned);
714
709
auto.
715
- + (* Ebinop *)
716
- abstract (
710
+ Qed .
711
+
712
+ Lemma tc_expr_cenv_sub_binop:
713
+ forall
714
+ (b : binary_operation)
715
+ (a1 a2 : expr)
716
+ (t : type)
717
+ (rho : environ)
718
+ (Delta : tycontext)
719
+ (w : rmap)
720
+ (T : (@tc_expr CS Delta (Ebinop b a1 a2 t) rho) w)
721
+ (IHa1 : (@tc_expr CS Delta a1 rho) w -> (@tc_expr CS' Delta a1 rho) w)
722
+ (IHa2 : (@tc_expr CS Delta a2 rho) w -> (@tc_expr CS' Delta a2 rho) w),
723
+ (@tc_expr CS' Delta (Ebinop b a1 a2 t) rho) w.
724
+ Proof .
725
+ intros.
726
+ unfold tc_expr in *; simpl in T|-*.
727
+ tc_expr_cenv_sub_tac.
717
728
rewrite den_isBinOpR;
718
729
rewrite den_isBinOpR in H;
719
730
destruct b; simpl in H|-*;
@@ -722,9 +733,23 @@ Ltac tc_expr_cenv_sub_tac2 :=
722
733
destruct A; tc_expr_cenv_sub_tac
723
734
end;
724
735
tc_expr_cenv_sub_tac;
725
- try solve [simple apply tc_nobinover_cenv_sub; auto]).
726
- + (* Ecast *)
727
- abstract (
736
+ try solve [simple apply tc_nobinover_cenv_sub; auto].
737
+ Time Qed . (* This Qed takes a really long time *)
738
+
739
+ Lemma tc_expr_cenv_sub_cast:
740
+ forall
741
+ (a : expr)
742
+ (t : type)
743
+ (rho : environ)
744
+ (Delta : tycontext)
745
+ (w : rmap)
746
+ (T : (@tc_expr CS Delta (Ecast a t) rho) w)
747
+ (IHa : (@tc_expr CS Delta a rho) w -> (@tc_expr CS' Delta a rho) w),
748
+ (@tc_expr CS' Delta (Ecast a t) rho) w.
749
+ Proof .
750
+ intros.
751
+ unfold tc_expr in *; simpl in T|-*.
752
+ tc_expr_cenv_sub_tac.
728
753
unfold isCastResultType in *;
729
754
repeat match goal with |- app_pred (denote_tc_assert match ?A with _ => _ end _) _ =>
730
755
destruct A; tc_expr_cenv_sub_tac
@@ -736,8 +761,28 @@ Ltac tc_expr_cenv_sub_tac2 :=
736
761
rewrite ?denote_tc_assert_iszero;
737
762
destruct (Val.eq (@eval_expr CS a rho) Vundef) as [e|n];
738
763
[rewrite e in *; contradiction |
739
- rewrite <- ?(eval_expr_cenv_sub_eq CSUB _ _ n); auto]]).
740
- + (* Efield *)
764
+ rewrite <- ?(eval_expr_cenv_sub_eq CSUB _ _ n); auto]].
765
+ Qed .
766
+
767
+ Lemma tc_expr_cenv_sub_field:
768
+ forall
769
+ (a : expr)
770
+ (tc_lvalue_cenv_sub : forall (rho : environ)
771
+ (Delta : tycontext) (w : rmap),
772
+ (@tc_lvalue CS Delta a rho) w ->
773
+ (@tc_lvalue CS' Delta a rho) w)
774
+ (i : ident)
775
+ (t : type)
776
+ (rho : environ)
777
+ (Delta : tycontext)
778
+ (w : rmap)
779
+ (T : (@tc_expr CS Delta (Efield a i t) rho) w)
780
+ (IHa : (@tc_expr CS Delta a rho) w -> (@tc_expr CS' Delta a rho) w),
781
+ (@tc_expr CS' Delta (Efield a i t) rho) w.
782
+ Proof .
783
+ intros.
784
+ unfold tc_expr in *; simpl in T|-*.
785
+ tc_expr_cenv_sub_tac.
741
786
destruct (access_mode t); tc_expr_cenv_sub_tac.
742
787
destruct (typeof a); tc_expr_cenv_sub_tac.
743
788
*
@@ -758,12 +803,23 @@ Ltac tc_expr_cenv_sub_tac2 :=
758
803
intros. specialize (CSUB id). hnf in CSUB. rewrite H3 in CSUB; auto.
759
804
apply co_consistent_complete.
760
805
apply (cenv_consistent i0); auto.
761
- - clear tc_lvalue_cenv_sub.
762
- unfold tc_lvalue in *.
763
- induction a;
764
- try solve [apply (denote_tc_assert_cenv_sub CSUB); auto];
765
- simpl in T|-*;
766
- tc_expr_cenv_sub_tac.
806
+ Qed .
807
+
808
+ Lemma tc_lvalue_cenv_sub_field:
809
+ forall
810
+ (a : expr)
811
+ (i : ident)
812
+ (t : type)
813
+ (rho : environ)
814
+ (Delta : tycontext)
815
+ (w : rmap)
816
+ (T : (@denote_tc_assert CS (@typecheck_lvalue CS Delta (Efield a i t)) rho) w)
817
+ (IHa : (@denote_tc_assert CS (@typecheck_lvalue CS Delta a) rho) w ->
818
+ (@denote_tc_assert CS' (@typecheck_lvalue CS' Delta a) rho) w),
819
+ (@denote_tc_assert CS' (@typecheck_lvalue CS' Delta (Efield a i t)) rho) w.
820
+ Proof .
821
+ intros.
822
+ simpl in T|-*; tc_expr_cenv_sub_tac.
767
823
destruct (typeof a); tc_expr_cenv_sub_tac.
768
824
*
769
825
destruct ((@cenv_cs CS) ! i0) eqn:?; try contradiction.
@@ -785,6 +841,38 @@ Ltac tc_expr_cenv_sub_tac2 :=
785
841
apply (cenv_consistent i0); auto.
786
842
Qed .
787
843
844
+ Lemma tc_expr_cenv_sub a rho Delta w (T: @tc_expr CS Delta a rho w):
845
+ @tc_expr CS' Delta a rho w
846
+ with tc_lvalue_cenv_sub a rho Delta w (T: @tc_lvalue CS Delta a rho w):
847
+ @tc_lvalue CS' Delta a rho w.
848
+ Proof .
849
+ - clear tc_expr_cenv_sub.
850
+ induction a;
851
+ try solve [apply (denote_tc_assert_cenv_sub CSUB); auto];
852
+ try solve [unfold tc_expr in *; simpl in T|-*; tc_expr_cenv_sub_tac].
853
+ + (* Ederef *)
854
+ unfold tc_expr in *; simpl in T|-*.
855
+ destruct (access_mode t) eqn:?H; auto.
856
+ tc_expr_cenv_sub_tac.
857
+ + (* Eunop *)
858
+ apply (tc_expr_cenv_sub_unop _ _ _ _ _ _ T IHa).
859
+ + (* Ebinop *)
860
+ apply (tc_expr_cenv_sub_binop _ _ _ _ _ _ _ T IHa1 IHa2).
861
+ + (* Ecast *)
862
+ apply (tc_expr_cenv_sub_cast _ _ _ _ _ T IHa).
863
+ + (* Efield *)
864
+ apply (tc_expr_cenv_sub_field a (tc_lvalue_cenv_sub a) _ _ _ _ _ T IHa).
865
+ - clear tc_lvalue_cenv_sub.
866
+ unfold tc_lvalue in *.
867
+ induction a;
868
+ try solve [apply (denote_tc_assert_cenv_sub CSUB); auto].
869
+ + (* Ederef *)
870
+ simpl in T|-*;
871
+ tc_expr_cenv_sub_tac.
872
+ + (* Efield *)
873
+ apply (tc_lvalue_cenv_sub_field _ _ _ _ _ _ T IHa).
874
+ Time Qed .
875
+
788
876
Lemma tc_exprlist_cenv_sub Delta rho w:
789
877
forall types bl, (@tc_exprlist CS Delta types bl rho) w ->
790
878
(@tc_exprlist CS' Delta types bl rho) w.
0 commit comments