[mercury-users] single-solution context

Martin Stein ms40 at inf.tu-dresden.de
Mon Oct 12 23:19:52 AEST 1998

Fergus Henderson wrote:
> This was discussed a bit on this list in October 1997.

Thank you, I only looked through the mails from 1998 and gave it up.

I'm getting a software-error because there's something not implemented but I
don't know exactly why. This somehow silly example should explain it:

:- type xx
        --->    zero
        ;       succ(xx)

:- pred add(xx,xx,xx).
:- mode add(in,in,out) is cc_nondet.
:- mode add(in,in,out) is nondet.

add(succ(X),Y,succ(Z)) :- add(X,Y,Z).
add(X,succ(Y),succ(Z)) :- add(X,Y,Z).

and somewhere in a goal
        Z1 = promise_only_solution(add(X,Y)),

this yields:

Software error: sorry, not implemented: taking address of pred
`add/2' with multiple modes.
(use an explicit lambda expression instead)

Due to the Reference Manual it should be possible to declare a predicate as
cc_nondet and nondet.
And how can I use a lambda expression here where semidet. is involved??

Martin Stein

More information about the users mailing list