[mercury-users] Problem with: Different clauses for different modes

Ondrej Bojar oboj7042 at ss1000.ms.mff.cuni.cz
Wed Sep 26 01:16:40 AEST 2001


Hi.

When trying to compile a predicate with different clauses for different
modes, I get this error:

dagorunify.m:140: In clause for predicate `dagorunify:unifies/2':
dagorunify.m:140:   in argument 1 of clause head:
dagorunify.m:140:   error: undefined symbol `::/2'.
dagorunify.m:140: In clause for predicate `dagorunify:unifies/2':
dagorunify.m:140:   in argument 1 of clause head:
dagorunify.m:140:   in argument 2 of functor `::/2':
dagorunify.m:140:   error: undefined symbol `in/0'.
...and so on for every :: used in the declaration clause.

Is something wrong with my code?

% Just test, whether the two fs fit together
% if only one fs is given, then it copies it to the other.
:- pred unifies(fs, fs).
:- mode unifies(in, in) is semidet.
:- mode unifies(out, in) is det.
:- mode unifies(in, out) is det.

:- pragma promise_pure(unifies/2).

unifies((FSA::in), (FSB::in)) :-
  cc_unify(FSA, FSB, _Result).
unifies(FSA::out, FSB::in) :- FSA = FSB.
unifies(FSA::in, FSB::out) :- FSA = FSB.

(:- pred cc_unify(fs::in, fs::in, fs::out) is semidet.)

Thanks for help,
  Andrew.

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