[mercury-users] determinism declaration not satisfied

Terrence Brannon tmbranno at oracle.com
Thu Jul 12 07:49:32 AEST 2001


I have implemented all the suggestions I received on this, but am
still having one final error. main must be det or cc_multi, but
neither choice results in successful compilation.

Thanks again for the help. By the time you are ready to write the
Mercury books, I should have probed every corner that a LP neophyte
possibly could. And this should make things easier for both parties
... the writers and the readers. 

[localhost:lexparse/border/fixed] metaperl% ls -l
total 8
-rw-r--r--  1 metaperl  staff  890 Jul 11 14:38 border.m
[localhost:lexparse/border/fixed] metaperl% mmake border.depend
mmc --generate-dependencies --grade none.gc         border
[localhost:lexparse/border/fixed] metaperl% mmake border
rm -f border.c
mmc --compile-to-c --grade none.gc         border.m > border.err 2>&1
gmake: *** [border.c] Error 1
[localhost:lexparse/border/fixed] metaperl% cat border.err
border.m:007: In `main(di, uo)':
border.m:007:   error: determinism declaration not satisfied.
border.m:007:   Declared `cc_multi', inferred `cc_nondet'.
border.m:013:   call to `border(in, out)' can fail.
For more information, try recompiling with `-E'.
[localhost:lexparse/border/fixed] metaperl% cat border.m
% p.14 "Clause and Effect" by William Clocksin

:- module border.
:- interface.
:- import_module io.

:- pred main(io__state::di, io__state::uo) is cc_multi.

:- implementation.
:- import_module std_util.

main -->
	{ border("sussex",L) }, io__write_string(L).

:- pred border(string, string).
:- mode border(in, out) is nondet.
:- mode border(out, in) is nondet.

border("sussex","kent").
border("sussex","surrey").
border("surrey","kent").
border("hampshire","sussex").
border("hampshire","surrey").
border("hampshire","berkshire").
border("berkshire","surrey").
border("wiltshire","hampshire").
border("wiltshire","berkshire").

:- pred adjacent(string, string).
:- mode adjacent(in, out) is nondet.

adjacent(X,Y) :- border(X,Y).
adjacent(X,Y) :- border(Y,X).

:- pred affordable(string, string).
:- mode affordable(in, out) is nondet.

affordable(X,Y) :- adjacent(X,Z), adjacent(Z,Y).

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