aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Herbelin2015-07-16 22:53:10 +0200
committerHugo Herbelin2015-07-16 22:53:10 +0200
commitfdd6a17b272995237c9f95fc465bb1ff6871bedc (patch)
tree81d478b093830b4e144303f15586d41fb9c1fcf9
parente0d36d4afd7f38eb6816b92d03ecc2d2f7dc8d3f (diff)
Refining 71def2f8 on too strong occur-check limiting evar-evar
unification in tactics. The relaxing of occur-check was ok but was leading trivial problems of the form ?X[?Meta] = ?X[?Meta] to enter a complex Evar-ization into ?X[?Meta] = ?X[?Y], ?Meta:=?Y which consider_remaining_unif_problems was not any more able to deal with. Doing quick: treat the trivial cases ?X[args] = ?X[args] in an ad hoc way, so that it behaves as if the occur-check had not been restricted.
-rw-r--r--pretyping/unification.ml6
-rw-r--r--test-suite/bugs/closed/4205.v8
2 files changed, 13 insertions, 1 deletions
diff --git a/pretyping/unification.ml b/pretyping/unification.ml
index b5fe5d0b6d..24e06007e9 100644
--- a/pretyping/unification.ml
+++ b/pretyping/unification.ml
@@ -676,7 +676,11 @@ let rec unify_0_with_initial_metas (sigma,ms,es as subst) conv_at_top env cv_pb
| Evar (evk,_ as ev), Evar (evk',_)
when not (Evar.Set.mem evk flags.frozen_evars)
&& Evar.equal evk evk' ->
- sigma,metasubst,((curenv,ev,cN)::evarsubst)
+ let sigma',b = constr_cmp cv_pb sigma flags cM cN in
+ if b then
+ sigma',metasubst,evarsubst
+ else
+ sigma,metasubst,((curenv,ev,cN)::evarsubst)
| Evar (evk,_ as ev), _
when not (Evar.Set.mem evk flags.frozen_evars)
&& not (occur_evar evk cN) ->
diff --git a/test-suite/bugs/closed/4205.v b/test-suite/bugs/closed/4205.v
new file mode 100644
index 0000000000..c40dfcc1f3
--- /dev/null
+++ b/test-suite/bugs/closed/4205.v
@@ -0,0 +1,8 @@
+(* Testing a regression from 8.5beta1 to 8.5beta2 in evar-evar tactic unification problems *)
+
+
+Inductive test : nat -> nat -> nat -> nat -> Prop :=
+ | test1 : forall m n, test m n m n.
+
+Goal test 1 2 3 4.
+erewrite f_equal2 with (f := fun k l => test _ _ k l).