Article View: comp.lang.prolog
Article #2412Re: Help: making a binary predicate reversibly equal
From: Jens Wunderwa
Date: Mon, 25 Jan 1993 15:13
Date: Mon, 25 Jan 1993 15:13
21 lines
1391 bytes
1391 bytes
In article <C1C63u.J6n@watserv1.uwaterloo.ca> jssloka@monet.uwaterloo.ca (Scott Sloka) writes: > > Howdy. My name is Scott Sloka and I am an AI enthusiast at the University of > Waterloo. I have a list of facts such as: nextto(a,b) and I would like > nextto(a,b) to be equivalent to nextto(b,a). This does not work: > > nextto(X,Y):-nextto(Y,X). > > because an endless loop is set up. I am just beginning Prolog programming > because I am doing a project on abstraction and I would like to include this > parameter switch equalization in my routines for some of my predicates. Any > pointers would be greatly appreciated. Thanks in advance. > > -Scott Just define nextto_sym(X,Y) :- nextto(X,Y). nextto_sym(X,Y) :- nextto(Y,X). Ciao Jens
Technical Details
Message-ID:
<WUNDERWA.93Jan25101309@sunradig1.informatik.tu-muenchen.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!informatik.tu-muenchen.de!lan!wunderwaReferences:
<C1C63u.J6n@watserv1.uwaterloo.ca>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.prolog Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!informatik.tu-muenchen.de!lan!wunderwa From: wunderwa@informatik.tu-muenchen.de (Jens Wunderwa) Subject: Re: Help: making a binary predicate reversibly equal In-Reply-To: jssloka@monet.uwaterloo.ca's message of Sun, 24 Jan 1993 02:11:53 GMT References: <C1C63u.J6n@watserv1.uwaterloo.ca> Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem) Organization: Inst. fuer Informatik, TU Muenchen, Germany Date: Mon, 25 Jan 1993 15:13:09 GMT Message-ID: <WUNDERWA.93Jan25101309@sunradig1.informatik.tu-muenchen.de> Lines: 21