Skip to content

Commit a105855

Browse files
committed
remove warnings in Coq 8.8
1 parent b8f7334 commit a105855

File tree

10 files changed

+68
-66
lines changed

10 files changed

+68
-66
lines changed

examples/ConsiderDemo.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
Require NPeano.
22
Import NPeano.Nat.
33
Require Import ExtLib.Tactics.Consider.
4+
Require Import Coq.Bool.Bool.
5+
Require Import ExtLib.Data.Nat.
6+
7+
Require Import Coq.omega.Omega.
48

59
Set Implicit Arguments.
610
Set Strict Implicit.
711

812
(** Some tests *)
913
Section test.
10-
Require Import NPeano Coq.Bool.Bool.
11-
Require Import ExtLib.Data.Nat.
12-
13-
Require Import Omega.
1414
Goal forall x y z, (ltb x y && ltb y z) = true ->
1515
ltb x z = true.
1616
intros x y z.

theories/Core/RelDec.v

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Require Import Coq.Bool.Bool.
2+
Require Import Coq.Classes.RelationClasses.
23
Require Coq.Setoids.Setoid.
34

45
Set Implicit Arguments.
@@ -70,8 +71,6 @@ Section lemmas.
7071
exfalso. eapply (@rel_dec_correct _ _ _ rc) in Heqb. auto.
7172
Qed.
7273

73-
Require Import RelationClasses.
74-
7574
Theorem rel_dec_sym : Symmetric eqt -> forall x y,
7675
x ?[ eqt ] y = y ?[ eqt ] x.
7776
Proof.

theories/Data/Graph/BuildGraph.v

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Require Import ExtLib.Structures.Monads.
2+
Require Import ExtLib.Data.Monads.StateMonad.
3+
14
Set Implicit Arguments.
25
Set Strict Implicit.
36

@@ -18,8 +21,6 @@ Arguments addEdge {_} {_} {_} _ _ _.
1821

1922
(** A State Monad simplifies things **)
2023
Section Monadic.
21-
Require Import ExtLib.Structures.Monads.
22-
Require Import ExtLib.Data.Monads.StateMonad.
2324
Variable m : Type -> Type.
2425
Context {Monad_m : Monad m}.
2526

theories/Data/Graph/GraphAlgos.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Require Import Coq.Lists.List.
2+
Require Import Coq.PArith.BinPos.
23
Require Import ExtLib.Structures.Monads.
34
Require Import ExtLib.Structures.Reducible.
45
Require Import ExtLib.Data.Graph.Graph.
@@ -45,9 +46,8 @@ Section GraphAlgos.
4546

4647
End monadic.
4748

48-
Require Import BinPos.
4949
Definition dfs (from : V) : list V :=
50-
let count := Npos (List.fold_left (fun acc _ => BinPos.Psucc acc) (verticies g) 1%positive) in
50+
let count := Npos (List.fold_left (fun acc _ => Pos.succ acc) (verticies g) 1%positive) in
5151
let res := runGFix (dfs' from nil) count in
5252
match res with
5353
| Diverge => (** This should never happen! **)

theories/Data/List.v

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
Require Import Coq.Lists.List.
2+
Require Coq.Classes.EquivDec.
23
Require Import ExtLib.Core.Type.
34
Require Import ExtLib.Core.RelDec.
45
Require Import ExtLib.Structures.Monoid.
56
Require Import ExtLib.Structures.Reducible.
7+
Require ExtLib.Data.Nat.
68
Require Import ExtLib.Tactics.Consider.
79
Require Import ExtLib.Tactics.Injection.
810

@@ -45,7 +47,6 @@ Section type.
4547
End type.
4648

4749
Section EqDec.
48-
Require EquivDec.
4950
Variable T : Type.
5051
Variable EqDec_T : EquivDec.EqDec _ (@eq T).
5152

@@ -155,9 +156,9 @@ Global Instance Monad_list : Monad list :=
155156
List.fold_right (fun x acc => f x ++ acc) nil x
156157
}.
157158

158-
Section list.
159-
Require ExtLib.Data.Nat.
160159

160+
161+
Section list.
161162
Inductive R_list_len {T} : list T -> list T -> Prop :=
162163
| R_l_len : forall n m, length n < length m -> R_list_len n m.
163164

theories/Data/String.v

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
Require Import Coq.Strings.String.
2+
Require Import Coq.Program.Program.
3+
Require Import Coq.Numbers.Natural.Peano.NPeano.
4+
Require Import Coq.Arith.Arith.
5+
26
Require Import ExtLib.Tactics.Consider.
37
Require Import ExtLib.Core.RelDec.
48
Require Import ExtLib.Structures.Reducible.
@@ -71,8 +75,6 @@ Fixpoint string_cmp (l r : string) : comparison :=
7175
end.
7276

7377
Section Program_Scope.
74-
Require Import Program.
75-
Import NPeano.Nat Arith.
7678
Variable modulus : nat.
7779
Hypothesis one_lt_mod : 1 < modulus.
7880

theories/Programming/Show.v

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Require Coq.Strings.Ascii.
2+
Require Coq.Strings.String.
13
Require Import Coq.Strings.String.
24
Require Import Coq.Program.Wf.
35
Require Import Coq.PArith.BinPos.
@@ -133,11 +135,10 @@ Section sum_Show.
133135
" "%char <<
134136
payload <<
135137
")"%char.
136-
138+
137139
End sum_Show.
138140

139141
Section foldable_Show.
140-
Require Import ExtLib.Structures.Reducible.
141142
Polymorphic Context {A:Type} {B:Type} {F : Foldable B A} {BS : Show A}.
142143

143144
Global Polymorphic Instance foldable_Show : Show B :=
@@ -154,51 +155,51 @@ Polymorphic Fixpoint iter_show (ss : list showM) : showM :=
154155
Section hiding_notation.
155156
Import ShowNotation.
156157
Local Open Scope show_scope.
157-
Require Import Ascii.
158-
Require Import String.
158+
Import Ascii.
159+
Import String.
159160

160-
Global Instance unit_Show : Show unit :=
161+
Global Instance unit_Show : Show unit :=
161162
{ show u := "tt"%string }.
162-
Global Instance bool_Show : Show bool :=
163+
Global Instance bool_Show : Show bool :=
163164
{ show b := if b then "true"%string else "false"%string }.
164-
Global Instance ascii_Show : Show ascii :=
165-
fun a => "'"%char << a << "'"%char.
166-
Global Instance string_Show : Show string :=
165+
Global Instance ascii_Show : Show ascii :=
166+
fun a => "'"%char << a << "'"%char.
167+
Global Instance string_Show : Show string :=
167168
{ show s := """"%char << s << """"%char }.
168169

169-
Program Fixpoint nat_show (n:nat) {measure n} : showM :=
170-
if Compare_dec.le_gt_dec n 9 then
171-
inject (Char.digit2ascii n)
172-
else
173-
let n' := NPeano.Nat.div n 10 in
174-
(@nat_show n' _) << (inject (Char.digit2ascii (n - 10 * n'))).
175-
Next Obligation.
176-
assert (NPeano.Nat.div n 10 < n) ; eauto.
177-
eapply NPeano.Nat.div_lt.
178-
inversion H; apply Lt.lt_O_Sn.
179-
repeat constructor.
180-
Defined.
181-
Global Instance nat_Show : Show nat := { show := nat_show }.
182-
183-
Global Instance Show_positive : Show positive :=
184-
fun x => nat_show (Pos.to_nat x).
185-
186-
Global Instance Show_Z : Show Z :=
187-
fun x =>
188-
match x with
170+
Program Fixpoint nat_show (n:nat) {measure n} : showM :=
171+
if Compare_dec.le_gt_dec n 9 then
172+
inject (Char.digit2ascii n)
173+
else
174+
let n' := NPeano.Nat.div n 10 in
175+
(@nat_show n' _) << (inject (Char.digit2ascii (n - 10 * n'))).
176+
Next Obligation.
177+
assert (NPeano.Nat.div n 10 < n) ; eauto.
178+
eapply NPeano.Nat.div_lt.
179+
inversion H; apply Lt.lt_O_Sn.
180+
repeat constructor.
181+
Defined.
182+
Global Instance nat_Show : Show nat := { show := nat_show }.
183+
184+
Global Instance Show_positive : Show positive :=
185+
fun x => nat_show (Pos.to_nat x).
186+
187+
Global Instance Show_Z : Show Z :=
188+
fun x =>
189+
match x with
189190
| Z0 => "0"%char
190191
| Zpos p => show p
191192
| Zneg p => "-"%char << show p
192-
end.
193-
194-
Section pair_Show.
195-
Polymorphic Definition pair_Show@{a m}
196-
{A : Type@{a}} {B : Type@{a}} {AS:Show A} {BS:Show B}
197-
: Show (A*B) :=
198-
fun p =>
199-
let (a,b) := p in
200-
"("%char << show a << ","%char << show b << ")"%char.
201-
End pair_Show.
193+
end.
194+
195+
Section pair_Show.
196+
Polymorphic Definition pair_Show@{a m}
197+
{A : Type@{a}} {B : Type@{a}} {AS:Show A} {BS:Show B}
198+
: Show (A*B) :=
199+
fun p =>
200+
let (a,b) := p in
201+
"("%char << show a << ","%char << show b << ")"%char.
202+
End pair_Show.
202203
End hiding_notation.
203204

204205

theories/Recur/Measure.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Require Import Coq.Classes.RelationClasses.
2+
Require Coq.Arith.Wf_nat.
23

34
Set Implicit Arguments.
45
Set Strict Implicit.
@@ -25,7 +26,6 @@ End parametric.
2526

2627
(** A well-founded relation induced by a measure to nat **)
2728
Section measure.
28-
Require Coq.Arith.Wf_nat.
2929
Context {T : Type}.
3030
Variable m : T -> nat.
3131

theories/Structures/Reducible.v

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
Require Import RelationClasses.
1+
Require Import Coq.Classes.RelationClasses.
22
Require Import ExtLib.Structures.BinOps.
3+
Require Import ExtLib.Structures.Monad.
34

45
Set Implicit Arguments.
56
Set Strict Implicit.
@@ -12,32 +13,30 @@ Class Foldable (T E : Type) : Type :=
1213

1314
Section RedFold.
1415
Variables T E : Type.
15-
16+
1617
Global Instance Reducible_from_Foldable (R : Foldable T E) : Reducible T E | 100 :=
1718
fun A base single join =>
1819
@fold _ _ R A (fun x => join (single x)) base.
1920
End RedFold.
2021

2122
Section foldM.
22-
Require Import ExtLib.Structures.Monad.
2323
Context {T E : Type}.
2424
Context {Foldable_te : Foldable T E}.
2525
Context {m : Type -> Type}.
2626
Context {Monad_m : Monad m}.
2727

2828
Definition foldM {A} (add : E -> A -> m A) (base : m A) (t : T) : m A :=
29-
fold (fun x acc => bind acc (add x)) base t.
29+
fold (fun x acc => bind acc (add x)) base t.
3030
End foldM.
3131

3232
Section reduceM.
33-
Require Import ExtLib.Structures.Monad.
3433
Context {T E : Type}.
3534
Context {Reducible_te : Reducible T E}.
3635
Context {m : Type -> Type}.
3736
Context {Monad_m : Monad m}.
3837

3938
Definition reduceM {A} (base : m A) (single : E -> m A) (join : A -> A -> m A) (t : T) : m A :=
40-
reduce base single (fun x y => bind x (fun x => bind y (fun y => join x y))) t.
39+
reduce base single (fun x y => bind x (fun x => bind y (fun y => join x y))) t.
4140
End reduceM.
4241

4342
Section iterM.
@@ -46,8 +45,8 @@ Section iterM.
4645

4746
Context {m : Type -> Type}.
4847
Context {Monad_m : Monad m}.
49-
Context {Red_te : Reducible T E}.
50-
48+
Context {Red_te : Reducible T E}.
49+
5150
Variable f : E -> m unit.
5251

5352
Definition iterM : T -> m unit :=
@@ -60,7 +59,7 @@ Section Laws.
6059
Context (R : Reducible T E).
6160
6261
Class ReducibleLaw : Prop :=
63-
reduce_spec : forall A
62+
reduce_spec : forall A
6463
(unit : A)
6564
(single : E -> A)
6665
(join : A -> A -> A)

theories/Tactics/EqDep.v

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Require Import Coq.Classes.EquivDec.
22
Require Import ExtLib.Structures.EqDep.
3+
Require Coq.Logic.Eqdep_dec.
34

45
Set Implicit Arguments.
56
Set Strict Implicit.
@@ -8,8 +9,6 @@ Section Classes.
89
Context {A : Type}.
910
Context {dec : EqDec A (@eq A)}.
1011

11-
Require Eqdep_dec.
12-
1312
Theorem UIP_refl : forall {x : A} (p1 : x = x), p1 = refl_equal _.
1413
intros.
1514
eapply Eqdep_dec.UIP_dec. apply equiv_dec.

0 commit comments

Comments
 (0)