Looks like a homework problem, but might not be. First of all, there are
terms (x,4). Although such terms are valid in Prolog, they are not commonly
used. That is mostly because it is easy to get them misinterpreted for
term arguments. For example, (x,4) is in fact ','(x,4), but -(x,4) is not
-(','(x,4)) but indeed '-'(x,4), while - (x,4) is -(','(x,4)).
The normal general purpose binary relation is typically represented as
-(left,right) and as - is an infix operator, it can be written as
left-right.
Now, there is library(pairs) to do all sorts of useful things with pairs.
See
http://www.swi-prolog.org/pldoc/doc_for?object=pairs_keys_values/3
Cheers --- Jan
>
> Thank you very much
>
> James
>
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
swi-prolog+...@googlegroups.com
> <mailto:
swi-prolog+...@googlegroups.com>.