Commit ef0af75d authored by Guillaume Melquiond's avatar Guillaume Melquiond

Update parts of Coq realizations whose printing looks sane.

parent fb2fc569
......@@ -53,10 +53,11 @@ Qed.
(* Why3 goal *)
Lemma xorb_def :
forall (x:bool) (y:bool),
((Init.Datatypes.xorb x y) = match x with
| false => y
| true => (Init.Datatypes.negb y)
end).
((Init.Datatypes.xorb x y) =
match x with
| false => y
| true => (Init.Datatypes.negb y)
end).
Proof.
intros x y.
destruct x; destruct y; auto.
......
......@@ -1497,8 +1497,8 @@ Qed.
Lemma to_uint_sub_bounded :
forall (v1:t) (v2:t),
((0%Z <= ((to_uint v1) - (to_uint v2))%Z)%Z /\
(((to_uint v1) - (to_uint v2))%Z < two_power_size)%Z) -> ((to_uint (sub v1
v2)) = ((to_uint v1) - (to_uint v2))%Z).
(((to_uint v1) - (to_uint v2))%Z < two_power_size)%Z) ->
((to_uint (sub v1 v2)) = ((to_uint v1) - (to_uint v2))%Z).
intros v1 v2 (h1,h2).
rewrite <-(mod1_out (to_uint v1 - to_uint v2) two_power_size) by auto.
apply to_uint_sub.
......@@ -1512,8 +1512,8 @@ Defined.
(* Why3 goal *)
Lemma to_uint_neg :
forall (v:t),
((to_uint (neg v)) = (int.EuclideanDivision.mod1 (-(to_uint v))%Z
two_power_size)).
((to_uint (neg v)) =
(int.EuclideanDivision.mod1 (-(to_uint v))%Z two_power_size)).
intros v.
apply to_uint_of_int, mod1_in_range2.
Qed.
......@@ -1532,9 +1532,10 @@ Lemma to_uint_mul : forall (v1:t) (v2:t), ((to_uint (mul v1
Qed.
(* Why3 goal *)
Lemma to_uint_mul_bounded : forall (v1:t) (v2:t),
(((to_uint v1) * (to_uint v2))%Z < two_power_size)%Z -> ((to_uint (mul v1
v2)) = ((to_uint v1) * (to_uint v2))%Z).
Lemma to_uint_mul_bounded :
forall (v1:t) (v2:t),
(((to_uint v1) * (to_uint v2))%Z < two_power_size)%Z ->
((to_uint (mul v1 v2)) = ((to_uint v1) * (to_uint v2))%Z).
intros v1 v2 h1.
rewrite <-(mod1_out (to_uint v1 * to_uint v2) two_power_size).
apply to_uint_mul.
......@@ -1549,8 +1550,10 @@ Definition udiv : t -> t -> t.
Defined.
(* Why3 goal *)
Lemma to_uint_udiv : forall (v1:t) (v2:t), ((to_uint (udiv v1
v2)) = (int.EuclideanDivision.div (to_uint v1) (to_uint v2))).
Lemma to_uint_udiv :
forall (v1:t) (v2:t),
((to_uint (udiv v1 v2)) =
(int.EuclideanDivision.div (to_uint v1) (to_uint v2))).
intros v1 v2.
apply to_uint_of_int.
case (Z.eq_dec (to_uint v2) 0); intro.
......@@ -1571,8 +1574,10 @@ Definition urem : t -> t -> t.
Defined.
(* Why3 goal *)
Lemma to_uint_urem : forall (v1:t) (v2:t), ((to_uint (urem v1
v2)) = (int.EuclideanDivision.mod1 (to_uint v1) (to_uint v2))).
Lemma to_uint_urem :
forall (v1:t) (v2:t),
((to_uint (urem v1 v2)) =
(int.EuclideanDivision.mod1 (to_uint v1) (to_uint v2))).
intros v1 v2.
apply to_uint_of_int.
case (Z.eq_dec (to_uint v2) 0); intro.
......@@ -1598,9 +1603,10 @@ Lemma lsr_bv_is_lsr :
Qed.
(* Why3 goal *)
Lemma to_uint_lsr : forall (v:t) (n:t), ((to_uint (lsr_bv v
n)) = (int.EuclideanDivision.div (to_uint v)
(bv.Pow2int.pow2 (to_uint n)))).
Lemma to_uint_lsr :
forall (v:t) (n:t),
((to_uint (lsr_bv v n)) =
(int.EuclideanDivision.div (to_uint v) (bv.Pow2int.pow2 (to_uint n)))).
intros v n.
apply to_uint_lsr_aux.
Qed.
......@@ -1688,8 +1694,9 @@ Lemma nth_bv_def_aux : forall {l} (x:Vector.t bool (S l)) (i:Z),
Qed.
(* Why3 goal *)
Lemma nth_bv_def : forall (x:t) (i:t), ((nth_bv x i) = true) <->
~ ((bw_and (lsr_bv x i) one) = zeros).
Lemma nth_bv_def :
forall (x:t) (i:t),
((nth_bv x i) = true) <-> ~ ((bw_and (lsr_bv x i) one) = zeros).
intros; unfold nth_bv.
case (Z_lt_ge_dec (to_uint i) size); intro.
rewrite <-(Zplus_0_l (to_uint i)).
......
......@@ -52,14 +52,15 @@ Definition total_error (x:floating_point.DoubleFormat.double) : R :=
(Reals.Rbasic_fun.Rabs ((value x) - (model x))%R).
(* Why3 assumption *)
Definition no_overflow (m:floating_point.Rounding.mode) (x:R): Prop :=
((Reals.Rbasic_fun.Rabs (round m
x)) <= (9007199254740991 * 19958403095347198116563727130368385660674512604354575415025472424372118918689640657849579654926357010893424468441924952439724379883935936607391717982848314203200056729510856765175377214443629871826533567445439239933308104551208703888888552684480441575071209068757560416423584952303440099278848)%R)%R.
Definition no_overflow (m:floating_point.Rounding.mode) (x:R) : Prop :=
((Reals.Rbasic_fun.Rabs (round m x)) <=
(9007199254740991 * 19958403095347198116563727130368385660674512604354575415025472424372118918689640657849579654926357010893424468441924952439724379883935936607391717982848314203200056729510856765175377214443629871826533567445439239933308104551208703888888552684480441575071209068757560416423584952303440099278848)%R)%R.
(* Why3 goal *)
Lemma Bounded_real_no_overflow :
forall (m:floating_point.Rounding.mode) (x:R),
((Reals.Rbasic_fun.Rabs x) <= (9007199254740991 * 19958403095347198116563727130368385660674512604354575415025472424372118918689640657849579654926357010893424468441924952439724379883935936607391717982848314203200056729510856765175377214443629871826533567445439239933308104551208703888888552684480441575071209068757560416423584952303440099278848)%R)%R ->
((Reals.Rbasic_fun.Rabs x) <=
(9007199254740991 * 19958403095347198116563727130368385660674512604354575415025472424372118918689640657849579654926357010893424468441924952439724379883935936607391717982848314203200056729510856765175377214443629871826533567445439239933308104551208703888888552684480441575071209068757560416423584952303440099278848)%R)%R ->
(no_overflow m x).
exact (Bounded_real_no_overflow 53 1024 (refl_equal true) (refl_equal true)).
Qed.
......@@ -91,8 +92,9 @@ now apply Bounded_value.
Qed.
(* Why3 goal *)
Lemma Exact_rounding_for_integers : forall (m:floating_point.Rounding.mode)
(i:Z), (((-9007199254740992%Z)%Z <= i)%Z /\ (i <= 9007199254740992%Z)%Z) ->
Lemma Exact_rounding_for_integers :
forall (m:floating_point.Rounding.mode) (i:Z),
(((-9007199254740992%Z)%Z <= i)%Z /\ (i <= 9007199254740992%Z)%Z) ->
((round m (BuiltIn.IZR i)) = (BuiltIn.IZR i)).
Proof.
intros m i Hi.
......@@ -112,14 +114,18 @@ now apply Round_up_ge.
Qed.
(* Why3 goal *)
Lemma Round_down_neg : forall (x:R), ((round floating_point.Rounding.Down
(-x)%R) = (-(round floating_point.Rounding.Up x))%R).
Lemma Round_down_neg :
forall (x:R),
((round floating_point.Rounding.Down (-x)%R) =
(-(round floating_point.Rounding.Up x))%R).
now apply Round_down_neg.
Qed.
(* Why3 goal *)
Lemma Round_up_neg : forall (x:R), ((round floating_point.Rounding.Up
(-x)%R) = (-(round floating_point.Rounding.Down x))%R).
Lemma Round_up_neg :
forall (x:R),
((round floating_point.Rounding.Up (-x)%R) =
(-(round floating_point.Rounding.Down x))%R).
now apply Round_up_neg.
Qed.
......
......@@ -53,7 +53,8 @@ Definition total_error (x:floating_point.SingleFormat.single) : R :=
(* Why3 assumption *)
Definition no_overflow (m:floating_point.Rounding.mode) (x:R) : Prop :=
((Reals.Rbasic_fun.Rabs (round m x)) <= (33554430 * 10141204801825835211973625643008)%R)%R.
((Reals.Rbasic_fun.Rabs (round m x)) <=
(33554430 * 10141204801825835211973625643008)%R)%R.
Lemma max_single_eq: (33554430 * 10141204801825835211973625643008 = max 24 128)%R.
unfold max, Fcore_defs.F2R; simpl.
......@@ -63,8 +64,8 @@ Qed.
(* Why3 goal *)
Lemma Bounded_real_no_overflow :
forall (m:floating_point.Rounding.mode) (x:R),
((Reals.Rbasic_fun.Rabs x) <= (33554430 * 10141204801825835211973625643008)%R)%R ->
(no_overflow m x).
((Reals.Rbasic_fun.Rabs x) <=
(33554430 * 10141204801825835211973625643008)%R)%R -> (no_overflow m x).
intros m x Hx.
unfold no_overflow.
rewrite max_single_eq in *.
......@@ -95,15 +96,17 @@ Qed.
(* Why3 goal *)
Lemma Bounded_value :
forall (x:floating_point.SingleFormat.single),
((Reals.Rbasic_fun.Rabs (value x)) <= (33554430 * 10141204801825835211973625643008)%R)%R.
((Reals.Rbasic_fun.Rabs (value x)) <=
(33554430 * 10141204801825835211973625643008)%R)%R.
rewrite max_single_eq.
now apply Bounded_value.
Qed.
(* Why3 goal *)
Lemma Exact_rounding_for_integers : forall (m:floating_point.Rounding.mode)
(i:Z), (((-16777216%Z)%Z <= i)%Z /\ (i <= 16777216%Z)%Z) -> ((round m
(BuiltIn.IZR i)) = (BuiltIn.IZR i)).
Lemma Exact_rounding_for_integers :
forall (m:floating_point.Rounding.mode) (i:Z),
(((-16777216%Z)%Z <= i)%Z /\ (i <= 16777216%Z)%Z) ->
((round m (BuiltIn.IZR i)) = (BuiltIn.IZR i)).
Proof.
intros m i Hi.
now apply Exact_rounding_for_integers.
......@@ -122,25 +125,30 @@ now apply Round_up_ge.
Qed.
(* Why3 goal *)
Lemma Round_down_neg : forall (x:R), ((round floating_point.Rounding.Down
(-x)%R) = (-(round floating_point.Rounding.Up x))%R).
Lemma Round_down_neg :
forall (x:R),
((round floating_point.Rounding.Down (-x)%R) =
(-(round floating_point.Rounding.Up x))%R).
now apply Round_down_neg.
Qed.
(* Why3 goal *)
Lemma Round_up_neg : forall (x:R), ((round floating_point.Rounding.Up
(-x)%R) = (-(round floating_point.Rounding.Down x))%R).
Lemma Round_up_neg :
forall (x:R),
((round floating_point.Rounding.Up (-x)%R) =
(-(round floating_point.Rounding.Down x))%R).
now apply Round_up_neg.
Qed.
(* Why3 goal *)
Definition round_logic: floating_point.Rounding.mode -> R ->
floating_point.SingleFormat.single.
Definition round_logic :
floating_point.Rounding.mode -> R -> floating_point.SingleFormat.single.
exact (round_logic 24 128 (refl_equal true) (refl_equal true)).
Defined.
(* Why3 goal *)
Lemma Round_logic_def : forall (m:floating_point.Rounding.mode) (x:R),
Lemma Round_logic_def :
forall (m:floating_point.Rounding.mode) (x:R),
(no_overflow m x) -> ((value (round_logic m x)) = (round m x)).
Proof.
intros m x.
......
......@@ -332,8 +332,9 @@ Definition no_overflow (m:ieee_float.RoundingMode.mode) (x:R) : Prop :=
(in_range (round m x)).
(* Why3 goal *)
Lemma Bounded_real_no_overflow : forall (m:ieee_float.RoundingMode.mode)
(x:R), (in_range x) -> (no_overflow m x).
Lemma Bounded_real_no_overflow :
forall (m:ieee_float.RoundingMode.mode) (x:R),
(in_range x) -> (no_overflow m x).
Proof.
unfold no_overflow, in_range.
rewrite <- max_real_cst.
......@@ -341,7 +342,8 @@ Proof.
Qed.
(* Why3 goal *)
Lemma Round_monotonic : forall (m:ieee_float.RoundingMode.mode) (x:R) (y:R),
Lemma Round_monotonic :
forall (m:ieee_float.RoundingMode.mode) (x:R) (y:R),
(x <= y)%R -> ((round m x) <= (round m y))%R.
Proof.
apply Round_monotonic.
......@@ -356,7 +358,8 @@ Proof.
Qed.
(* Why3 goal *)
Lemma Round_to_real : forall (m:ieee_float.RoundingMode.mode) (x:t),
Lemma Round_to_real :
forall (m:ieee_float.RoundingMode.mode) (x:t),
(t'isFinite x) -> ((round m (t'real x)) = (t'real x)).
Proof.
apply Round_to_real.
......@@ -377,15 +380,19 @@ Proof.
Qed.
(* Why3 goal *)
Lemma Round_down_neg : forall (x:R), ((round ieee_float.RoundingMode.RTN
(-x)%R) = (-(round ieee_float.RoundingMode.RTP x))%R).
Lemma Round_down_neg :
forall (x:R),
((round ieee_float.RoundingMode.RTN (-x)%R) =
(-(round ieee_float.RoundingMode.RTP x))%R).
Proof.
apply Round_down_neg.
Qed.
(* Why3 goal *)
Lemma Round_up_neg : forall (x:R), ((round ieee_float.RoundingMode.RTP
(-x)%R) = (-(round ieee_float.RoundingMode.RTN x))%R).
Lemma Round_up_neg :
forall (x:R),
((round ieee_float.RoundingMode.RTP (-x)%R) =
(-(round ieee_float.RoundingMode.RTN x))%R).
Proof.
apply Round_up_neg.
Qed.
......@@ -395,9 +402,9 @@ Definition in_safe_int_range (i:Z) : Prop :=
((-16777216%Z)%Z <= i)%Z /\ (i <= 16777216%Z)%Z.
(* Why3 goal *)
Lemma Exact_rounding_for_integers : forall (m:ieee_float.RoundingMode.mode)
(i:Z), (in_safe_int_range i) -> ((round m
(BuiltIn.IZR i)) = (BuiltIn.IZR i)).
Lemma Exact_rounding_for_integers :
forall (m:ieee_float.RoundingMode.mode) (i:Z),
(in_safe_int_range i) -> ((round m (BuiltIn.IZR i)) = (BuiltIn.IZR i)).
Proof.
intros m i h1.
now apply Exact_rounding_for_integers.
......@@ -421,8 +428,9 @@ Proof.
Qed.
(* Why3 goal *)
Lemma eq_feq : forall (x:t) (y:t), (t'isFinite x) -> ((t'isFinite y) ->
((x = y) -> (eq x y))).
Lemma eq_feq :
forall (x:t) (y:t),
(t'isFinite x) -> ((t'isFinite y) -> ((x = y) -> (eq x y))).
Proof.
apply eq_feq.
Qed.
......@@ -453,8 +461,10 @@ Proof.
Qed.
(* Why3 goal *)
Lemma eq_to_real_finite : forall (x:t) (y:t), ((t'isFinite x) /\ (t'isFinite
y)) -> ((eq x y) <-> ((t'real x) = (t'real y))).
Lemma eq_to_real_finite :
forall (x:t) (y:t),
((t'isFinite x) /\ (t'isFinite y)) ->
((eq x y) <-> ((t'real x) = (t'real y))).
Proof.
apply eq_to_real_finite.
Qed.
......@@ -468,14 +478,18 @@ Proof.
Qed.
(* Why3 goal *)
Lemma lt_finite : forall (x:t) (y:t), ((t'isFinite x) /\ (t'isFinite y)) ->
Lemma lt_finite :
forall (x:t) (y:t),
((t'isFinite x) /\ (t'isFinite y)) ->
((lt x y) <-> ((t'real x) < (t'real y))%R).
Proof.
apply lt_finite.
Qed.
(* Why3 goal *)
Lemma le_finite : forall (x:t) (y:t), ((t'isFinite x) /\ (t'isFinite y)) ->
Lemma le_finite :
forall (x:t) (y:t),
((t'isFinite x) /\ (t'isFinite y)) ->
((le x y) <-> ((t'real x) <= (t'real y))%R).
Proof.
apply le_finite.
......@@ -502,15 +516,17 @@ Proof.
Qed.
(* Why3 goal *)
Lemma not_lt_ge : forall (x:t) (y:t), ((~ (lt x y)) /\ ((is_not_nan x) /\
(is_not_nan y))) -> (le y x).
Lemma not_lt_ge :
forall (x:t) (y:t),
((~ (lt x y)) /\ ((is_not_nan x) /\ (is_not_nan y))) -> (le y x).
Proof.
apply not_lt_ge.
Qed.
(* Why3 goal *)
Lemma not_gt_le : forall (x:t) (y:t), ((~ (lt y x)) /\ ((is_not_nan x) /\
(is_not_nan y))) -> (le x y).
Lemma not_gt_le :
forall (x:t) (y:t),
((~ (lt y x)) /\ ((is_not_nan x) /\ (is_not_nan y))) -> (le x y).
Proof.
apply not_gt_le.
Qed.
......@@ -582,8 +598,9 @@ Proof.
Qed.
(* Why3 goal *)
Lemma diff_sign_trans : forall (x:t) (y:t) (z:t), ((diff_sign x y) /\
(diff_sign y z)) -> (same_sign x z).
Lemma diff_sign_trans :
forall (x:t) (y:t) (z:t),
((diff_sign x y) /\ (diff_sign y z)) -> (same_sign x z).
Proof.
apply diff_sign_trans.
Qed.
......@@ -596,8 +613,10 @@ Proof.
Qed.
(* Why3 goal *)
Lemma same_sign_product : forall (x:t) (y:t), ((t'isFinite x) /\ ((t'isFinite
y) /\ (same_sign x y))) -> (0%R <= ((t'real x) * (t'real y))%R)%R.
Lemma same_sign_product :
forall (x:t) (y:t),
((t'isFinite x) /\ ((t'isFinite y) /\ (same_sign x y))) ->
(0%R <= ((t'real x) * (t'real y))%R)%R.
Proof.
apply same_sign_product.
Qed.
......@@ -608,7 +627,7 @@ Definition product_sign (z:t) (x:t) (y:t) : Prop :=
((diff_sign x y) -> (is_negative z)).
(* Why3 assumption *)
Definition overflow_value (m:ieee_float.RoundingMode.mode) (x:t): Prop :=
Definition overflow_value (m:ieee_float.RoundingMode.mode) (x:t) : Prop :=
match m with
| ieee_float.RoundingMode.RTN => ((is_positive x) -> ((t'isFinite x) /\
((t'real x) = (33554430 * 10141204801825835211973625643008)%R))) /\
......@@ -645,7 +664,8 @@ Proof.
Qed.
(* Why3 goal *)
Lemma add_finite_rev : forall (m:ieee_float.RoundingMode.mode) (x:t) (y:t),
Lemma add_finite_rev :
forall (m:ieee_float.RoundingMode.mode) (x:t) (y:t),
(t'isFinite (add m x y)) -> ((t'isFinite x) /\ (t'isFinite y)).
Proof.
apply add_finite_rev.
......@@ -676,7 +696,8 @@ Proof.
Qed.
(* Why3 goal *)
Lemma sub_finite_rev : forall (m:ieee_float.RoundingMode.mode) (x:t) (y:t),
Lemma sub_finite_rev :
forall (m:ieee_float.RoundingMode.mode) (x:t) (y:t),
(t'isFinite (sub m x y)) -> ((t'isFinite x) /\ (t'isFinite y)).
Proof.
apply sub_finite_rev.
......@@ -707,7 +728,8 @@ Proof.
Qed.
(* Why3 goal *)
Lemma mul_finite_rev : forall (m:ieee_float.RoundingMode.mode) (x:t) (y:t),
Lemma mul_finite_rev :
forall (m:ieee_float.RoundingMode.mode) (x:t) (y:t),
(t'isFinite (mul m x y)) -> ((t'isFinite x) /\ (t'isFinite y)).
Proof.
apply mul_finite_rev.
......@@ -738,10 +760,11 @@ Proof.
Qed.
(* Why3 goal *)
Lemma div_finite_rev : forall (m:ieee_float.RoundingMode.mode) (x:t) (y:t),
(t'isFinite (div m x y)) -> (((t'isFinite x) /\ ((t'isFinite y) /\
~ (is_zero y))) \/ ((t'isFinite x) /\ ((is_infinite y) /\ ((t'real (div m x
y)) = 0%R)))).
Lemma div_finite_rev :
forall (m:ieee_float.RoundingMode.mode) (x:t) (y:t),
(t'isFinite (div m x y)) ->
(((t'isFinite x) /\ ((t'isFinite y) /\ ~ (is_zero y))) \/
((t'isFinite x) /\ ((is_infinite y) /\ ((t'real (div m x y)) = 0%R)))).
Proof.
apply div_finite_rev.
Qed.
......@@ -759,15 +782,19 @@ Proof.
Qed.
(* Why3 goal *)
Lemma neg_finite : forall (x:t), (t'isFinite x) -> ((t'isFinite (neg x)) /\
((t'real (neg x)) = (-(t'real x))%R)).
Lemma neg_finite :
forall (x:t),
(t'isFinite x) ->
((t'isFinite (neg x)) /\ ((t'real (neg x)) = (-(t'real x))%R)).
Proof.
apply neg_finite.
Qed.
(* Why3 goal *)
Lemma neg_finite_rev : forall (x:t), (t'isFinite (neg x)) -> ((t'isFinite
x) /\ ((t'real (neg x)) = (-(t'real x))%R)).
Lemma neg_finite_rev :
forall (x:t),
(t'isFinite (neg x)) ->
((t'isFinite x) /\ ((t'real (neg x)) = (-(t'real x))%R)).
Proof.
apply neg_finite_rev.
Qed.
......@@ -781,8 +808,10 @@ Proof.
Qed.
(* Why3 goal *)
Lemma abs_finite_rev : forall (x:t), (t'isFinite (abs x)) -> ((t'isFinite
x) /\ ((t'real (abs x)) = (Reals.Rbasic_fun.Rabs (t'real x)))).
Lemma abs_finite_rev :
forall (x:t),
(t'isFinite (abs x)) ->
((t'isFinite x) /\ ((t'real (abs x)) = (Reals.Rbasic_fun.Rabs (t'real x)))).
Proof.
apply abs_finite_rev.
Qed.
......@@ -807,9 +836,10 @@ Proof.
Qed.
(* Why3 goal *)
Lemma fma_finite_rev : forall (m:ieee_float.RoundingMode.mode) (x:t) (y:t)
(z:t), (t'isFinite (fma m x y z)) -> ((t'isFinite x) /\ ((t'isFinite y) /\
(t'isFinite z))).
Lemma fma_finite_rev :
forall (m:ieee_float.RoundingMode.mode) (x:t) (y:t) (z:t),
(t'isFinite (fma m x y z)) ->
((t'isFinite x) /\ ((t'isFinite y) /\ (t'isFinite z))).
Proof.
apply fma_finite_rev.
Qed.
......@@ -844,8 +874,8 @@ Proof.
Qed.
(* Why3 assumption *)
Definition same_sign_real (x:t) (r:R): Prop := ((is_positive x) /\
(0%R < r)%R) \/ ((is_negative x) /\ (r < 0%R)%R).
Definition same_sign_real (x:t) (r:R) : Prop :=
((is_positive x) /\ (0%R < r)%R) \/ ((is_negative x) /\ (r < 0%R)%R).
(* Why3 goal *)
Lemma add_special : forall (m:ieee_float.RoundingMode.mode) (x:t) (y:t),
......@@ -922,17 +952,21 @@ Proof.
Qed.
(* Why3 goal *)
Lemma neg_special : forall (x:t), ((is_nan x) -> (is_nan (neg x))) /\
(((is_infinite x) -> (is_infinite (neg x))) /\ ((~ (is_nan x)) ->
(diff_sign x (neg x)))).
Lemma neg_special :
forall (x:t),
((is_nan x) -> (is_nan (neg x))) /\
(((is_infinite x) -> (is_infinite (neg x))) /\
((~ (is_nan x)) -> (diff_sign x (neg x)))).
Proof.
apply neg_special.
Qed.
(* Why3 goal *)
Lemma abs_special : forall (x:t), ((is_nan x) -> (is_nan (abs x))) /\
(((is_infinite x) -> (is_infinite (abs x))) /\ ((~ (is_nan x)) ->
(is_positive (abs x)))).
Lemma abs_special :
forall (x:t),
((is_nan x) -> (is_nan (abs x))) /\
(((is_infinite x) -> (is_infinite (abs x))) /\
((~ (is_nan x)) -> (is_positive (abs x)))).
Proof.
apply abs_special.
Qed.
......@@ -1050,7 +1084,8 @@ Proof.
Qed.
(* Why3 goal *)
Lemma of_int_is_int : forall (m:ieee_float.RoundingMode.mode) (x:Z),
Lemma of_int_is_int :
forall (m:ieee_float.RoundingMode.mode) (x:Z),
(in_int_range x) -> (is_int (of_int m x)).
Proof.
intros m x h1.
......@@ -1058,15 +1093,18 @@ Proof.
Qed.
(* Why3 goal *)
Lemma big_float_is_int : forall (m:ieee_float.RoundingMode.mode) (i:t),
(t'isFinite i) -> (((le i (neg (of_int m 16777216%Z))) \/ (le (of_int m
16777216%Z) i)) -> (is_int i)).
Lemma big_float_is_int :
forall (m:ieee_float.RoundingMode.mode) (i:t),
(t'isFinite i) ->
(((le i (neg (of_int m 16777216%Z))) \/ (le (of_int m 16777216%Z) i)) ->
(is_int i)).
Proof.
now apply big_float_is_int.
Qed.
(* Why3 goal *)
Lemma roundToIntegral_is_int : forall (m:ieee_float.RoundingMode.mode) (x:t),
Lemma roundToIntegral_is_int :
forall (m:ieee_float.RoundingMode.mode) (x:t),
(t'isFinite x) -> (is_int (roundToIntegral m x)).
Proof.
now apply roundToIntegral_is_int.
......
......@@ -301,7 +301,9 @@ Proof.
Defined.
(* Why3 goal *)
Lemma max_real_int : ((9007199254740991 * 19958403095347198116563727130368385660674512604354575415025472424372118918689640657849579654926357010893424468441924952439724379883935936607391717982848314203200056729510856765175377214443629871826533567445439239933308104551208703888888552684480441575071209068757560416423584952303440099278848)%R = (BuiltIn.IZR max_int)).