[m-rev.] for review: bug fix for try_all/2

Ian MacLarty maclarty at cs.mu.OZ.AU
Wed Dec 8 20:01:41 AEDT 2004


On 8 Dec 2004, at 18:50, Mark Brown wrote:
>
> @@ -141,8 +140,9 @@
>  	%	try_all(Goal, Results),
>  	%	std_util__unsorted_aggregate(Results, AccumulatorPred,
>  	%		Acc0, Acc)
> -	% except that operationally, the execution of try_all
> -	% and std_util__unsorted_aggregate is interleaved.
> +	% except that declaratively, the exception is placed at the end
> +	% of the list if it exists, and that operationally, the execution
> +	% of try_all and std_util__unsorted_aggregate is interleaved.

I don't think the bit about the the exception being placed at the end 
is relevant, since declaratively unsorted_aggregate doesn't apply the 
accumulator in any particular order.  Also I couldn't find a signature 
of unsorted_aggregate that matches the one here (i.e that takes a list 
as the first argument), so I suggest we change the declarative meaning 
to:

try_all(Goal, Results),
list.perm(Results, ShuffedResults),
list.foldl(AccumulatorPred, ShuffedResults, Acc0, Acc)

On another matter - why is the determinism of list.perm(in, out) 
nondet?  Surely it should be multi?

Ian.

--------------------------------------------------------------------------
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