[mercury-users] more Mercury homework: "Mercuryfy" some simple Prolog

Tomas By tomas at basun.net
Fri Sep 24 04:30:55 AEST 2010

(I don't have AOP handy).

On Thu, September 23, 2010 16:30, Jean-Marc Vanel wrote:
>         uncle(Uncle,Person) :-
>                 brother(Uncle,Parent), parent(Parent,Person).
> [...]
> But, then, what to put in the implementation [...] ?

| :- person == string.


> Error: no clauses for predicate `brother'/2.
> Let's suppose that brother/2 is provided by external facts .

No, you can't just suppose that and not tell the compiler.

Either you have to provide a bunch of clauses, eg

| brother("a","b").

or do what I said in my first mail about a data file. Then there is
a third possibility if you look at secion 19.1 in the reference manual
("fact tables"), but I don't think that is of any interest here.


mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au

More information about the users mailing list