[mercury-users] Making (cc_)multi into det?

Ralph Becket rbeck at microsoft.com
Thu Aug 23 01:42:57 AEST 2001

> From: Ondrej Bojar [mailto:oboj7042 at ss1000.ms.mff.cuni.cz]
> Sent: 22 August 2001 15:58
> Is there a way to change (cc_)multi into det?

The builtin function promise_only_solution/1 is used for this.

> The reason to do is simple: I have a predicate, that can succeed more
> once. But I whould like to get any of the solutions and use it in a
> predicate, that is otherwise det. And I don't want mercury to
> the truth about multiple solutions further.

You have to be careful with this sort of thing: if you lie to the
compiler you'll come a cropper eventually.  That said, there's no
operational difference between cc_multi and det.

Propagating cc_nondet/cc_multi usually isn't as big a pain as you 

> ...I want a "simple" solution to a complex question and I don't like
> hear all the truth... :-)
> Can I wrap the inner multi-solution predicate into something that
> make it look like "det"?

Tut tut!  Bad form unless your pred really is det.

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