Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!mips!bridge2!jarthur!elroy.jpl.nasa.gov!decwrl!shelby!neon!feldman From: feldman@Neon.Stanford.EDU (Todd J. Feldman) Newsgroups: comp.lang.prolog Subject: HELP!!! Please! Summary: Help with simple Prolog fragment Message-ID: <1990Mar1.210219.5687@Neon.Stanford.EDU> Date: 1 Mar 90 21:02:19 GMT Sender: Todd J. Feldman (feldman@neon.stanford.edu) Organization: Computer Science Department, Stanford University Lines: 35 Can someone please help me with a bug in the following Prolog fragment: process_entries:- wait(X), abolish(wait,1), goal1(.....), goal2(.....), goal3(.....), goal4(.....). The intention I had in writing this code was for backtracking to occur between goals 1 and 4. Finally, goal1 will no longer be able to succeed. When it fails, I want backtracking to go to wait(X); as long as there is at least one wait fact (wait is not a rule; just facts) in the database, abolish them all, and begin with goal1 again; the existence of the wait facts is what caused goal1 to fail in the first place. In doing some amount of tracing, I've discovered that goal1 is failing as expected, the abolish is not backtracked to as expected, but that wait(X) is not resucceeding; it fails immediately on backtracking EVEN THOUGH THERE ARE SEVERAL wait(...) facts in the database! Any ideas? I'll be happy to provide more information if it would be helpful, and I'd be very grateful for any help you can give me! Thanks! Todd Feldman feldman@neon.stanford.edu -- wewewe 2323232