[mercury-users] determinism not satisfied
Terrence Brannon
tmbranno at oracle.com
Wed Jul 11 18:34:18 AEST 2001
If anyone could help me get this simple program to work, I would
appreciate it. Program and compilation error messages follow.
% p.14 "Clause and Effect" by William Clocksin
:- module border.
:- interface.
:- import_module io.
:- pred main(io__state::di, io__state::uo) is det.
:- implementation.
:- import_module std_util.
main -->
{ border("sussex",L) }, io__write_string(L).
border("sussex","kent").
border("sussex","surrey").
adjacent(X,Y) :- border(X,Y).
adjacent(X,Y) :- border(Y,X).
affordable(X,Y) :- adjacent(X,Z), adjacent(Z,Y).
[localhost:mercury/lexparse/border] metaperl% mmc --infer-all border.m
border.m:015: Inferred :- pred border(string, string).
border.m:018: Inferred :- pred adjacent(string, string).
border.m:021: Inferred :- pred affordable(string, string).
border.m:007: In `main(di, uo)':
border.m:007: error: determinism declaration not satisfied.
border.m:007: Declared `det', inferred `nondet'.
border.m:013: call to `border(di, uo)' can fail.
border.m:013: call to `border(di, uo)' can succeed more than once.
border.m:013: In clause for `main(di, uo)':
border.m:013: in argument 2 of call to predicate `io:write_string/3':
border.m:013: mode error: variable `DCG_0' has instantiatedness `mostly_unique',
border.m:013: expected instantiatedness was `unique'.
border.m:015: Inferred :- mode border(di, uo) is nondet.
For more information, try recompiling with `-E'.
[localhost:mercury/lexparse/border] metaperl%
--------------------------------------------------------------------------
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