aboutsummaryrefslogtreecommitdiffhomepage
path: root/tactics
diff options
context:
space:
mode:
authorGravatar msozeau <msozeau@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-04-09 14:59:09 +0000
committerGravatar msozeau <msozeau@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-04-09 14:59:09 +0000
commit119f9ef620c4318dc3221808b0583f1b02182f38 (patch)
treed516d81b756c901cd6fa1a8482d6ea7914a66950 /tactics
parent7bf9b0c621d8cfebbecaf0ffc1a3ee84429a665f (diff)
Fix evar bugs in type classes:
- disallow uninstantiated hypotheses (typically local variables with no assigned types) as solutions for typeclass instantiation. - Fix resolve_typeclasses call in pretyping that was not propagating found instances in the term. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10772 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'tactics')
-rw-r--r--tactics/class_tactics.ml49
1 files changed, 7 insertions, 2 deletions
diff --git a/tactics/class_tactics.ml4 b/tactics/class_tactics.ml4
index bbd29e665..48c94a074 100644
--- a/tactics/class_tactics.ml4
+++ b/tactics/class_tactics.ml4
@@ -134,6 +134,11 @@ type search_state = {
dblist : Auto.Hint_db.t list;
localdb : Auto.Hint_db.t list }
+let filter_hyp t =
+ match kind_of_term t with
+ | Evar _ | Meta _ | Sort _ -> false
+ | _ -> true
+
module SearchProblem = struct
type state = search_state
@@ -203,8 +208,8 @@ module SearchProblem = struct
(List.map
(fun id -> (Eauto.e_give_exact_constr (mkVar id), 0,
(str "exact" ++ spc () ++ pr_id id)))
-(* (List.filter (fun id -> filt (pf_get_hyp_typ g id)) *)
- (pf_ids_of_hyps g))
+ (List.filter (fun id -> filter_hyp (pf_get_hyp_typ g id))
+ (pf_ids_of_hyps g)))
in
List.map (fun (res,pri,pp) -> { s with tacres = res; pri = 0;
last_tactic = pp; localdb = List.tl s.localdb }) l