aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Sozeau2014-06-20 16:03:52 +0200
committerMatthieu Sozeau2014-06-20 16:03:52 +0200
commit6133a43c30e03656696a897bcedaf0cfb2cec70d (patch)
treeedda5b719763000d714a3eb097a15d6a8efccb64
parent45bcb4c7ad7aad8c2c63287870666339fe2ac1f2 (diff)
Allow more relaxed conversion between the types of the two terms of a rewrite
equation, fix uncaught exception in setoid_rewrite (bug #3336).
-rw-r--r--tactics/rewrite.ml16
-rw-r--r--test-suite/bugs/closed/3336.v (renamed from test-suite/bugs/opened/3336.v)5
2 files changed, 11 insertions, 10 deletions
diff --git a/tactics/rewrite.ml b/tactics/rewrite.ml
index d7091b5d03..8794557ef6 100644
--- a/tactics/rewrite.ml
+++ b/tactics/rewrite.ml
@@ -444,7 +444,7 @@ let evd_convertible env evd x y =
with e when Errors.noncritical e -> false
let convertible env evd x y =
- Reductionops.is_conv env evd x y
+ Reductionops.is_conv_leq env evd x y
type hypinfo = {
cl : clausenv;
@@ -634,13 +634,9 @@ let unify_eqn env (sigma, cstrs) hypinfo by t =
let ty1 = Retyping.get_type_of env'.env env'.evd c1
and ty2 = Retyping.get_type_of env'.env env'.evd c2
in
- if convertible env env'.evd ty1 ty2 then
- (* (if occur_meta_or_existential prf then *)
- (hypinfo := refresh_hypinfo env env'.evd !hypinfo;
- env'.evd, prf, c1, c2, car, rel)
- (* else (\** Evars have been solved, we can go back to the initial evd, *)
- (* but keep the potential refinement of existing evars. *\) *)
- (* env'.evd, prf, c1, c2, car, rel) *)
+ if convertible env env'.evd ty2 ty1 then
+ (hypinfo := refresh_hypinfo env env'.evd !hypinfo;
+ env'.evd, prf, c1, c2, car, rel)
else raise Reduction.NotConvertible
in
let evars = evd', cstrs in
@@ -655,7 +651,9 @@ let unify_eqn env (sigma, cstrs) hypinfo by t =
let evars, rel' = poly_inverse !hypinfo.sort env evars car rel in
evars, (prf, (car, rel', c2, c1))
in Some (evd, res)
- with e when Class_tactics.catchable e -> None
+ with
+ | e when Class_tactics.catchable e -> None
+ | Reduction.NotConvertible -> None
type rewrite_flags = { under_lambdas : bool; on_morphisms : bool }
diff --git a/test-suite/bugs/opened/3336.v b/test-suite/bugs/closed/3336.v
index d469a13a34..dc358c6004 100644
--- a/test-suite/bugs/opened/3336.v
+++ b/test-suite/bugs/closed/3336.v
@@ -1,6 +1,9 @@
Require Import Setoid.
+
Goal forall x y : Type, x = y -> x = y.
intros x y H.
-Fail setoid_rewrite H.
+setoid_rewrite H.
+reflexivity.
+Defined.
(* Toplevel input, characters 0-16:
Anomaly: Uncaught exception Reduction.NotConvertible(_). Please report. *)