Skip to content

Commit 43320aa

Browse files
committed
Update to Flocq 4.2.2
1 parent e119538 commit 43320aa

7 files changed

Lines changed: 26 additions & 26 deletions

File tree

flocq/Calc/Bracket.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ Theorem inbetween_float_new_location :
626626
forall x m e l k,
627627
(0 < k)%Z ->
628628
inbetween_float m e x l ->
629-
inbetween_float (Z.div m (Zpower beta k)) (e + k) x (new_location (Zpower beta k) (Zmod m (Zpower beta k)) l).
629+
inbetween_float (Z.div m (Zpower beta k)) (e + k) x (new_location (Zpower beta k) (Z.modulo m (Zpower beta k)) l).
630630
Proof.
631631
intros x m e l k Hk Hx.
632632
unfold inbetween_float in *.
@@ -657,7 +657,7 @@ Qed.
657657
Theorem inbetween_float_new_location_single :
658658
forall x m e l,
659659
inbetween_float m e x l ->
660-
inbetween_float (Z.div m beta) (e + 1) x (new_location beta (Zmod m beta) l).
660+
inbetween_float (Z.div m beta) (e + 1) x (new_location beta (Z.modulo m beta) l).
661661
Proof.
662662
intros x m e l Hx.
663663
replace (radix_val beta) with (Zpower beta 1).

flocq/Calc/Round.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ Qed.
609609
Definition truncate_aux t k :=
610610
let '(m, e, l) := t in
611611
let p := Zpower beta k in
612-
(Z.div m p, (e + k)%Z, new_location p (Zmod m p) l).
612+
(Z.div m p, (e + k)%Z, new_location p (Z.modulo m p) l).
613613

614614
Theorem truncate_aux_comp :
615615
forall t k1 k2,
@@ -1143,7 +1143,7 @@ Definition truncate_FIX t :=
11431143
let k := (emin - e)%Z in
11441144
if Zlt_bool 0 k then
11451145
let p := Zpower beta k in
1146-
(Z.div m p, (e + k)%Z, new_location p (Zmod m p) l)
1146+
(Z.div m p, (e + k)%Z, new_location p (Z.modulo m p) l)
11471147
else t.
11481148

11491149
Theorem truncate_FIX_correct :

flocq/Core/Zaux.v

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ Section Div_Mod.
324324

325325
Theorem Zmod_mod_mult :
326326
forall n a b, (0 < a)%Z -> (0 <= b)%Z ->
327-
Zmod (Zmod n (a * b)) b = Zmod n b.
327+
Z.modulo (Z.modulo n (a * b)) b = Z.modulo n b.
328328
Proof.
329329
intros n a b Ha Hb. destruct (Zle_lt_or_eq _ _ Hb) as [H'b|H'b].
330330
- rewrite (Z.mul_comm a b), Z.rem_mul_r, Z.add_mod, Z.mul_mod, Z.mod_same,
@@ -358,13 +358,13 @@ Qed.
358358

359359
Theorem Zdiv_mod_mult :
360360
forall n a b, (0 <= a)%Z -> (0 <= b)%Z ->
361-
(Z.div (Zmod n (a * b)) a) = Zmod (Z.div n a) b.
361+
(Z.div (Z.modulo n (a * b)) a) = Z.modulo (Z.div n a) b.
362362
Proof.
363363
intros n a b Ha Hb.
364364
destruct (Zle_lt_or_eq _ _ Ha) as [Ha'|<-].
365365
- destruct (Zle_lt_or_eq _ _ Hb) as [Hb'|<-].
366366
+ rewrite Z.rem_mul_r, Z.add_comm, Z.mul_comm, Z.div_add_l by lia.
367-
rewrite (Zdiv_small (Zmod n a)).
367+
rewrite (Zdiv_small (Z.modulo n a)).
368368
apply Z.add_0_r.
369369
now apply Z.mod_pos_bound.
370370
+ now rewrite Z.mul_0_r, !Zmod_0_r, ?Zdiv_0_l.
@@ -852,10 +852,10 @@ Section faster_div.
852852

853853
Lemma Zdiv_eucl_unique :
854854
forall a b,
855-
Z.div_eucl a b = (Z.div a b, Zmod a b).
855+
Z.div_eucl a b = (Z.div a b, Z.modulo a b).
856856
Proof.
857857
intros a b.
858-
unfold Z.div, Zmod.
858+
unfold Z.div, Z.modulo.
859859
now case Z.div_eucl.
860860
Qed.
861861

flocq/IEEE754/Bits.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Qed.
7777
Definition split_bits x :=
7878
let mm := Zpower 2 mw in
7979
let em := Zpower 2 ew in
80-
(Zle_bool (mm * em) x, Zmod x mm, Zmod (Z.div x mm) em)%Z.
80+
(Zle_bool (mm * em) x, Z.modulo x mm, Z.modulo (Z.div x mm) em)%Z.
8181

8282
Theorem split_join_bits :
8383
forall s m e,

flocq/Prop/Double_rounding.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ assert (Hx2 : x - round beta fexp1 Zfloor x
9191
set (x'' := round beta fexp2 (Znearest choice2) x).
9292
assert (Hr1 : Rabs (x'' - x) <= / 2 * bpow (fexp2 (mag x))).
9393
apply Rle_trans with (/ 2 * ulp beta fexp2 x).
94-
now unfold x''; apply error_le_half_ulp...
94+
now unfold x''; apply error_le_half_ulp.
9595
rewrite ulp_neq_0;[now right|now apply Rgt_not_eq].
9696
assert (Pxx' : 0 <= x - x').
9797
{ apply Rle_0_minus.
@@ -189,7 +189,7 @@ assert (Pxx' : 0 <= x - x').
189189
apply round_DN_pt.
190190
exact Vfexp1. }
191191
assert (x < bpow (mag x) - / 2 * bpow (fexp2 (mag x)));
192-
[|apply round_round_lt_mid_further_place'; try assumption]...
192+
[|apply round_round_lt_mid_further_place'; try assumption].
193193
2: rewrite ulp_neq_0;[assumption|now apply Rgt_not_eq].
194194
destruct (Req_dec x' 0) as [Zx'|Nzx'].
195195
- (* x' = 0 *)
@@ -348,7 +348,7 @@ set (x'' := round beta fexp2 (Znearest choice2) x).
348348
intros Hx1 Hx2.
349349
assert (Hr1 : Rabs (x'' - x) <= / 2 * bpow (fexp2 (mag x))).
350350
apply Rle_trans with (/2* ulp beta fexp2 x).
351-
now unfold x''; apply error_le_half_ulp...
351+
now unfold x''; apply error_le_half_ulp.
352352
rewrite ulp_neq_0;[now right|now apply Rgt_not_eq].
353353
assert (Px'x : 0 <= x' - x).
354354
{ apply Rle_0_minus.

flocq/Prop/Round_odd.v

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,11 @@ apply trans_eq with (negb (Z.even (Fnum ff))).
443443
rewrite K3; easy.
444444
apply sym_eq.
445445
generalize (DN_UP_parity_generic beta fexp).
446-
unfold DN_UP_parity_prop; intros T; apply (T x); clear T; try assumption...
447-
rewrite <- K1; apply Rnd_DN_pt_unique with (generic_format beta fexp) x; try easy...
448-
now apply round_DN_pt...
449-
rewrite <- L1; apply Rnd_UP_pt_unique with (generic_format beta fexp) x; try easy...
450-
now apply round_UP_pt...
446+
unfold DN_UP_parity_prop; intros T; apply (T x); clear T; try assumption.
447+
rewrite <- K1; apply Rnd_DN_pt_unique with (generic_format beta fexp) x; try easy.
448+
now apply round_DN_pt.
449+
rewrite <- L1; apply Rnd_UP_pt_unique with (generic_format beta fexp) x; try easy.
450+
now apply round_UP_pt.
451451
(* *)
452452
destruct H1' as (ff,(K1,(K2,K3))).
453453
destruct H2' as (gg,(L1,(L2,L3))).
@@ -457,11 +457,11 @@ apply trans_eq with (negb (Z.even (Fnum gg))).
457457
rewrite L3; easy.
458458
apply sym_eq.
459459
generalize (DN_UP_parity_generic beta fexp).
460-
unfold DN_UP_parity_prop; intros T; apply (T x); clear T; try assumption...
461-
rewrite <- L1; apply Rnd_DN_pt_unique with (generic_format beta fexp) x; try easy...
462-
now apply round_DN_pt...
463-
rewrite <- K1; apply Rnd_UP_pt_unique with (generic_format beta fexp) x; try easy...
464-
now apply round_UP_pt...
460+
unfold DN_UP_parity_prop; intros T; apply (T x); clear T; try assumption.
461+
rewrite <- L1; apply Rnd_DN_pt_unique with (generic_format beta fexp) x; try easy.
462+
now apply round_DN_pt.
463+
rewrite <- K1; apply Rnd_UP_pt_unique with (generic_format beta fexp) x; try easy.
464+
now apply round_UP_pt.
465465
apply Rnd_UP_pt_unique with format x; assumption.
466466
Qed.
467467

flocq/Version.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ COPYING file for more details.
1818
*)
1919

2020
(** Helper for detecting the version of Flocq *)
21-
Require Import BinNat.
22-
Require Import Ascii String.
21+
From Coq Require Import BinNat.
22+
From Coq Require Import Ascii String.
2323

2424
Definition Flocq_version := Eval vm_compute in
2525
let fix parse s major minor :=
@@ -29,4 +29,4 @@ Definition Flocq_version := Eval vm_compute in
2929
parse t major (minor * 10 + N_of_ascii h - N_of_ascii "0"%char)%N
3030
| EmptyString => (major * 100 + minor)%N
3131
end in
32-
parse "4.2.1"%string N0 N0.
32+
parse "4.2.2"%string N0 N0.

0 commit comments

Comments
 (0)