aboutsummaryrefslogtreecommitdiffhomepage
path: root/tactics/rewrite.ml4
diff options
context:
space:
mode:
authorGravatar msozeau <msozeau@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-06-07 14:00:40 +0000
committerGravatar msozeau <msozeau@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-06-07 14:00:40 +0000
commit52d0524137d3bdd2c8afad483f8d731f4e19a28a (patch)
tree58dee8e035fa3294411ea930395d7813b73b1684 /tactics/rewrite.ml4
parentbe496912193961d9a230dae5b24e4fb7d8cbc042 (diff)
Fix bug #2335, fail if the search for reflexivity/symmetry/transitivity proofs create unsolved evars
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14167 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'tactics/rewrite.ml4')
-rw-r--r--tactics/rewrite.ml410
1 files changed, 8 insertions, 2 deletions
diff --git a/tactics/rewrite.ml4 b/tactics/rewrite.ml4
index 334d653b1..f0ca4ae50 100644
--- a/tactics/rewrite.ml4
+++ b/tactics/rewrite.ml4
@@ -195,11 +195,17 @@ let proper_proof env evars carrier relation x =
let goal = mkApp (Lazy.force proper_proxy_type, [| carrier ; relation; x |])
in new_cstr_evar evars env goal
+let extends_undefined evars evars' =
+ let f ev evi found = found || not (Evd.mem evars ev)
+ in fold_undefined f evars' false
+
+
let find_class_proof proof_type proof_method env evars carrier relation =
try
let goal = mkApp (Lazy.force proof_type, [| carrier ; relation |]) in
- let evars, c = Typeclasses.resolve_one_typeclass env evars goal in
- mkApp (Lazy.force proof_method, [| carrier; relation; c |])
+ let evars', c = Typeclasses.resolve_one_typeclass env evars goal in
+ if extends_undefined evars evars' then raise Not_found
+ else mkApp (Lazy.force proof_method, [| carrier; relation; c |])
with e when Logic.catchable_exception e -> raise Not_found
let get_reflexive_proof env = find_class_proof reflexive_type reflexive_proof env