[m-rev.] diff: set folds with six accumulators

Julien Fischer juliensf at csse.unimelb.edu.au
Sun Nov 14 03:48:27 AEDT 2010


Branches: main

Support folds over sets with six accumulators.

library/set.m:
library/set_bbbtree.m:
library/set_ctree234.m:
library/set_ordlist.m:
library/set_tree234.m:
library/set_unordlist.m:
 	As above.

library/list.m:
 	Add semidet modes for list.foldl6/14 with (mostly-) unique
 	accumulators.

NEWS:
 	Announce the above changes.

Julien.

Index: NEWS
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/NEWS,v
retrieving revision 1.542
diff -u -r1.542 NEWS
--- NEWS	9 Nov 2010 02:06:54 -0000	1.542
+++ NEWS	13 Nov 2010 15:53:49 -0000
@@ -30,7 +30,7 @@
      three lists and one folded value.

    + We added semidet modes with unique accumulators for list.foldl3/8,
-    list.foldl4/10, and list.foldl5/12.
+    list.foldl4/10, list.foldl5/12, and list.foldl6/14.

  * We have added the predicates divide/4 and divide_by_set/4 to the tree_bitset
    module of the standard library.
@@ -39,7 +39,7 @@

  * All of the modules in the standard library that implement the set ADT,
    (set, set_ordlist, set_unordlist, set_bbbtree, set_tree234,
-  and set_ctree234), now support folding over sets with up to five
+  and set_ctree234), now support folding over sets with up to six
    accumulators.  Modes that provide unique and mostly-unique accumulators
    for set fold have also been added.

Index: library/list.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/list.m,v
retrieving revision 1.198
diff -u -r1.198 list.m
--- library/list.m	9 Nov 2010 02:06:41 -0000	1.198
+++ library/list.m	13 Nov 2010 15:34:15 -0000
@@ -891,20 +891,29 @@
      in, out) is det,
      in, in, out, in, out, in, out, in, out, in, out, in, out) is det.
  :- mode list.foldl6(pred(in, in, out, in, out, in, out, in, out, in, out,
+    mdi, muo) is det,
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det.
+:- mode list.foldl6(pred(in, in, out, in, out, in, out, in, out, in, out,
+    di, uo) is det,
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is det.
+:- mode list.foldl6(pred(in, in, out, in, out, in, out, in, out, in, out,
      in, out) is cc_multi,
      in, in, out, in, out, in, out, in, out, in, out, in, out) is cc_multi.
  :- mode list.foldl6(pred(in, in, out, in, out, in, out, in, out, in, out,
+    di, uo) is cc_multi,
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is cc_multi.
+:- mode list.foldl6(pred(in, in, out, in, out, in, out, in, out, in, out,
      in, out) is semidet,
      in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet.
  :- mode list.foldl6(pred(in, in, out, in, out, in, out, in, out, in, out,
-    in, out) is nondet,
-    in, in, out, in, out, in, out, in, out, in, out, in, out) is nondet.
+    mdi, muo) is semidet,
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet.
  :- mode list.foldl6(pred(in, in, out, in, out, in, out, in, out, in, out,
-    di, uo) is det,
-    in, in, out, in, out, in, out, in, out, in, out, di, uo) is det.
+    di, uo) is semidet,
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet.
  :- mode list.foldl6(pred(in, in, out, in, out, in, out, in, out, in, out,
-    di, uo) is cc_multi,
-    in, in, out, in, out, in, out, in, out, in, out, di, uo) is cc_multi.
+    in, out) is nondet,
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is nondet.

      % list.foldl_corresponding(F, As, Bs, !Acc):
      % Does the same job as list.foldl, but works on two lists in
Index: library/set.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/set.m,v
retrieving revision 1.88
diff -u -r1.88 set.m
--- library/set.m	9 Nov 2010 02:06:41 -0000	1.88
+++ library/set.m	13 Nov 2010 15:31:14 -0000
@@ -335,6 +335,27 @@
  :- mode set.fold5(
      pred(in, in, out, in, out, in, out, in, out, di, uo) is semidet,
      in, in, out, in, out, in, out, in, out, di, uo) is semidet.
+
+:- pred set.fold6(pred(T, A, A, B, B, C, C, D, D, E, E, F, F), set(T),
+    A, A, B, B, C, C, D, D, E, E, F, F).
+:- mode set.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, in, out) is det, 
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is det.
+:- mode set.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det, 
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det.
+:- mode set.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, di, uo) is det, 
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is det.
+:- mode set.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet, 
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet.
+:- mode set.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet, 
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet.
+:- mode set.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet, 
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet.

      % set.divide(Pred, Set, TruePart, FalsePart):
      % TruePart consists of those elements of Set for which Pred succeeds;
@@ -576,6 +597,9 @@
  set.fold5(F, S, !A, !B, !C, !D, !E) :-
      list.foldl5(F, set.to_sorted_list(S), !A, !B, !C, !D, !E).

+set.fold6(F, S, !A, !B, !C, !D, !E, !F) :-
+    list.foldl6(F, set.to_sorted_list(S), !A, !B, !C, !D, !E, !F).
+
  set.divide(P, Set, TruePart, FalsePart) :-
      set_ordlist.divide(P, Set, TruePart, FalsePart).

Index: library/set_bbbtree.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/set_bbbtree.m,v
retrieving revision 1.33
diff -u -r1.33 set_bbbtree.m
--- library/set_bbbtree.m	9 Nov 2010 02:06:41 -0000	1.33
+++ library/set_bbbtree.m	13 Nov 2010 15:49:24 -0000
@@ -352,6 +352,28 @@
      pred(in, in, out, in, out, in, out, in, out, di, uo) is semidet, in,
      in, out, in, out, in, out, in, out, di, uo) is semidet.

+:- pred set_bbbtree.fold6(
+    pred(T1, T2, T2, T3, T3, T4, T4, T5, T5, T6, T6, T7, T7),
+    set_bbbtree(T1), T2, T2, T3, T3, T4, T4, T5, T5, T6, T6, T7, T7).
+:- mode set_bbbtree.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, in, out) is det, 
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is det.
+:- mode set_bbbtree.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det, 
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det.
+:- mode set_bbbtree.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, di, uo) is det, 
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is det.
+:- mode set_bbbtree.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet, 
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet.
+:- mode set_bbbtree.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet, 
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet.
+:- mode set_bbbtree.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet, 
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet.
+
  %------------------------------------------------------------------------------%
  %------------------------------------------------------------------------------%

@@ -1250,6 +1272,9 @@
  set_bbbtree.fold5(P, S, !A, !B, !C, !D, !E) :-
      list.foldl5(P, set_bbbtree.to_sorted_list(S), !A, !B, !C, !D, !E).

+set_bbbtree.fold6(P, S, !A, !B, !C, !D, !E, !F) :-
+    list.foldl6(P, set_bbbtree.to_sorted_list(S), !A, !B, !C, !D, !E, !F).
+
  %--------------------------------------------------------------------------%
  %--------------------------------------------------------------------------%
  % Ralph Becket <rwab1 at cam.sri.com> 24/04/99
Index: library/set_ctree234.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/set_ctree234.m,v
retrieving revision 1.12
diff -u -r1.12 set_ctree234.m
--- library/set_ctree234.m	9 Nov 2010 02:06:41 -0000	1.12
+++ library/set_ctree234.m	13 Nov 2010 15:43:41 -0000
@@ -307,6 +307,28 @@
      pred(in, in, out, in, out, in, out, in, out, di, uo) is semidet,
      in, in, out, in, out, in, out, in, out, di, uo) is semidet.

+:- pred set_ctree234.fold6(
+    pred(T1, T2, T2, T3, T3, T4, T4, T5, T5, T6, T6, T7, T7),
+    set_ctree234(T1), T2, T2, T3, T3, T4, T4, T5, T5, T6, T6, T7, T7).
+:- mode set_ctree234.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, in, out) is det,
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is det.
+:- mode set_ctree234.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det,
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det.
+:- mode set_ctree234.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, di, uo) is det,
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is det.
+:- mode set_ctree234.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet,
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet.
+:- mode set_ctree234.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet,
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet.
+:- mode set_ctree234.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet,
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet.
+
      % set_ctree234.divide(Pred, Set, TruePart, FalsePart):
      % TruePart consists of those elements of Set for which Pred succeeds;
      % FalsePart consists of those elements of Set for which Pred fails.
@@ -2463,6 +2485,53 @@
      Pred(E2, !A, !B, !C, !D, !E),
      set_ctree234.do_fold5_pred(Pred, T3, !A, !B, !C, !D, !E).

+set_ctree234.fold6(Pred, ct(_, Tin), !A, !B, !C, !D, !E, !F) :-
+    set_ctree234.do_fold6_pred(Pred, Tin, !A, !B, !C, !D, !E, !F).
+
+:- pred set_ctree234.do_fold6_pred(
+    pred(T1, T2, T2, T3, T3, T4, T4, T5, T5, T6, T6, T7, T7),
+    set_tree234(T1), T2, T2, T3, T3, T4, T4, T5, T5, T6, T6, T7, T7).
+:- mode set_ctree234.do_fold6_pred(
+    pred(in, in, out, in, out, in, out, in, out, in, out, in, out) is det,
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is det.
+:- mode set_ctree234.do_fold6_pred(
+    pred(in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det,
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det.
+:- mode set_ctree234.do_fold6_pred(
+    pred(in, in, out, in, out, in, out, in, out, in, out, di, uo) is det,
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is det.
+:- mode set_ctree234.do_fold6_pred(
+    pred(in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet,
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet.
+:- mode set_ctree234.do_fold6_pred(
+    pred(in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet,
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet.
+:- mode set_ctree234.do_fold6_pred(
+    pred(in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet,
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet.
+
+set_ctree234.do_fold6_pred(_Pred, empty, !A, !B, !C, !D, !E, !F).
+set_ctree234.do_fold6_pred(Pred, two(E, T0, T1), !A, !B, !C, !D, !E, !F) :-
+    set_ctree234.do_fold6_pred(Pred, T0, !A, !B, !C, !D, !E, !F),
+    Pred(E, !A, !B, !C, !D, !E, !F),
+    set_ctree234.do_fold6_pred(Pred, T1, !A, !B, !C, !D, !E, !F).
+set_ctree234.do_fold6_pred(Pred, three(E0, E1, T0, T1, T2), !A, !B,
+        !C, !D, !E, !F) :-
+    set_ctree234.do_fold6_pred(Pred, T0, !A, !B, !C, !D, !E, !F),
+    Pred(E0, !A, !B, !C, !D, !E, !F),
+    set_ctree234.do_fold6_pred(Pred, T1, !A, !B, !C, !D, !E, !F),
+    Pred(E1, !A, !B, !C, !D, !E, !F),
+    set_ctree234.do_fold6_pred(Pred, T2, !A, !B, !C, !D, !E, !F).
+set_ctree234.do_fold6_pred(Pred, four(E0, E1, E2, T0, T1, T2, T3), !A, !B,
+        !C, !D, !E, !F) :-
+    set_ctree234.do_fold6_pred(Pred, T0, !A, !B, !C, !D, !E, !F),
+    Pred(E0, !A, !B, !C, !D, !E, !F),
+    set_ctree234.do_fold6_pred(Pred, T1, !A, !B, !C, !D, !E, !F),
+    Pred(E1, !A, !B, !C, !D, !E, !F),
+    set_ctree234.do_fold6_pred(Pred, T2, !A, !B, !C, !D, !E, !F),
+    Pred(E2, !A, !B, !C, !D, !E, !F),
+    set_ctree234.do_fold6_pred(Pred, T3, !A, !B, !C, !D, !E, !F).
+
  %------------------------------------------------------------------------------%

  set_ctree234.map(Pred, ct(_, TreeA), SetB) :-
Index: library/set_ordlist.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/set_ordlist.m,v
retrieving revision 1.34
diff -u -r1.34 set_ordlist.m
--- library/set_ordlist.m	9 Nov 2010 02:06:41 -0000	1.34
+++ library/set_ordlist.m	13 Nov 2010 15:35:43 -0000
@@ -310,6 +310,27 @@
      pred(in, in, out, in, out, in, out, in, out, di, uo) is semidet, in,
      in, out, in, out, in, out, in, out, di, uo) is semidet.

+:- pred set_ordlist.fold6(pred(T, A, A, B, B, C, C, D, D, E, E, F, F),
+    set_ordlist(T), A, A, B, B, C, C, D, D, E, E, F, F).
+:- mode set_ordlist.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, in, out) is det, 
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is det.
+:- mode set_ordlist.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det, 
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det.
+:- mode set_ordlist.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, di, uo) is det, 
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is det.
+:- mode set_ordlist.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet, 
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet.
+:- mode set_ordlist.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet, 
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet.
+:- mode set_ordlist.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet, 
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet.
+
      % set_ordlist.divide(Pred, Set, TruePart, FalsePart):
      % TruePart consists of those elements of Set for which Pred succeeds;
      % FalsePart consists of those elements of Set for which Pred fails.
@@ -594,6 +615,9 @@
  set_ordlist.fold5(P, S, !A, !B, !C, !D, !E) :-
      list.foldl5(P, set_ordlist.to_sorted_list(S), !A, !B, !C, !D, !E).

+set_ordlist.fold6(P, S, !A, !B, !C, !D, !E, !F) :-
+    list.foldl6(P, set_ordlist.to_sorted_list(S), !A, !B, !C, !D, !E, !F).
+
  %-----------------------------------------------------------------------------%
  %-----------------------------------------------------------------------------%
  % Ralph Becket <rwab1 at cam.sri.com> 24/04/99
Index: library/set_tree234.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/set_tree234.m,v
retrieving revision 1.14
diff -u -r1.14 set_tree234.m
--- library/set_tree234.m	9 Nov 2010 02:06:42 -0000	1.14
+++ library/set_tree234.m	13 Nov 2010 15:39:10 -0000
@@ -291,6 +291,28 @@
      pred(in, in, out, in, out, in, out, in, out, di, uo) is semidet,
      in, in, out, in, out, in, out, in, out, di, uo) is semidet.

+:- pred set_tree234.fold6(
+    pred(T1, T2, T2, T3, T3, T4, T4, T5, T5, T6, T6, T7, T7),
+    set_tree234(T1), T2, T2, T3, T3, T4, T4, T5, T5, T6, T6, T7, T7).
+:- mode set_tree234.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, in, out) is det,
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is det.
+:- mode set_tree234.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det,
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det.
+:- mode set_tree234.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, di, uo) is det,
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is det.
+:- mode set_tree234.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet,
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet.
+:- mode set_tree234.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet,
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet.
+:- mode set_tree234.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet,
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet.
+
      % set_tree234.divide(Pred, Set, TruePart, FalsePart):
      % TruePart consists of those elements of Set for which Pred succeeds;
      % FalsePart consists of those elements of Set for which Pred fails.
@@ -2084,6 +2106,27 @@
      Pred(E2, !A, !B, !C, !D, !E),
      set_tree234.fold5(Pred, T3, !A, !B, !C, !D, !E).

+set_tree234.fold6(_Pred, empty, !A, !B, !C, !D, !E, !F).
+set_tree234.fold6(Pred, two(E, T0, T1), !A, !B, !C, !D, !E, !F) :-
+    set_tree234.fold6(Pred, T0, !A, !B, !C, !D, !E, !F),
+    Pred(E, !A, !B, !C, !D, !E, !F),
+    set_tree234.fold6(Pred, T1, !A, !B, !C, !D, !E, !F).
+set_tree234.fold6(Pred, three(E0, E1, T0, T1, T2), !A, !B, !C, !D, !E, !F) :-
+    set_tree234.fold6(Pred, T0, !A, !B, !C, !D, !E, !F),
+    Pred(E0, !A, !B, !C, !D, !E, !F),
+    set_tree234.fold6(Pred, T1, !A, !B, !C, !D, !E, !F),
+    Pred(E1, !A, !B, !C, !D, !E, !F),
+    set_tree234.fold6(Pred, T2, !A, !B, !C, !D, !E, !F).
+set_tree234.fold6(Pred, four(E0, E1, E2, T0, T1, T2, T3), !A, !B, !C, !D,
+        !E, !F) :-
+    set_tree234.fold6(Pred, T0, !A, !B, !C, !D, !E, !F),
+    Pred(E0, !A, !B, !C, !D, !E, !F),
+    set_tree234.fold6(Pred, T1, !A, !B, !C, !D, !E, !F),
+    Pred(E1, !A, !B, !C, !D, !E, !F),
+    set_tree234.fold6(Pred, T2, !A, !B, !C, !D, !E, !F),
+    Pred(E2, !A, !B, !C, !D, !E, !F),
+    set_tree234.fold6(Pred, T3, !A, !B, !C, !D, !E, !F).
+
  %------------------------------------------------------------------------------%

  set_tree234.map(Pred, SetA, SetB) :-
Index: library/set_unordlist.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/set_unordlist.m,v
retrieving revision 1.30
diff -u -r1.30 set_unordlist.m
--- library/set_unordlist.m	9 Nov 2010 02:06:42 -0000	1.30
+++ library/set_unordlist.m	13 Nov 2010 15:52:07 -0000
@@ -319,6 +319,28 @@
      pred(in, in, out, in, out, in, out, in, out, di, uo) is semidet, in,
      in, out, in, out, in, out, in, out, di, uo) is semidet.

+:- pred set_unordlist.fold6(
+    pred(T1, T2, T2, T3, T3, T4, T4, T5, T5, T6, T6, T7, T7),
+    set_unordlist(T1), T2, T2, T3, T3, T4, T4, T5, T5, T6, T6, T7, T7).
+:- mode set_unordlist.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, in, out) is det,
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is det.
+:- mode set_unordlist.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det,
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is det.
+:- mode set_unordlist.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, di, uo) is det,
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is det.
+:- mode set_unordlist.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet,
+    in, in, out, in, out, in, out, in, out, in, out, in, out) is semidet.
+:- mode set_unordlist.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet,
+    in, in, out, in, out, in, out, in, out, in, out, mdi, muo) is semidet.
+:- mode set_unordlist.fold6(
+    pred(in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet,
+    in, in, out, in, out, in, out, in, out, in, out, di, uo) is semidet.
+
      % set_unordlist.divide(Pred, Set, TruePart, FalsePart):
      % TruePart consists of those elements of Set for which Pred succeeds;
      % FalsePart consists of those elements of Set for which Pred fails.
@@ -485,6 +507,9 @@
  set_unordlist.fold5(P, S, !A, !B, !C, !D, !E) :-
      list.foldl5(P, set_unordlist.to_sorted_list(S), !A, !B, !C, !D, !E).

+set_unordlist.fold6(P, S, !A, !B, !C, !D, !E, !F) :-
+    list.foldl6(P, set_unordlist.to_sorted_list(S), !A, !B, !C, !D, !E, !F).
+
  %-----------------------------------------------------------------------------%
  %-----------------------------------------------------------------------------%
  % Ralph Becket <rwab1 at cam.sri.com> 24/04/99

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list