Commit 14972b6d authored by Guillaume Melquiond's avatar Guillaume Melquiond

Update parts of Coq realizations whose printing looks sane.

parent 070cdf54
......@@ -1754,8 +1754,8 @@ Defined.
(* Why3 goal *)
Lemma eq_sub_bv_def :
forall (a:t) (b:t) (i:t) (n:t),
let mask := (lsl_bv (sub (lsl_bv one n) one) i) in
((eq_sub_bv a b i n) <-> ((bw_and b mask) = (bw_and a mask))).
let mask := lsl_bv (sub (lsl_bv one n) one) i in
(eq_sub_bv a b i n) <-> ((bw_and b mask) = (bw_and a mask)).
rewrite Of_int_one.
easy.
Qed.
......
......@@ -61,7 +61,7 @@ Lemma Bounded_real_no_overflow :
forall (m:floating_point.Rounding.mode) (x:R),
((Reals.Rbasic_fun.Rabs x) <=
(9007199254740991 * 19958403095347198116563727130368385660674512604354575415025472424372118918689640657849579654926357010893424468441924952439724379883935936607391717982848314203200056729510856765175377214443629871826533567445439239933308104551208703888888552684480441575071209068757560416423584952303440099278848)%R)%R ->
(no_overflow m x).
no_overflow m x.
exact (Bounded_real_no_overflow 53 1024 (refl_equal true) (refl_equal true)).
Qed.
......
......@@ -65,7 +65,7 @@ Qed.
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).
(33554430 * 10141204801825835211973625643008)%R)%R -> no_overflow m x.
intros m x Hx.
unfold no_overflow.
rewrite max_single_eq in *.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -28,7 +28,7 @@ Definition permut {a:Type} {a_WT:WhyType a} (l1:(list a))
(* Why3 goal *)
Lemma Permut_refl :
forall {a:Type} {a_WT:WhyType a}, forall (l:(list a)), (permut l l).
forall {a:Type} {a_WT:WhyType a}, forall (l:(list a)), permut l l.
Proof.
now intros a a_WT l.
Qed.
......@@ -44,7 +44,7 @@ Qed.
Lemma Permut_trans :
forall {a:Type} {a_WT:WhyType a},
forall (l1:(list a)) (l2:(list a)) (l3:(list a)),
(permut l1 l2) -> (permut l2 l3) -> (permut l1 l3).
(permut l1 l2) -> (permut l2 l3) -> permut l1 l3.
Proof.
intros a a_WT l1 l2 l3 h1 h2 x.
now rewrite h1.
......@@ -108,7 +108,7 @@ Qed.
Lemma Permut_append_swap :
forall {a:Type} {a_WT:WhyType a},
forall (l1:(list a)) (l2:(list a)),
(permut (Init.Datatypes.app l1 l2) (Init.Datatypes.app l2 l1)).
permut (Init.Datatypes.app l1 l2) (Init.Datatypes.app l2 l1).
Proof.
intros a a_WT l1 l2 y.
rewrite 2!NumOcc.Append_Num_Occ.
......@@ -119,7 +119,7 @@ Qed.
Lemma Permut_mem :
forall {a:Type} {a_WT:WhyType a},
forall (x:a) (l1:(list a)) (l2:(list a)),
(permut l1 l2) -> (list.Mem.mem x l1) -> (list.Mem.mem x l2).
(permut l1 l2) -> (list.Mem.mem x l1) -> list.Mem.mem x l2.
Proof.
intros a a_WT x l1 l2 h1 h2.
apply NumOcc.Mem_Num_Occ.
......
......@@ -237,8 +237,7 @@ Definition range (a:(Z -> Z)) (n:Z) : Prop :=
(* Why3 goal *)
Lemma injective_surjective :
forall (a:(Z -> Z)) (n:Z),
(injective a n) -> (range a n) -> (surjective a n).
forall (a:(Z -> Z)) (n:Z), (injective a n) -> (range a n) -> surjective a n.
Proof.
unfold injective, range, surjective.
intros a n h1 h2.
......
......@@ -39,7 +39,7 @@ Qed.
Lemma prime_coprime :
forall (p:Z),
(number.Prime.prime p) <->
((2%Z <= p)%Z /\ forall (n:Z), ((1%Z <= n)%Z /\ (n < p)%Z) -> (coprime n p)).
((2%Z <= p)%Z /\ forall (n:Z), ((1%Z <= n)%Z /\ (n < p)%Z) -> coprime n p).
intros p.
(*
Znumtheory.prime_intro:
......@@ -66,7 +66,7 @@ Qed.
Lemma Gauss :
forall (a:Z) (b:Z) (c:Z),
((number.Divisibility.divides a (b * c)%Z) /\ (coprime a b)) ->
(number.Divisibility.divides a c).
number.Divisibility.divides a c.
intros a b c (h1,h2).
apply Znumtheory.Gauss with b; auto.
rewrite <- coprime_is_Zrel_prime; auto.
......
......@@ -40,59 +40,59 @@ easy.
Qed.
(* Why3 goal *)
Lemma divides_refl : forall (n:Z), (divides n n).
Lemma divides_refl : forall (n:Z), divides n n.
Proof.
exact Zdivide_refl.
Qed.
(* Why3 goal *)
Lemma divides_1_n : forall (n:Z), (divides 1%Z n).
Lemma divides_1_n : forall (n:Z), divides 1%Z n.
Proof.
exact Zone_divide.
Qed.
(* Why3 goal *)
Lemma divides_0 : forall (n:Z), (divides n 0%Z).
Lemma divides_0 : forall (n:Z), divides n 0%Z.
Proof.
exact Zdivide_0.
Qed.
(* Why3 goal *)
Lemma divides_left :
forall (a:Z) (b:Z) (c:Z), (divides a b) -> (divides (c * a)%Z (c * b)%Z).
forall (a:Z) (b:Z) (c:Z), (divides a b) -> divides (c * a)%Z (c * b)%Z.
Proof.
exact Zmult_divide_compat_l.
Qed.
(* Why3 goal *)
Lemma divides_right :
forall (a:Z) (b:Z) (c:Z), (divides a b) -> (divides (a * c)%Z (b * c)%Z).
forall (a:Z) (b:Z) (c:Z), (divides a b) -> divides (a * c)%Z (b * c)%Z.
Proof.
exact Zmult_divide_compat_r.
Qed.
(* Why3 goal *)
Lemma divides_oppr : forall (a:Z) (b:Z), (divides a b) -> (divides a (-b)%Z).
Lemma divides_oppr : forall (a:Z) (b:Z), (divides a b) -> divides a (-b)%Z.
Proof.
exact Zdivide_opp_r.
Qed.
(* Why3 goal *)
Lemma divides_oppl : forall (a:Z) (b:Z), (divides a b) -> (divides (-a)%Z b).
Lemma divides_oppl : forall (a:Z) (b:Z), (divides a b) -> divides (-a)%Z b.
Proof.
exact Zdivide_opp_l.
Qed.
(* Why3 goal *)
Lemma divides_oppr_rev :
forall (a:Z) (b:Z), (divides (-a)%Z b) -> (divides a b).
forall (a:Z) (b:Z), (divides (-a)%Z b) -> divides a b.
Proof.
exact Zdivide_opp_l_rev.
Qed.
(* Why3 goal *)
Lemma divides_oppl_rev :
forall (a:Z) (b:Z), (divides a (-b)%Z) -> (divides a b).
forall (a:Z) (b:Z), (divides a (-b)%Z) -> divides a b.
Proof.
exact Zdivide_opp_r_rev.
Qed.
......@@ -100,7 +100,7 @@ Qed.
(* Why3 goal *)
Lemma divides_plusr :
forall (a:Z) (b:Z) (c:Z),
(divides a b) -> (divides a c) -> (divides a (b + c)%Z).
(divides a b) -> (divides a c) -> divides a (b + c)%Z.
Proof.
exact Zdivide_plus_r.
Qed.
......@@ -108,14 +108,14 @@ Qed.
(* Why3 goal *)
Lemma divides_minusr :
forall (a:Z) (b:Z) (c:Z),
(divides a b) -> (divides a c) -> (divides a (b - c)%Z).
(divides a b) -> (divides a c) -> divides a (b - c)%Z.
Proof.
exact Zdivide_minus_l.
Qed.
(* Why3 goal *)
Lemma divides_multl :
forall (a:Z) (b:Z) (c:Z), (divides a b) -> (divides a (c * b)%Z).
forall (a:Z) (b:Z) (c:Z), (divides a b) -> divides a (c * b)%Z.
Proof.
intros a b c.
apply Zdivide_mult_r.
......@@ -123,19 +123,19 @@ Qed.
(* Why3 goal *)
Lemma divides_multr :
forall (a:Z) (b:Z) (c:Z), (divides a b) -> (divides a (b * c)%Z).
forall (a:Z) (b:Z) (c:Z), (divides a b) -> divides a (b * c)%Z.
Proof.
exact Zdivide_mult_l.
Qed.
(* Why3 goal *)
Lemma divides_factorl : forall (a:Z) (b:Z), (divides a (b * a)%Z).
Lemma divides_factorl : forall (a:Z) (b:Z), divides a (b * a)%Z.
Proof.
exact Zdivide_factor_l.
Qed.
(* Why3 goal *)
Lemma divides_factorr : forall (a:Z) (b:Z), (divides a (a * b)%Z).
Lemma divides_factorr : forall (a:Z) (b:Z), divides a (a * b)%Z.
Proof.
exact Zdivide_factor_r.
Qed.
......@@ -157,7 +157,7 @@ Qed.
(* Why3 goal *)
Lemma divides_trans :
forall (a:Z) (b:Z) (c:Z), (divides a b) -> (divides b c) -> (divides a c).
forall (a:Z) (b:Z) (c:Z), (divides a b) -> (divides b c) -> divides a c.
Proof.
exact Zdivide_trans.
Qed.
......@@ -174,7 +174,7 @@ Import EuclideanDivision.
(* Why3 goal *)
Lemma mod_divides_euclidean :
forall (a:Z) (b:Z),
~ (b = 0%Z) -> ((int.EuclideanDivision.mod1 a b) = 0%Z) -> (divides b a).
~ (b = 0%Z) -> ((int.EuclideanDivision.mod1 a b) = 0%Z) -> divides b a.
Proof.
intros a b Zb H.
exists (div a b).
......@@ -202,7 +202,7 @@ Qed.
(* Why3 goal *)
Lemma mod_divides_computer :
forall (a:Z) (b:Z),
~ (b = 0%Z) -> ((ZArith.BinInt.Z.rem a b) = 0%Z) -> (divides b a).
~ (b = 0%Z) -> ((ZArith.BinInt.Z.rem a b) = 0%Z) -> divides b a.
Proof.
intros a b Zb H.
exists (Z.quot a b).
......
......@@ -32,16 +32,14 @@ exact Zgcd_is_pos.
Qed.
(* Why3 goal *)
Lemma gcd_def1 :
forall (a:Z) (b:Z), (number.Divisibility.divides (gcd a b) a).
Lemma gcd_def1 : forall (a:Z) (b:Z), number.Divisibility.divides (gcd a b) a.
Proof.
intros a b.
apply Zgcd_is_gcd.
Qed.
(* Why3 goal *)
Lemma gcd_def2 :
forall (a:Z) (b:Z), (number.Divisibility.divides (gcd a b) b).
Lemma gcd_def2 : forall (a:Z) (b:Z), number.Divisibility.divides (gcd a b) b.
Proof.
intros a b.
apply Zgcd_is_gcd.
......@@ -52,7 +50,7 @@ Lemma gcd_def3 :
forall (a:Z) (b:Z) (x:Z),
(number.Divisibility.divides x a) ->
(number.Divisibility.divides x b) ->
(number.Divisibility.divides x (gcd a b)).
number.Divisibility.divides x (gcd a b).
Proof.
intros a b x.
apply Zgcd_is_gcd.
......
......@@ -72,7 +72,7 @@ now apply even_not_odd.
Qed.
(* Why3 goal *)
Lemma even_odd : forall (n:Z), (even n) -> (odd (n + 1%Z)%Z).
Lemma even_odd : forall (n:Z), (even n) -> odd (n + 1%Z)%Z.
Proof.
intros n H.
apply <- odd_is_Zodd.
......@@ -82,7 +82,7 @@ easy.
Qed.
(* Why3 goal *)
Lemma odd_even : forall (n:Z), (odd n) -> (even (n + 1%Z)%Z).
Lemma odd_even : forall (n:Z), (odd n) -> even (n + 1%Z)%Z.
Proof.
intros n H.
apply <- even_is_Zeven.
......@@ -92,7 +92,7 @@ easy.
Qed.
(* Why3 goal *)
Lemma even_even : forall (n:Z), (even n) -> (even (n + 2%Z)%Z).
Lemma even_even : forall (n:Z), (even n) -> even (n + 2%Z)%Z.
Proof.
intros n H.
apply <- even_is_Zeven.
......@@ -102,7 +102,7 @@ easy.
Qed.
(* Why3 goal *)
Lemma odd_odd : forall (n:Z), (odd n) -> (odd (n + 2%Z)%Z).
Lemma odd_odd : forall (n:Z), (odd n) -> odd (n + 2%Z)%Z.
Proof.
intros n H.
apply <- odd_is_Zodd.
......@@ -112,14 +112,14 @@ easy.
Qed.
(* Why3 goal *)
Lemma even_2k : forall (k:Z), (even (2%Z * k)%Z).
Lemma even_2k : forall (k:Z), even (2%Z * k)%Z.
Proof.
intros k.
now exists k.
Qed.
(* Why3 goal *)
Lemma odd_2k1 : forall (k:Z), (odd ((2%Z * k)%Z + 1%Z)%Z).
Lemma odd_2k1 : forall (k:Z), odd ((2%Z * k)%Z + 1%Z)%Z.
Proof.
intros k.
now exists k.
......
......@@ -44,14 +44,14 @@ now elim H1.
Qed.
(* Why3 goal *)
Lemma prime_2 : (prime 2%Z).
Lemma prime_2 : prime 2%Z.
Proof.
apply <- prime_is_Zprime.
apply prime_2.
Qed.
(* Why3 goal *)
Lemma prime_3 : (prime 3%Z).
Lemma prime_3 : prime 3%Z.
Proof.
apply <- prime_is_Zprime.
apply prime_3.
......@@ -183,7 +183,7 @@ Qed.
(* Why3 goal *)
Lemma odd_prime :
forall (p:Z), (prime p) -> (3%Z <= p)%Z -> (number.Parity.odd p).
forall (p:Z), (prime p) -> (3%Z <= p)%Z -> number.Parity.odd p.
Proof.
intros p Pp Hp.
apply <- Divisibility.odd_divides.
......
......@@ -72,7 +72,7 @@ Definition subset {a:Type} {a_WT:WhyType a} (s1:(a -> bool)) (s2:(a ->
(* Why3 goal *)
Lemma subset_refl :
forall {a:Type} {a_WT:WhyType a}, forall (s:(a -> bool)), (subset s s).
forall {a:Type} {a_WT:WhyType a}, forall (s:(a -> bool)), subset s s.
Proof.
now intros a a_WT s x.
Qed.
......@@ -81,7 +81,7 @@ Qed.
Lemma subset_trans :
forall {a:Type} {a_WT:WhyType a},
forall (s1:(a -> bool)) (s2:(a -> bool)) (s3:(a -> bool)),
(subset s1 s2) -> (subset s2 s3) -> (subset s1 s3).
(subset s1 s2) -> (subset s2 s3) -> subset s1 s3.
Proof.
intros a a_WT s1 s2 s3 h1 h2 x H.
now apply h2, h1.
......@@ -94,7 +94,7 @@ Definition is_empty {a:Type} {a_WT:WhyType a} (s:(a -> bool)) : Prop :=
(* Why3 goal *)
Lemma mem_empty :
forall {a:Type} {a_WT:WhyType a},
(is_empty (map.Const.const false: (a -> bool))).
is_empty (map.Const.const false: (a -> bool)).
Proof.
now intros a a_WT x.
Qed.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment