diff options
| author | herbelin | 2007-09-04 09:05:32 +0000 |
|---|---|---|
| committer | herbelin | 2007-09-04 09:05:32 +0000 |
| commit | 0f365a09ce2cb8fc29f7177fe738ec1035d9ef0e (patch) | |
| tree | 932250558b392d229214e09597619339b9457c19 /lib/util.ml | |
| parent | 6e58d190a40f27b8e2039c4063523f9f3e62215b (diff) | |
Utilisation d'un nouvel algorithme plus raffiné pour prendre en compte les
alias de variables dans la fonction d'inversion des instance (real_clean):
- détection des cas d'inversions distinctes incompatibles
- nouvelle heuristique lorsque plusieurs inversions distinctes mais
compatibles existent
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10111 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/util.ml')
| -rw-r--r-- | lib/util.ml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml index 7e59d1474c..1d1c5e060b 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -378,6 +378,14 @@ let rec list_split3 = function | (x,y,z)::l -> let (rx, ry, rz) = list_split3 l in (x::rx, y::ry, z::rz) +let rec list_insert_in_class f a = function + | [] -> [[a]] + | (b::_ as l)::classes when f a b -> (a::l)::classes + | l::classes -> l :: list_insert_in_class f a classes + +let list_partition_by f l = + List.fold_right (list_insert_in_class f) l [] + let list_firstn n l = let rec aux acc = function | (0, l) -> List.rev acc |
