aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Herbelin2014-10-02 15:47:14 +0200
committerHugo Herbelin2014-10-02 16:17:30 +0200
commit2b26c3e9a011af1f77e4f4fc61c73943d2bb0dfc (patch)
tree271676c2b92ba2ec9c1e9c8356444a9cb61b40f2
parent6a736c77dee9315afd6d5f50375bf92c1da5d20c (diff)
Fixing bug #2810 (autounfold on local variable declared as hint but cleared).
-rw-r--r--tactics/eauto.ml46
-rw-r--r--test-suite/bugs/closed/2810.v1
2 files changed, 5 insertions, 2 deletions
diff --git a/tactics/eauto.ml4 b/tactics/eauto.ml4
index 7a4639967f..711ae92b0d 100644
--- a/tactics/eauto.ml4
+++ b/tactics/eauto.ml4
@@ -483,15 +483,17 @@ END
let cons a l = a :: l
-let autounfolds db occs =
+let autounfolds db occs cls gl =
let unfolds = List.concat (List.map (fun dbname ->
let db = try searchtable_map dbname
with Not_found -> errorlabstrm "autounfold" (str "Unknown database " ++ str dbname)
in
let (ids, csts) = Hint_db.unfolds db in
+ let hyps = pf_ids_of_hyps gl in
+ let ids = Idset.filter (fun id -> List.mem id hyps) ids in
Cset.fold (fun cst -> cons (AllOccurrences, EvalConstRef cst)) csts
(Id.Set.fold (fun id -> cons (AllOccurrences, EvalVarRef id)) ids [])) db)
- in unfold_option unfolds
+ in unfold_option unfolds cls gl
let autounfold db cls gl =
let cls = concrete_clause_of (fun () -> pf_ids_of_hyps gl) cls in
diff --git a/test-suite/bugs/closed/2810.v b/test-suite/bugs/closed/2810.v
index 9e33e49162..a66078c60a 100644
--- a/test-suite/bugs/closed/2810.v
+++ b/test-suite/bugs/closed/2810.v
@@ -6,4 +6,5 @@ Section foo.
Goal False.
clear B. autounfold with core.
+ Abort.
End foo.