Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!husc6!bunny!slzr From: slzr@GTE.COM (Suzanne Sluizer) Newsgroups: comp.lang.prolog Subject: Re: retractall and backtracking Keywords: Quintus, retract, backtracking Message-ID: <7056@bunny.GTE.COM> Date: 9 Jun 89 19:51:20 GMT References: <575@hfserver.hfnet.bt.co.uk> Reply-To: slzr@bunny.UUCP (Suzanne Sluizer) Followup-To: comp.lang.prolog Distribution: comp Organization: GTE Laboratories, Waltham, MA Lines: 30 In article <575@hfserver.hfnet.bt.co.uk> nigel@hfserver.hfnet.bt.co.uk (Nigel Cliffe) writes: > >I have a problem with backtracking, and retracts that don't appear to >happen - here is a simplified example: [deleted example of retracting something that you are backtracking over] >Can anyone explain why this happens. I would imagine that you will get much more technical explanations than I could give you, from various net people. However, I can give you a very simple idea of why Prolog isn't handling this. Your problem comes from the fact that by retracting something that you are backtracking over, Prolog gets "confused". Basically, Prolog loses track of "foo(X)" when you retract it, which makes it impossible to properly resatisfy that goal. You are lucky that you're using a robust Prolog -- it is possible to get "bus errors" and "core dumps" if Prolog doesn't handle this situation gracefully. -- Suzanne Sluizer CSNET: slzr%gte.com@RELAY.CS.NET GTE Laboratories UUCP: ...!harvard!bunny!slzr 617-466-2882 "Truth is a pathless land." -- Krishnamurti