diff options
| author | herbelin | 2007-04-13 13:20:51 +0000 |
|---|---|---|
| committer | herbelin | 2007-04-13 13:20:51 +0000 |
| commit | c7b4398341e1fec6c485f39cde8d42fa3ff6abff (patch) | |
| tree | 287f86abf547207168f55c4e4fe37d06f0a58b3d /lib/util.ml | |
| parent | ba8f9564e492cd8d25a193cfc5883ed06faaea02 (diff) | |
Correction bug #1477 sur ordre des variables partagées par les or-patterns.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@9764 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/util.ml')
| -rw-r--r-- | lib/util.ml | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/util.ml b/lib/util.ml index 66485d5a36..ee373120e2 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -123,8 +123,6 @@ module Stringmap = Map.Make(struct type t = string let compare = compare end) (* Lists *) -let list_add_set x l = if List.mem x l then l else x::l - let list_intersect l1 l2 = List.filter (fun x -> List.mem x l2) l1 @@ -267,6 +265,14 @@ let rec list_remove_first a = function | b::l -> b::list_remove_first a l | [] -> raise Not_found +let list_add_set x l = if List.mem x l then l else x::l + +let list_eq_set l1 l2 = + let rec aux l1 = function + | [] -> l1 = [] + | a::l2 -> aux (list_remove_first a l1) l2 in + try aux l1 l2 with Not_found -> false + let list_for_all2eq f l1 l2 = try List.for_all2 f l1 l2 with Failure _ -> false let list_map_i f = |
