[mercury-users] Hi, and determinism

Thomas Conway conway at cs.mu.OZ.AU
Mon Jan 29 12:23:45 AEDT 2001


On Mon, Jan 29, 2001 at 12:03:04PM EST, Richard A. O'Keefe wrote:
> In particular, higher-order predicates like list mapping want to inherit
> determinacy from their arguments in some such fashion.

In this instance, it would be very nice to have parametric polymorphism
for determinism, along with operators for deriving determinism from
parameters:
	can_fail(Det0) = Det1
	cannot_fail(Det0) = Det1
	succeeds_zero(Det0) = Det1
	succeeds_once(Det0) = Det1
	succeeds_many(Det0) = Det1
	committed_choice(Det0) = Det1

That way you could mode a predicate like list__filter in the following
way:

:- mode filter(in(pred(in, out) is Det), in, out) is cannot_fail(Det).

This corresponds to the following modes:
:- mode filter(in(pred(in, out) is det), in, out) is det.
:- mode filter(in(pred(in, out) is semidet), in, out) is det.
:- mode filter(in(pred(in, out) is multi), in, out) is multi.
:- mode filter(in(pred(in, out) is nondet), in, out) is multi.
(and other strange ones too, involving erroneous, failure, etc).

-- 
  Thomas Conway )O+
 <conway at cs.mu.oz.au>       499 User error! Replace user, and press any key.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list