Skip to content

Commit c27a80b

Browse files
authored
Merge pull request #170 from coq-community/Fix818Warnings
remove a bunch of deprecate warnings
2 parents 45e65f5 + e8b4ad8 commit c27a80b

File tree

23 files changed

+117
-114
lines changed

23 files changed

+117
-114
lines changed

.github/workflows/docker-action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
image:
18+
- 'mathcomp/mathcomp:1.18.0-coq-8.18'
1819
- 'mathcomp/mathcomp:1.17.0-coq-8.17'
1920
- 'mathcomp/mathcomp:1.15.0-coq-8.16'
2021
- 'mathcomp/mathcomp:1.14.0-coq-8.15'

coq-addition-chains.opam

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ build: ["dune" "build" "-p" name "-j" jobs]
1818
depends: [
1919
"dune" {>= "2.5"}
2020
"coq" {>= "8.14"}
21-
"coq-paramcoq" {(>= "1.1.3" & < "1.2~") | (= "dev")}
22-
"coq-mathcomp-ssreflect" {>= "1.13.0" & < "1.18"}
21+
"coq-paramcoq" {>= "1.1.3"}
22+
"coq-mathcomp-ssreflect" {>= "1.13.0" & < "1.19"}
2323
"coq-mathcomp-algebra"
2424
]
2525

coq-gaia-hydras.opam

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ depends: [
1818
"dune" {>= "2.5"}
1919
"coq" {>= "8.14"}
2020
"coq-hydra-battles" {= version}
21-
"coq-mathcomp-ssreflect" {>= "1.13.0" & < "1.18"}
21+
"coq-mathcomp-ssreflect" {>= "1.13.0" & < "1.19"}
2222
"coq-mathcomp-zify" {< "2"}
23-
"coq-gaia-schutte" {>= "1.14" & < "1.18~"}
23+
"coq-gaia-schutte" {>= "1.14" & < "1.18"}
2424
]
2525

2626
tags: [

coq-goedel.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ depends: [
1818
"dune" {>= "2.5"}
1919
"coq" {>= "8.14"}
2020
"coq-hydra-battles" {= version}
21-
"coq-coqprime" {= "dev"}
21+
"coq-coqprime" {>= "1.3.0"}
2222
]
2323

2424
tags: [

coq-hydra-battles.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ build: ["dune" "build" "-p" name "-j" jobs]
1919
depends: [
2020
"dune" {>= "2.5"}
2121
"coq" {>= "8.14"}
22-
"coq-equations" {(>= "1.2" & < "1.4~") | (= "dev")}
22+
"coq-equations" {>= "1.2"}
2323
"coq-zorns-lemma" {>= "10.2.0"}
2424
"coq-libhyps"
2525
]

meta.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ supported_coq_versions:
120120
opam: '{>= "8.14"}'
121121

122122
tested_coq_opam_versions:
123+
- version: '1.18.0-coq-8.18'
124+
repo: 'mathcomp/mathcomp'
123125
- version: '1.17.0-coq-8.17'
124126
repo: 'mathcomp/mathcomp'
125127
- version: '1.15.0-coq-8.16'
@@ -132,28 +134,28 @@ tested_coq_opam_versions:
132134
dependencies:
133135
- opam:
134136
name: coq-equations
135-
version: '{(>= "1.2" & < "1.4~") | (= "dev")}'
137+
version: '{>= "1.2"}'
136138
description: |-
137139
[Equations](https://github.com/mattam82/Coq-Equations) 1.2 or later
138140
- opam:
139141
name: coq-paramcoq
140-
version: '{(>= "1.1.3" & < "1.2~") | (= "dev")}'
142+
version: '{>= "1.1.3"}'
141143
description: |-
142144
[Paramcoq](https://github.com/coq-community/paramcoq) 1.1.3 or later
143145
- opam:
144146
name: coq-mathcomp-ssreflect
145-
version: '{(>= "1.13.0" & < "1.18~")}'
147+
version: '{>= "1.13.0" & < "1.19"}'
146148
description: |-
147-
[MathComp SSReflect](https://github.com/math-comp/math-comp) 1.13 or later
149+
[MathComp SSReflect](https://github.com/math-comp/math-comp) 1.13 to 1.18
148150
- opam:
149151
name: coq-mathcomp-algebra
150152
description: |-
151153
[MathComp Algebra](https://github.com/math-comp/math-comp)
152154
- opam:
153155
name: coq-gaia-schutte
154-
version: '{(>= "1.14" & < "1.18~") | (= "dev")}'
156+
version: '{>= "1.14" & < "1.18"}'
155157
description: |-
156-
[Gaia's Schütte ordinals](https://github.com/coq-community/gaia) 1.14 or later
158+
[Gaia's Schütte ordinals](https://github.com/coq-community/gaia) 1.14 to 1.17
157159
- opam:
158160
name: coq-mathcomp-zify
159161
version: '{< "2~"}'
@@ -165,7 +167,7 @@ dependencies:
165167
[LibHyps](https://github.com/Matafou/LibHyps)
166168
- opam:
167169
name: coq-coqprime
168-
version: '{= "dev"}'
170+
version: '{>= "1.3.0"}'
169171
description: |-
170172
[CoqPrime](https://github.com/thery/coqprime)
171173
- opam:

theories/additions/AM.v

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,9 @@ Function chain_gen (s:signature) {measure signature_measure}
552552
| (q, 0%N) =>
553553
(chain_gen (gen_F (gamma i))) ++
554554
(chain_gen (gen_F (N2pos q)))
555-
| (q,r) => KFF (chain_gen
556-
(gen_K (N2pos r)
557-
(gamma i - N2pos r)))
555+
| (q,_r) => KFF (chain_gen
556+
(gen_K (N2pos _r)
557+
(gamma i - N2pos _r)))
558558
(chain_gen (gen_F (N2pos q)))
559559

560560
end
@@ -565,8 +565,8 @@ Function chain_gen (s:signature) {measure signature_measure}
565565
match N.pos_div_eucl (p + d) (Npos p) with
566566
| (q, 0%N) => FFK (chain_gen (gen_F p))
567567
(chain_gen (gen_F (N2pos q)))
568-
| (q,r) => KFK (chain_gen (gen_K (N2pos r)
569-
(p - N2pos r)))
568+
| (q, _r) => KFK (chain_gen (gen_K (N2pos _r)
569+
(p - N2pos _r)))
570570
(chain_gen (gen_F (N2pos q)))
571571
end
572572
end.
@@ -601,20 +601,20 @@ Proof.
601601
+ apply IHc.
602602
+ apply IHc0.
603603
- cbn; pattern i at 1;
604-
replace i with (gamma i * (N2pos q) + N2pos r).
604+
replace i with (gamma i * (N2pos q) + N2pos _r).
605605
+ cbn in *.
606606
* apply KFF_correct;auto.
607607
replace (gamma i) with
608-
(N2pos r + (gamma i - N2pos r)) at 1.
608+
(N2pos _r + (gamma i - N2pos _r)) at 1.
609609
-- apply IHc.
610610
-- rewrite Pplus_minus;auto with chains.
611611
apply Pos.lt_gt; rewrite N2pos_lt_switch2.
612612
generalize
613613
(N.pos_div_eucl_remainder i (N.pos (gamma i) ));
614614
rewrite e3; simpl;auto with chains.
615-
destruct r; [ contradiction | auto with chains].
615+
destruct _r; [ contradiction | auto with chains].
616616
+ apply N_pos_div_eucl_rest; auto with chains.
617-
destruct r;try contradiction; auto with chains.
617+
destruct _r;try contradiction; auto with chains.
618618
apply (div_gamma_pos _ _ _ e3); auto with chains.
619619
apply pos_gt_3;auto with chains.
620620
destruct (exact_log2 i); [contradiction | reflexivity].
@@ -630,15 +630,15 @@ Proof.
630630
N2pos_destruct q q.
631631
injection H4;auto with chains.
632632
rewrite Pos.mul_comm; auto with chains.
633-
- cbn; red; replace (p+d) with (p * N2pos q + N2pos r).
633+
- cbn; red; replace (p+d) with (p * N2pos q + N2pos _r).
634634
+ apply KFK_correct;auto with chains.
635-
cbn in *; replace (N2pos r + (p - N2pos r))%positive with p in IHc.
635+
cbn in *; replace (N2pos _r + (p - N2pos _r))%positive with p in IHc.
636636
apply IHc.
637637
rewrite Pplus_minus; auto.
638638
generalize (N.pos_div_eucl_remainder (p + d) (N.pos p));
639639
rewrite e1; cbn; intro H3.
640640
apply Pos.lt_gt; rewrite N2pos_lt_switch2;auto with chains.
641-
destruct r; [contradiction | auto with chains].
641+
destruct _r; [contradiction | auto with chains].
642642

643643
+ generalize (N.pos_div_eucl_spec (p + d) (N.pos p)).
644644
rewrite e1; intros H3.
@@ -647,7 +647,7 @@ Proof.
647647
destruct 1;auto with chains.
648648
rewrite pos2N_inj_add; apply N.le_add_r.
649649
}
650-
{ intros p0 Hp0;subst q; cbn; destruct r; [ contradiction | ].
650+
{ intros p0 Hp0;subst q; cbn; destruct _r; [ contradiction | ].
651651
simpl; simpl in H3; injection H3.
652652
rewrite Pos.mul_comm; auto with chains.
653653
}
@@ -702,3 +702,4 @@ Time Compute chain_apply F197887 NPlus 1%N.
702702

703703
Time Compute chain_apply F197887 NPlus 1%N.
704704

705+

theories/additions/Demo_power.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Open Scope M_scope.
44

55
Compute 22%Z ^ 20.
66

7-
Import Int31.
7+
Import Uint63.
8+
Search (Z -> int).
9+
Coercion of_Z : Z >-> int.
810

9-
Coercion phi_inv : Z >-> int31.
10-
11-
Compute 22%int31 ^ 20.
11+
Compute 22%int63 ^ 50.
1212

1313
(* end snippet DemoPower *)
1414

theories/additions/Dichotomy.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Proof.
171171
intros p H; unfold dicho; generalize (dicho_aux_lt p H).
172172
intro H0; assert (2 <= N.pos p / (N.pos (dicho_aux p)) )%N.
173173
- replace 2%N with (2%N * Npos (dicho_aux p) / Npos (dicho_aux p))%N.
174-
+ apply (* N.Div0.div_le_mono. *) N.div_le_mono; try discriminate.
174+
+ apply N.div_le_mono; try discriminate.
175175
* replace 2%N with (Npos 2%positive); cbn;auto.
176176
+ rewrite N.div_mul; [auto | discriminate].
177177
- case_eq (N.pos p / N.pos (dicho_aux p))%N.

theories/additions/Euclidean_Chains.v

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ Compute the_exponent (F2C F9).
162162

163163

164164

165+
165166
(** A first attempt to define Fchain correctness *)
166167

167168
(* begin snippet BadDefa *)
@@ -1369,9 +1370,9 @@ Function chain_gen (s:signature) {measure signature_measure}
13691370
| (q, 0%N) =>
13701371
Fcompose (chain_gen (gen_F (gamma i)))
13711372
(chain_gen (gen_F (N2pos q)))
1372-
| (q,r) => KFF (chain_gen
1373-
(gen_K (N2pos r)
1374-
(gamma i - N2pos r)))
1373+
| (q,_r) => KFF (chain_gen
1374+
(gen_K (N2pos _r)
1375+
(gamma i - N2pos _r)))
13751376
(chain_gen (gen_F (N2pos q)))
13761377
end end
13771378
| gen_K p d =>
@@ -1380,8 +1381,8 @@ Function chain_gen (s:signature) {measure signature_measure}
13801381
match N.pos_div_eucl (p + d) (Npos p) with
13811382
| (q, 0%N) => FFK (chain_gen (gen_F p))
13821383
(chain_gen (gen_F (N2pos q)))
1383-
| (q,r) => KFK (chain_gen (gen_K (N2pos r)
1384-
(p - N2pos r)))
1384+
| (q, _r) => KFK (chain_gen (gen_K (N2pos _r)
1385+
(p - N2pos _r)))
13851386
(chain_gen (gen_F (N2pos q)))
13861387
end
13871388
end.
@@ -1426,23 +1427,23 @@ Proof.
14261427

14271428

14281429
- pattern i at 1;
1429-
replace i with (gamma i * (N2pos q) + N2pos r).
1430+
replace i with (gamma i * (N2pos q) + N2pos _r).
14301431
+ destruct IHc, IHc0;split.
14311432
* apply KFF_correct;auto.
14321433
simpl; simpl in H.
14331434
replace (gamma i) with
1434-
(N2pos r + (gamma i - N2pos r)) at 1.
1435+
(N2pos _r + (gamma i - N2pos _r)) at 1.
14351436
apply H.
14361437
rewrite Pplus_minus;auto with chains.
14371438
apply Pos.lt_gt; rewrite N2pos_lt_switch2.
14381439
generalize
14391440
(N.pos_div_eucl_remainder i (N.pos (gamma i) ));
14401441
rewrite e3; simpl;auto with chains.
1441-
destruct r; [ contradiction | auto with chains].
1442+
destruct _r; [ contradiction | auto with chains].
14421443
* apply KFF_proper;auto with chains.
14431444

14441445
+ apply N_pos_div_eucl_rest; auto with chains.
1445-
destruct r;try contradiction; auto with chains.
1446+
destruct _r;try contradiction; auto with chains.
14461447
apply (div_gamma_pos _ _ _ e3); auto with chains.
14471448
apply pos_gt_3;auto with chains.
14481449
destruct (exact_log2 i); [contradiction | reflexivity].
@@ -1468,15 +1469,15 @@ Proof.
14681469
+ apply FFK_proper;auto with chains.
14691470

14701471
- destruct IHc, IHc0; split.
1471-
+ red; replace (p+d) with (p * N2pos q + N2pos r).
1472+
+ red; replace (p+d) with (p * N2pos q + N2pos _r).
14721473
* apply KFK_correct;auto with chains.
1473-
red in H; replace (N2pos r + (p - N2pos r))%positive with p in H.
1474+
red in H; replace (N2pos _r + (p - N2pos _r))%positive with p in H.
14741475
apply H.
14751476
rewrite Pplus_minus; auto.
14761477
generalize (N.pos_div_eucl_remainder (p + d) (N.pos p));
14771478
rewrite e1; cbn; intro H3.
14781479
apply Pos.lt_gt; rewrite N2pos_lt_switch2;auto with chains.
1479-
destruct r; [contradiction | auto with chains].
1480+
destruct _r; [contradiction | auto with chains].
14801481

14811482
* generalize (N.pos_div_eucl_spec (p + d) (N.pos p));
14821483
rewrite e1; intros H3; clear H H0 H1 H2.
@@ -1486,7 +1487,7 @@ Proof.
14861487
rewrite pos2N_inj_add; apply N.le_add_r.
14871488
}
14881489
{
1489-
intros p0 Hp0;subst q; cbn; destruct r; [ contradiction | ].
1490+
intros p0 Hp0;subst q; cbn; destruct _r; [ contradiction | ].
14901491
simpl; simpl in H3; injection H3.
14911492
rewrite Pos.mul_comm; auto with chains.
14921493
}
@@ -1508,23 +1509,26 @@ Arguments make_chain gamma {_} _ _ _ .
15081509
Compute the_exponent (make_chain dicho 87).
15091510
(* end snippet C87Dicho *)
15101511

1511-
(** cf Coq workshop 2014 by Jason Grosss *)
15121512

1513-
Module Examples.
1513+
Require Import Int63.Uint63.
1514+
Require Import Monoid_instances.
15141515

1515-
Import Int31.
1516+
Check cpower (make_chain dicho) 10.
1517+
Module Examples.
15161518
Compute cpower (make_chain dicho) 10 12.
15171519
Compute cpower (make_chain dicho) 87 12.
1520+
Search (int -> Z).
1521+
Search (positive -> int).
1522+
15181523

1519-
Definition fast_int31_power (x :positive)(n:N) : Z :=
1520-
Int31.phi (cpower (make_chain dicho) n (snd (positive_to_int31 x))).
1524+
Definition fast_int63_power (x :positive)(n:N) : Z :=
1525+
to_Z (cpower (make_chain dicho) n (of_pos x)).
15211526

15221527
Definition slow_int31_power (x :positive)(n:N) : Z :=
1523-
Int31.phi (power (snd (positive_to_int31 x)) (N.to_nat n) ).
1528+
to_Z (power (of_pos x) (N.to_nat n) ).
15241529

15251530
Definition binary_int31_power (x :positive)(n:N) : Z :=
1526-
Int31.phi (N_bpow (snd (positive_to_int31 x)) n ).
1527-
1531+
to_Z (N_bpow (of_pos x) n).
15281532

15291533
(** long computations ... *)
15301534

@@ -1537,7 +1541,7 @@ Arguments big_chain _%type_scope.
15371541
Remark RM : (1 < 56789)%N.
15381542
Proof. reflexivity. Qed.
15391543

1540-
Definition M := Nmod_Monoid _ RM.
1544+
Definition M := Nmod_Monoid 56789%N RM.
15411545

15421546
Definition exp56789 x := chain_apply big_chain (M:=M) x.
15431547

@@ -1550,12 +1554,6 @@ Eval cbv iota match delta [big_chain chain_apply computation_eval ] zeta beta
15501554
Definition C87' := ltac:( compute_chain C87 ).
15511555

15521556

1553-
Time Compute Int31.phi
1554-
(chain_apply big_chain (snd (positive_to_int31 67777))) .
1555-
1556-
1557-
Compute Int31.phi (chain_apply big_chain (snd (positive_to_int31 67777))) .
1558-
15591557
Compute chain_length big_chain.
15601558

15611559
Goal parametric (make_chain dicho 45319).

0 commit comments

Comments
 (0)