home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / prolog / 2437 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.3 KB  |  34 lines

  1. Newsgroups: comp.lang.prolog
  2. Path: sparky!uunet!math.fu-berlin.de!informatik.tu-muenchen.de!lan!wunderwa
  3. From: wunderwa@informatik.tu-muenchen.de (Jens Wunderwa)
  4. Subject: Re: Help: making a binary predicate reversibly equal
  5. In-Reply-To: jssloka@monet.uwaterloo.ca's message of Sun, 24 Jan 1993 02:11:53 GMT
  6. References: <C1C63u.J6n@watserv1.uwaterloo.ca>
  7. Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem)
  8. Organization: Inst. fuer Informatik, TU Muenchen, Germany
  9. Date: Mon, 25 Jan 1993 15:13:09 GMT
  10. Message-ID: <WUNDERWA.93Jan25101309@sunradig1.informatik.tu-muenchen.de>
  11. Lines: 21
  12.  
  13. In article <C1C63u.J6n@watserv1.uwaterloo.ca> jssloka@monet.uwaterloo.ca (Scott Sloka) writes:
  14. >
  15. >   Howdy.  My name is Scott Sloka and I am an AI enthusiast at the University of
  16. >   Waterloo.  I have a list of facts such as: nextto(a,b) and I would like
  17. >   nextto(a,b) to be equivalent to nextto(b,a).  This does not work:
  18. >
  19. >   nextto(X,Y):-nextto(Y,X).
  20. >
  21. >   because an endless loop is set up.  I am just beginning Prolog programming
  22. >   because I am doing a project on abstraction and I would like to include this
  23. >   parameter switch equalization in my routines for some of my predicates.  Any
  24. >   pointers would be greatly appreciated.  Thanks in advance.
  25. >
  26. >           -Scott
  27.  
  28. Just define
  29.  
  30. nextto_sym(X,Y) :- nextto(X,Y).
  31. nextto_sym(X,Y) :- nextto(Y,X).
  32.  
  33. Ciao Jens
  34.