aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Roux2020-06-08 18:17:30 +0200
committerPierre Roux2020-06-08 18:45:53 +0200
commit8ecdb858a416b945fd9bc429e9eecf8aa451f0e7 (patch)
tree0688889d037a6968ee210a6e44a2872d2df06651
parent2e85a6b4acf419064f8a979d254a7b1d871c81c2 (diff)
Fix 12483
-rw-r--r--doc/changelog/10-standard-library/12484-fix12483.rst6
-rw-r--r--test-suite/bugs/closed/bug_12483.v10
-rw-r--r--theories/Floats/SpecFloat.v2
3 files changed, 17 insertions, 1 deletions
diff --git a/doc/changelog/10-standard-library/12484-fix12483.rst b/doc/changelog/10-standard-library/12484-fix12483.rst
new file mode 100644
index 0000000000..95e7c150a3
--- /dev/null
+++ b/doc/changelog/10-standard-library/12484-fix12483.rst
@@ -0,0 +1,6 @@
+- **Fixed:**
+ Fix the specification of :n:`PrimFloat.leb` which made
+ :n:`(x <= y)%float` true for any non NaN :n:`x` and :n:`y`.
+ (`#12484 <https://github.com/coq/coq/pull/12484>`_,
+ fixes `#12483 <https://github.com/coq/coq/issues/12483>`_,
+ by Pierre Roux).
diff --git a/test-suite/bugs/closed/bug_12483.v b/test-suite/bugs/closed/bug_12483.v
new file mode 100644
index 0000000000..0d034a65eb
--- /dev/null
+++ b/test-suite/bugs/closed/bug_12483.v
@@ -0,0 +1,10 @@
+Require Import Floats.
+
+Goal False.
+Proof.
+cut (false = true).
+{ intro H; discriminate H. }
+change false with (1 <= 0)%float.
+rewrite leb_spec.
+Fail reflexivity.
+Abort.
diff --git a/theories/Floats/SpecFloat.v b/theories/Floats/SpecFloat.v
index 349b37c704..aaf7cbb8f7 100644
--- a/theories/Floats/SpecFloat.v
+++ b/theories/Floats/SpecFloat.v
@@ -222,7 +222,7 @@ Section FloatOps.
Definition SFleb f1 f2 :=
match SFcompare f1 f2 with
- | Some Le => true
+ | Some (Lt | Eq) => true
| _ => false
end.