[m-rev.] New modes for unsorted_aggregate
Julien Fischer
juliensf at cs.mu.OZ.AU
Tue Jul 19 15:57:34 AEST 2005
On Wed, 6 Jul 2005, Ralph Becket wrote:
>
> Estimated hours taken: 0.2
> Branches: main, release
>
> library/std_util.m:
> Added cc_multi options to the accumulator pred argument of
> unsorted_aggregate.
> Fixed up some comment formatting.
>
That also requires the following, otherwise the library won't compile.
Estimated hours taken: 0.2
Branches: main, release
library/std_util.m:
Add new modes to builtin_aggregate/4 and non_cc_call/4
so that the new modes to aggregate that Ralph added
compile.
Index: std_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/std_util.m,v
retrieving revision 1.300
diff -u -r1.300 std_util.m
--- std_util.m 19 Jul 2005 00:27:43 -0000 1.300
+++ std_util.m 19 Jul 2005 05:51:30 -0000
@@ -831,6 +831,8 @@
in, out) is det. /* really cc_multi */
:- mode builtin_aggregate(pred(out) is multi, pred(in, di, uo) is det,
di, uo) is det. /* really cc_multi */
+:- mode builtin_aggregate(pred(out) is multi, pred(in, in, out) is cc_multi,
+ in, out) is det. /* really cc_multi */
:- mode builtin_aggregate(pred(out) is multi, pred(in, di, uo) is cc_multi,
di, uo) is det. /* really cc_multi */
:- mode builtin_aggregate(pred(muo) is multi, pred(mdi, di, uo) is det,
@@ -841,6 +843,8 @@
di, uo) is det. /* really cc_multi */
:- mode builtin_aggregate(pred(out) is nondet, pred(in, in, out) is det,
in, out) is det. /* really cc_multi */
+:- mode builtin_aggregate(pred(out) is nondet, pred(in, in, out) is cc_multi,
+ in, out) is det. /* really cc_multi */
:- mode builtin_aggregate(pred(muo) is nondet, pred(mdi, di, uo) is det,
di, uo) is det. /* really cc_multi */
@@ -988,12 +992,16 @@
% even when the called predicate is cc_multi.
:- impure pred non_cc_call(pred(T, Acc, Acc), T, Acc, Acc).
:- mode non_cc_call(pred(in, in, out) is det, in, in, out) is det.
+:- mode non_cc_call(pred(in, in, out) is cc_multi, in, in, out) is det.
:- mode non_cc_call(pred(in, di, uo) is det, in, di, uo) is det.
:- mode non_cc_call(pred(in, di, uo) is cc_multi, in, di, uo) is det.
:- mode non_cc_call(pred(mdi, di, uo) is det, mdi, di, uo) is det.
non_cc_call(P::pred(in, in, out) is det, X::in, Acc0::in, Acc::out) :-
P(X, Acc0, Acc).
+non_cc_call(P::pred(in, in, out) is cc_multi, X::in, Acc0::in, Acc::out) :-
+ Pred = (pred(Soln::out) is cc_multi :- P(X, Acc0, Soln)),
+ impure Acc = builtin.get_one_solution(Pred).
non_cc_call(P::pred(in, di, uo) is cc_multi, X::in, Acc0::di, Acc::uo) :-
impure builtin__get_one_solution_io(
(pred({}::out, di, uo) is cc_multi --> P(X)),
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list