From 503dad5f384f9e03ce9b9f3a956dcc3b2a40e37e Mon Sep 17 00:00:00 2001 From: herbelin Date: Sat, 17 Dec 2011 22:59:34 +0000 Subject: Added ability to take the type of applied metas into account when instantiating them in the unification algorithm used for tactics. This allows to discard ill-typed uses of first-order unification which otherwise would have been fatal (this incidentally allows to partially restore some compatibility with 8.3 that was broken after eta was added in unification). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14812 85f007b7-540e-0410-9357-904b9bb8a0f7 --- lib/util.ml | 4 ++++ lib/util.mli | 1 + 2 files changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/util.ml b/lib/util.ml index a199aacd23..287dd37191 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -604,6 +604,10 @@ let rec list_remove_assoc_in_triple x = function | [] -> [] | (y,_,_ as z)::l -> if x = y then l else z::list_remove_assoc_in_triple x l +let rec list_assoc_snd_in_triple x = function + [] -> raise Not_found + | (a,b,_)::l -> if compare a x = 0 then b else list_assoc_snd_in_triple x l + let list_add_set x l = if List.mem x l then l else x::l let list_eq_set l1 l2 = diff --git a/lib/util.mli b/lib/util.mli index a2a72453cd..1fec229546 100644 --- a/lib/util.mli +++ b/lib/util.mli @@ -176,6 +176,7 @@ val list_except : 'a -> 'a list -> 'a list val list_remove : 'a -> 'a list -> 'a list val list_remove_first : 'a -> 'a list -> 'a list val list_remove_assoc_in_triple : 'a -> ('a * 'b * 'c) list -> ('a * 'b * 'c) list +val list_assoc_snd_in_triple : 'a -> ('a * 'b * 'c) list -> 'b val list_for_all2eq : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool val list_sep_last : 'a list -> 'a * 'a list val list_try_find_i : (int -> 'a -> 'b) -> int -> 'a list -> 'b -- cgit v1.2.3