[mercury-users] Simple fact / deduction example, in mercury?

jdonner jdonner.spammenot at schedsys.com
Tue Jul 9 07:27:40 AEST 2002


   I'm dabbling in prolog (& Haskell) and was attracted to
mercury, but I'm finding documentation thin on simple facts
/ deductions.

   Can anyone give me a simple, fact / deduction example?
Something as simple as a bunch of parent(a, b) facts,
and an ancestor function, would be great.

Thanks for any help,


(note the spam guard in the return address)

Here was my first malformed attempt:

:- module ancestry.
:- interface.
%:- import_module io.
%:- pred main(io__state, io__state).
%:- mode main(di, uo) is det.
:- pred parent(in, in).
:- mode parent(in, in) is nondet.
:- implementation.

:- parent(jim, dave) = true.
:- parent(dave, bill) = true.
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