[mercury-users] uniqueness
Mark Brown
mark at cs.mu.OZ.AU
Tue Jun 13 15:09:03 AEST 2006
On 13-Jun-2006, Julien Fischer <juliensf at cs.mu.OZ.AU> wrote:
>
>
> On Tue, 13 Jun 2006, Mark Brown wrote:
>
> > > % (
> > > % in_bounds(B1, X, Y),
> > > % format("(%d, %d) -> %d\n", [i(X), i(Y), i(B1 ^ elem(X, Y))], !IO) %
> > > problem 2
> > > % ),
>
> ...
>
> > > 2/ The commented out portion is rejected as well. I suspect this is
> > > because nondeterministic predicates are not allowed to perform IO, but the
> > > error message doesn't state it clearly.
> >
> > I guess that in_bounds/3 is nondet, and the error message you will get
> > would be along the lines of "main/2 is declared det, inferred nondet"
> > which pretty much covers the problem in its general form.
> >
>
> in_bounds/3 is semidet - it's counterpart bounds/3 is det.
Ah, right, it's in_bounds from the array2d module. In that case, there
will be a mode error since the last two arguments of in_bounds have
mode `in', and nothing else in the body of main/2 would produce values
for X and Y.
Cheers,
Mark.
--------------------------------------------------------------------------
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