Skip to content

Commit 6ec92da

Browse files
committed
Add some more ZRangeProofs
For mit-plv#1761
1 parent 7a0144e commit 6ec92da

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

src/AbstractInterpretation/ZRangeProofs.v

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,29 @@ Module Compilers.
6565
-> type.related_hetero (fun t x v => ZRange.type.base.option.is_bounded_by x v = true) x v.
6666
Proof. induction t; cbn in *; intuition congruence. Qed.
6767

68+
Lemma is_bounded_by_impl_related_hetero_and_Proper {skip_base} t
69+
(x : ZRange.type.option.interp t) (v : type.interp base.interp t)
70+
: ZRange.type.option.is_bounded_by x v = true
71+
-> type.related_hetero_and_Proper (skip_base:=skip_base) (fun _ => eq) (fun _ => eq) (fun t x v => ZRange.type.base.option.is_bounded_by x v = true) x v.
72+
Proof. induction t; cbn in *; break_innermost_match; intuition congruence. Qed.
73+
6874
Lemma is_bounded_by_impl_eqv_refl t
75+
(x : ZRange.type.option.interp t) (v : type.interp base.interp t)
76+
: ZRange.type.option.is_bounded_by x v = true
77+
-> x == x /\ v == v.
78+
Proof. induction t; cbn; split; try reflexivity; try congruence. Qed.
79+
80+
Lemma is_bounded_by_impl_eqv_refl1 t
81+
(x : ZRange.type.option.interp t) (v : type.interp base.interp t)
82+
: ZRange.type.option.is_bounded_by x v = true
83+
-> x == x.
84+
Proof. intros; eapply is_bounded_by_impl_eqv_refl; eassumption. Qed.
85+
86+
Lemma is_bounded_by_impl_eqv_refl2 t
6987
(x : ZRange.type.option.interp t) (v : type.interp base.interp t)
7088
: ZRange.type.option.is_bounded_by x v = true
7189
-> v == v.
72-
Proof. induction t; cbn; try reflexivity; try congruence. Qed.
90+
Proof. intros; eapply is_bounded_by_impl_eqv_refl; eassumption. Qed.
7391

7492
Lemma andb_bool_for_each_lhs_of_arrow_is_bounded_by_impl_and_for_each_lhs_of_arrow_eqv_refl t
7593
(x : type.for_each_lhs_of_arrow ZRange.type.option.interp t) (v : type.for_each_lhs_of_arrow (type.interp base.interp) t)
@@ -79,7 +97,7 @@ Module Compilers.
7997
induction t; cbn; [ reflexivity | ].
8098
rewrite Bool.andb_true_iff.
8199
intros [H0 H1].
82-
split; eauto using is_bounded_by_impl_eqv_refl.
100+
split; eauto using is_bounded_by_impl_eqv_refl2.
83101
Qed.
84102
End option.
85103
End type.

0 commit comments

Comments
 (0)