Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!ihnp4!zehntel!hplabs!sri-unix!SHardy@SRI-KL From: SHardy@SRI-KL@sri-unix.UUCP Newsgroups: net.lang.prolog Subject: Bagof Message-ID: <12419@sri-arpa.UUCP> Date: Mon, 17-Oct-83 00:17:17 EDT Article-I.D.: sri-arpa.12419 Posted: Mon Oct 17 00:17:17 1983 Date-Received: Tue, 18-Oct-83 03:42:13 EDT Lines: 38 How does one decide what Bagof or Assert/Retract should do? Recently, I read of a new implementation of Prolog. It had an exciting new lazy evaluation mode. It could outperform DEC-10 Prolog. What is more, it had access to all sorts of good things like screen editors and windows. Unfortunately, its definition of Bagof was ``wrong'', that is didn't agree with the definition of Bagof on the DEC-20. Actually, this doesn't bother me since I think DEC-20 Prolog has it wrong. As Richard says, it depends on what one thinks should happen to calls like: ?- bagof(X, likes(X, Y), LIKERS). Should LIKERS be the bag of all Xs that like anything or should it be the bag of all Xs that like the same thing with failure generating a new set? The interpretation I prefer is the first; it should be the set of all Xs who like anything. I understand how others may disagree with my preference. I don't understand how one could think one interpretation ``objectively'' right and the other wrong. There is just a little Edinburgh imperialism underlying Richard's messages ! -- Steve, Teknowledge PS: it is a mistake to have Assert/Retract modify the behaviour of currently active procedure calls. That's why the Newpay example is so hard in DEC-10 Prolog. The solution is to change DEC-10 Prolog.