Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.prolog Subject: Re: Quintus Prolog Problem Message-ID: <4269@goanna.cs.rmit.oz.au> Date: 14 Nov 90 07:36:49 GMT References: <264@messina.cs.utexas.edu> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 21 In article , dowding@ai.sri.com (John Dowding) writes: > In article <264@messina.cs.utexas.edu> bradley@cs.utexas.edu (Bradley L. Richards) writes: >* As near as I can tell, setof and bagof don't work properly with the >* "recorded" predicate in Quintus Prolog (version 2.5.1, sun3-4.0). ... >* and then query: setof(X, recorded(woof, X, _), Set). > It is trickey. This would work: > setof(X, Ref^recorded(woof, X, Ref), Set) > Prolog doesn't have a true don't-care variable. The _ is really > just a shorthand for some particular variable that you haven't > bothered to name. Just to stress this: this behaviour has *nothing* to do with recorded/3 at all. setof/3 is in this instance behaving *exactly* the way it is *supposed* to work, and any Prolog giving different results _would_ have a bug. (See the last chapter in The Craft of Prolog, plug plug.) You may prefer to use findall/3. -- The problem about real life is that moving one's knight to QB3 may always be replied to with a lob across the net. --Alasdair Macintyre.