aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorherbelin2003-12-17 11:09:20 +0000
committerherbelin2003-12-17 11:09:20 +0000
commit4b7b2590e1e35a425e6d82bf280189d2ff9d27e4 (patch)
tree649cbf3cc2e8ed1ecceb66ba4c2de4342f7a3ae2
parent032ac3721ccf40694e185a7187b71961c7d69a01 (diff)
Prise en compte des sous-termes imbriqués pour 'simpl ident at nums'
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@5109 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--pretyping/tacred.ml17
1 files changed, 11 insertions, 6 deletions
diff --git a/pretyping/tacred.ml b/pretyping/tacred.ml
index 41b393a322..684dec0d36 100644
--- a/pretyping/tacred.ml
+++ b/pretyping/tacred.ml
@@ -618,12 +618,17 @@ let contextually byheadalso (locs,c) f env sigma t =
if locs <> [] & (not except) & (!pos > maxocc) then t
else
if eq_constr c t or (byheadalso & is_head c t) then
- let r =
- if except then
- if List.mem (- !pos) locs then t else f env sigma t
- else
- if locs = [] or List.mem !pos locs then f env sigma t else t
- in incr pos; r
+ let ok =
+ if except then not (List.mem (- !pos) locs)
+ else (locs = [] or List.mem !pos locs) in
+ incr pos;
+ if ok then
+ f env sigma t
+ else if byheadalso then
+ (* find other occurrences of c in t; TODO: ensure left-to-right *)
+ map_constr (traverse envc) t
+ else
+ t
else
map_constr_with_binders_left_to_right
(fun d (env,c) -> (push_rel d env,lift 1 c))