aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coq.opam.docker38
-rw-r--r--doc/changelog/10-standard-library/1185-sort.rst5
-rw-r--r--doc/changelog/10-standard-library/11891-fix-order-notations.rst10
-rw-r--r--test-suite/bugs/closed/bug_11890.v10
-rw-r--r--theories/Sorting/Mergesort.v11
-rw-r--r--theories/Structures/Orders.v4
6 files changed, 70 insertions, 8 deletions
diff --git a/coq.opam.docker b/coq.opam.docker
new file mode 100644
index 0000000000..229a47a87b
--- /dev/null
+++ b/coq.opam.docker
@@ -0,0 +1,38 @@
+synopsis: "The Coq Proof Assistant"
+description: """
+Coq is a formal proof management system. It provides
+a formal language to write mathematical definitions, executable
+algorithms and theorems together with an environment for
+semi-interactive development of machine-checked proofs. Typical
+applications include the certification of properties of programming
+languages (e.g. the CompCert compiler certification project, or the
+Bedrock verified low-level programming library), the formalization of
+mathematics (e.g. the full formalization of the Feit-Thompson theorem
+or homotopy type theory) and teaching.
+"""
+opam-version: "2.0"
+maintainer: "The Coq development team <coqdev@inria.fr>"
+authors: "The Coq development team, INRIA, CNRS, and contributors."
+homepage: "https://coq.inria.fr/"
+bug-reports: "https://github.com/coq/coq/issues"
+dev-repo: "git+https://github.com/coq/coq.git"
+license: "LGPL-2.1"
+
+version: "dev"
+
+depends: [
+ "ocaml" { >= "4.05.0" }
+ "ocamlfind" { build }
+ "num"
+ "conf-findutils" {build}
+]
+
+build: [
+ [ "./configure" "-prefix" prefix "-coqide" "no" ]
+ [make "-j%{jobs}%"]
+ [make "-j%{jobs}%" "byte"]
+]
+install: [
+ [make "install"]
+ [make "install-byte"]
+]
diff --git a/doc/changelog/10-standard-library/1185-sort.rst b/doc/changelog/10-standard-library/1185-sort.rst
new file mode 100644
index 0000000000..edb5ee3ac4
--- /dev/null
+++ b/doc/changelog/10-standard-library/1185-sort.rst
@@ -0,0 +1,5 @@
+- **Changed:**
+ The names of ``Sorted_sort`` and ``LocallySorted_sort`` in ``Coq.Sorting.MergeSort``
+ have been swapped to appropriately reflect their meanings
+ (`#1185 <https://github.com/coq/coq/pull/1185>`_,
+ by Lysxia).
diff --git a/doc/changelog/10-standard-library/11891-fix-order-notations.rst b/doc/changelog/10-standard-library/11891-fix-order-notations.rst
new file mode 100644
index 0000000000..d58d26244a
--- /dev/null
+++ b/doc/changelog/10-standard-library/11891-fix-order-notations.rst
@@ -0,0 +1,10 @@
+- **Changed:**
+ Notations :g:`<=?` and :g:`<?` from ``Coq.Structures.Orders`` and
+ ``Coq.Sorting.Mergesort.NatOrder`` are now at level 70 rather than
+ 35, so as to be compatible with the notations defined everywhere
+ else in the standard library. This may require re-parenthesizing
+ some expressions. These notations were breaking the ability to
+ import modules from the standard library that were otherwise
+ compatible (fixes `#11890
+ <https://github.com/coq/coq/issues/11890>`_, `#11891
+ <https://github.com/coq/coq/pull/11891>`_, by Jason Gross).
diff --git a/test-suite/bugs/closed/bug_11890.v b/test-suite/bugs/closed/bug_11890.v
new file mode 100644
index 0000000000..c0426fcfda
--- /dev/null
+++ b/test-suite/bugs/closed/bug_11890.v
@@ -0,0 +1,10 @@
+Require Import Coq.Structures.Orders Coq.ZArith.ZArith Coq.Sorting.Mergesort.
+(* Note that this has always worked fine without the '; we are testing importing notations from the stdlib here *)
+Declare Module A : LeBool'.
+Declare Module B : LtBool'.
+Import A B NatOrder.
+(*
+Error: Notation "_ <=? _" is already defined at level 70 with arguments constr
+at next level, constr at next level while it is now required to be at level 35
+with arguments constr at next level, constr at next level.
+*)
diff --git a/theories/Sorting/Mergesort.v b/theories/Sorting/Mergesort.v
index a761dba62d..f6a1efdd37 100644
--- a/theories/Sorting/Mergesort.v
+++ b/theories/Sorting/Mergesort.v
@@ -230,13 +230,13 @@ Proof.
apply IHl.
Qed.
-Theorem Sorted_sort : forall l, Sorted (sort l).
+Theorem LocallySorted_sort : forall l, Sorted (sort l).
Proof.
intro; apply Sorted_iter_merge. constructor.
Qed.
-Corollary LocallySorted_sort : forall l, Sorted.Sorted leb (sort l).
-Proof. intro; eapply Sorted_LocallySorted_iff, Sorted_sort; auto. Qed.
+Corollary Sorted_sort : forall l, Sorted.Sorted leb (sort l).
+Proof. intro; eapply Sorted_LocallySorted_iff, LocallySorted_sort; auto. Qed.
Theorem Permuted_sort : forall l, Permutation l (sort l).
Proof.
@@ -245,7 +245,7 @@ Qed.
Corollary StronglySorted_sort : forall l,
Transitive leb -> StronglySorted leb (sort l).
-Proof. auto using Sorted_StronglySorted, LocallySorted_sort. Qed.
+Proof. auto using Sorted_StronglySorted, Sorted_sort. Qed.
End Sort.
@@ -259,7 +259,7 @@ Module NatOrder <: TotalLeBool.
| _, 0 => false
| S x', S y' => leb x' y'
end.
- Infix "<=?" := leb (at level 35).
+ Infix "<=?" := leb (at level 70, no associativity).
Theorem leb_total : forall a1 a2, a1 <=? a2 \/ a2 <=? a1.
Proof.
induction a1; destruct a2; simpl; auto.
@@ -269,4 +269,3 @@ End NatOrder.
Module Import NatSort := Sort NatOrder.
Example SimpleMergeExample := Eval compute in sort [5;3;6;1;8;6;0].
-
diff --git a/theories/Structures/Orders.v b/theories/Structures/Orders.v
index 6a0e7397eb..94938c1d4d 100644
--- a/theories/Structures/Orders.v
+++ b/theories/Structures/Orders.v
@@ -192,11 +192,11 @@ Module Type HasLtb (Import T:Typ).
End HasLtb.
Module Type LebNotation (T:Typ)(E:HasLeb T).
- Infix "<=?" := E.leb (at level 35).
+ Infix "<=?" := E.leb (at level 70, no associativity).
End LebNotation.
Module Type LtbNotation (T:Typ)(E:HasLtb T).
- Infix "<?" := E.ltb (at level 35).
+ Infix "<?" := E.ltb (at level 70, no associativity).
End LtbNotation.
Module Type LebSpec (T:Typ)(X:HasLe T)(Y:HasLeb T).