Skip to content

Commit

Permalink
Remove deprecate files in Arith
Browse files Browse the repository at this point in the history
* Removed in Arith:

  - Div2.v
  - Even.v
  - Gt.v
  - Le.v
  - Lt.v
  - Max.v
  - Minus.v
  - Min.v
  - Mult.v
  - Plus.v
* Removed Numbers/Natural/Peano/NPeano.v
* Many "Require" statements involving these files removed in other parts
  of the library
* Several deprecated lemmas removed in Arith/EqNat

* Some test files had to change:

-  bugs/bug_13307.v
-  bugs/bug_1779.v
-  bugs/bug_4187.v
-  bugs/bug_4456.v
-  modules/Nat.v
-  success/Funind.v
-  success/RecTutorial.v
-  success/Require.v (Not sure about this one)
-  success/extraction.v
-  success/import_lib.v

`bugs/bug_4725` still does not pass.
  • Loading branch information
Villetaneuse committed Sep 19, 2023
1 parent b881f18 commit 4a47086
Show file tree
Hide file tree
Showing 61 changed files with 27 additions and 1,603 deletions.
2 changes: 1 addition & 1 deletion test-suite/bugs/bug_13307.v
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Module numbers.
From Coq Require Export EqdepFacts PArith NArith ZArith NPeano.
From Coq Require Export EqdepFacts PArith NArith ZArith.
End numbers.

Import numbers.
Expand Down
18 changes: 9 additions & 9 deletions test-suite/bugs/bug_1779.v
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
Require Import Div2.
Require Import PeanoNat.

Lemma double_div2: forall n, div2 (double n) = n.
Lemma double_div2: forall n, Nat.div2 (Nat.double n) = n.
exact (fun n => let _subcase :=
let _cofact := fun _ : 0 = 0 => refl_equal 0 in
_cofact (let _fact := refl_equal 0 in _fact) in
let _subcase0 :=
fun (m : nat) (Hrec : div2 (double m) = m) =>
let _fact := f_equal div2 (double_S m) in
let _eq := trans_eq _fact (refl_equal (S (div2 (double m)))) in
fun (m : nat) (Hrec : Nat.div2 (Nat.double m) = m) =>
let _fact := f_equal Nat.div2 (Nat.double_S m) in
let _eq := trans_eq _fact (refl_equal (S (Nat.div2 (Nat.double m)))) in
let _eq0 :=
trans_eq _eq
(trans_eq
(f_equal (fun f : nat -> nat => f (div2 (double m)))
(f_equal (fun f : nat -> nat => f (Nat.div2 (Nat.double m)))
(refl_equal S)) (f_equal S Hrec)) in
_eq0 in
(fix _fix (__ : nat) : div2 (double __) = __ :=
match __ as n return (div2 (double n) = n) with
(fix _fix (__ : nat) : Nat.div2 (Nat.double __) = __ :=
match __ as n return (Nat.div2 (Nat.double n) = n) with
| 0 => _subcase
| S __0 =>
(fun _hrec : div2 (double __0) = __0 => _subcase0 __0 _hrec)
(fun _hrec : Nat.div2 (Nat.double __0) = __0 => _subcase0 __0 _hrec)
(_fix __0)
end) n).
Guarded.
Expand Down
3 changes: 1 addition & 2 deletions test-suite/bugs/bug_4187.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Axiom proof_admitted : False.
Tactic Notation "admit" := case proof_admitted.
Require Import Coq.Lists.List.
Require Import Coq.Setoids.Setoid.
Require Import Coq.Numbers.Natural.Peano.NPeano.
Global Set Implicit Arguments.
Global Generalizable All Variables.
Coercion is_true : bool >-> Sortclass.
Expand Down Expand Up @@ -378,7 +377,7 @@ Section general.
End general.

Module Export BooleanRecognizer.
Import Coq.Numbers.Natural.Peano.NPeano.
Import Coq.Arith.PeanoNat.
Import Coq.Arith.Compare_dec.
Import Coq.Arith.Wf_nat.

Expand Down
4 changes: 2 additions & 2 deletions test-suite/bugs/bug_4456.v
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ admit.
Defined.
Local Ltac t_parse_production_for := repeat
match goal with
| [ H : (beq_nat _ _) = true |- _ ] => apply EqNat.beq_nat_true in H
| [ H : (Nat.eqb _ _) = true |- _ ] => apply ->Nat.eqb_eq in H
| _ => progress subst
| _ => solve [ constructor; assumption ]
| [ H : minimal_parse_of_production _ _ _ nil |- _ ] => (inversion H; clear H)
Expand Down Expand Up @@ -619,7 +619,7 @@ Defined.
dec (minimal_parse_of_production (G := G) len0 valid str prod))
(
fun Hreachable str len Hlen pf
=> match Utils.dec (beq_nat len 0) with
=> match Utils.dec (Nat.eqb len 0) with
| left H => inl _
| right H => inr (fun p => _)
end)
Expand Down
2 changes: 1 addition & 1 deletion test-suite/modules/Nat.v
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Lemma le_refl : forall n : nat, le n n.
auto.
Qed.

Require Import Le.
Require Import Arith.

Lemma le_trans : forall n m k : nat, le n m -> le m k -> le n k.
eauto with arith.
Expand Down
7 changes: 3 additions & 4 deletions test-suite/success/Funind.v
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,11 @@ Function nat_equal_bool (n m : nat) {struct n} : bool :=
end.


Require Export Div2.
Require Import Nat.
Functional Scheme div2_ind := Induction for div2 Sort Prop.
Lemma div2_inf : forall n : nat, div2 n <= n.
Functional Scheme div2_ind := Induction for Nat.div2 Sort Prop.
Lemma div2_inf : forall n : nat, Nat.div2 n <= n.
intros n.
functional induction div2 n.
functional induction Nat.div2 n.
auto.
auto.

Expand Down
2 changes: 0 additions & 2 deletions test-suite/success/RecTutorial.v
Original file line number Diff line number Diff line change
Expand Up @@ -859,8 +859,6 @@ Defined.
Print Acc.


Require Import Minus.

Fail Fixpoint div (x y:nat){struct x}: nat :=
if eq_nat_dec x 0
then 0
Expand Down
5 changes: 2 additions & 3 deletions test-suite/success/Require.v
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
(* -*- coq-prog-args: ("-noinit"); -*- *)

Require Import Coq.Arith.Plus.
Require Coq.Arith.Minus.
Locate Library Coq.Arith.Minus.
Require Import Coq.Arith.PeanoNat.
Locate Library Coq.Arith.PeanoNat.

(* Check that Init didn't get exported by the import above *)
Fail Check nat.
7 changes: 3 additions & 4 deletions test-suite/success/extraction.v
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,9 @@ Extraction test24.

(** Coq term non strongly-normalizable after extraction *)

Require Import Gt.
Definition loop (Ax:Acc gt 0) :=
(fix F (a:nat) (b:Acc gt a) {struct b} : nat :=
F (S a) (Acc_inv b (S a) (gt_Sn_n a))) 0 Ax.
F (S a) (Acc_inv b (S a) (Nat.lt_succ_diag_r a))) 0 Ax.
Extraction loop.
(* let loop _ =
let rec f a =
Expand Down Expand Up @@ -684,5 +683,5 @@ Require Import Euclid ExtrOcamlNatBigInt.
Definition test n m (H:m>0) :=
let (q,r,_,_) := eucl_dev m H n in
Nat.compare n (q*m+r).
Recursive Extraction test fact pred minus max min Div2.div2.
Extraction TestCompile test fact pred minus max min Div2.div2.
Recursive Extraction test fact pred minus max min Nat.div2.
Extraction TestCompile test fact pred minus max min Nat.div2.
6 changes: 3 additions & 3 deletions test-suite/success/import_lib.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ Definition le_trans := 0.

Module Test_Read.
Module M.
Require Le. (* Reading without importing *)
Require PeanoNat. (* Reading without importing *)

Check Le.le_trans.
Check PeanoNat.Nat.le_trans.

Lemma th0 : le_trans = 0.
reflexivity.
Qed.
End M.

Check Le.le_trans.
Check PeanoNat.Nat.le_trans.

Lemma th0 : le_trans = 0.
reflexivity.
Expand Down
7 changes: 0 additions & 7 deletions theories/Arith/Arith_base.v
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@

Require Export Arith_prebase.

Require Export Le.
Require Export Lt.
Require Export Plus.
Require Export Gt.
Require Export Minus.
Require Export Mult.

Require Export Factorial.
Require Export Between.
Require Export Peano_dec.
Expand Down
3 changes: 0 additions & 3 deletions theories/Arith/Between.v
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,3 @@ Section Between.
Qed.

End Between.

(* TODO #14736 for compatibility only, should be removed after deprecation *)
Require Import Le Lt.
2 changes: 0 additions & 2 deletions theories/Arith/Compare.v
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,3 @@ Proof.
Qed.

Require Export Wf_nat.

Require Export Min Max.
3 changes: 0 additions & 3 deletions theories/Arith/Compare_dec.v
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,3 @@ Lemma leb_compare n m : (n <=? m) = true <-> (n ?= m) <> Gt.
Proof.
rewrite Nat.compare_le_iff. apply Nat.leb_le.
Qed.

(* TODO #14736 for compatibility only, should be removed after deprecation *)
Require Import Le Lt Gt.
189 changes: 0 additions & 189 deletions theories/Arith/Div2.v

This file was deleted.

Loading

0 comments on commit 4a47086

Please sign in to comment.