aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorherbelin2004-02-13 14:06:51 +0000
committerherbelin2004-02-13 14:06:51 +0000
commit8c582a877641e2c083d1bdc5a0ebbb1270230dee (patch)
tree53c903bf186298c438ec6a1eeca77e270d774068
parenta2e05c8fe6de43935d4a2054808db86dc575b34d (diff)
Bug numerotation des occurrences pour 'simpl id at n' (2 protections maintenant !)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@5336 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--pretyping/tacred.ml9
1 files changed, 5 insertions, 4 deletions
diff --git a/pretyping/tacred.ml b/pretyping/tacred.ml
index ce6764c38d..24126c0407 100644
--- a/pretyping/tacred.ml
+++ b/pretyping/tacred.ml
@@ -606,7 +606,7 @@ let is_head c t =
| App (f,_) -> f = c
| _ -> false
-let contextually byheadalso (locs,c) f env sigma t =
+let contextually byhead (locs,c) f env sigma t =
let maxocc = List.fold_right max locs 0 in
let pos = ref 1 in
let check = ref true in
@@ -617,16 +617,17 @@ let contextually byheadalso (locs,c) f env sigma t =
let rec traverse (env,c as envc) t =
if locs <> [] & (not except) & (!pos > maxocc) then t
else
- if eq_constr c t or (byheadalso & is_head c t) then
+ if (not byhead & eq_constr c t) or (byhead & is_head c t) then
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
+ else if byhead then
(* find other occurrences of c in t; TODO: ensure left-to-right *)
- map_constr (traverse envc) t
+ let (f,l) = destApplication t in
+ mkApp (f, array_map_left (traverse envc) l)
else
t
else