aboutsummaryrefslogtreecommitdiffhomepage
path: root/pretyping/unification.ml
diff options
context:
space:
mode:
authorGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2015-02-23 12:43:01 +0100
committerGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2015-02-23 12:50:45 +0100
commit06ad2a73251f38c59c43c03a0edca34d5ef3dd8e (patch)
tree7f74e8e7ffc3e1129c530a49f2cc23d031962972 /pretyping/unification.ml
parent71def2f885989376c8c2940d37f7fc407ed0a4c5 (diff)
Fixing rewrite/subst when the subterm to rewrite is argument of an Evar.
This was broken by the attempt to use the same algorithm for rewriting closed subterms than for rewriting subterms with evars: the algorithm to find subterms (w_unify_to_subterm) did not go through evars. But what to do when looking say, for a pattern "S ?n" in a goal "S ?x[a:=S ?y]"? Should we unify ?x[a:=S ?y] with ?n or consider ?x as rigid and look in the instance? If we adopt the first approach, then, what to do when looking for "S ?n" in a goal "?x[a:=S ?y]"? Failing? Looking in the instance? Is it normal that an evar behaves as a rigid constant when it cannot be unified with the pattern?
Diffstat (limited to 'pretyping/unification.ml')
-rw-r--r--pretyping/unification.ml7
1 files changed, 6 insertions, 1 deletions
diff --git a/pretyping/unification.ml b/pretyping/unification.ml
index 99c20ef6c..01e1154e5 100644
--- a/pretyping/unification.ml
+++ b/pretyping/unification.ml
@@ -1780,7 +1780,12 @@ let w_unify_to_subterm_list env evd flags hdmeta oplist t =
try
(* This is up to delta for subterms w/o metas ... *)
w_unify_to_subterm env evd ~flags (strip_outer_cast op,t)
- with PretypeError (env,_,NoOccurrenceFound _) when allow_K -> (evd,op)
+ with PretypeError (env,_,NoOccurrenceFound _) when
+ allow_K ||
+ (* w_unify_to_subterm does not go through evars, so
+ the next step, which was already in <= 8.4, is
+ needed at least for compatibility of rewrite *)
+ dependent op t -> (evd,op)
in
if not allow_K &&
(* ensure we found a different instance *)