Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!cs.utexas.edu!usc!randvax!narain From: narain@randvax.UUCP (Sanjai Narain) Newsgroups: comp.lang.prolog Subject: Re: Why is bagof so slow? Keywords: bagof, setof Message-ID: <2559@randvax.UUCP> Date: 29 May 90 21:57:45 GMT References: <2556@randvax.UUCP> <3086@goanna.cs.rmit.oz.au> Organization: Rand Corp., Santa Monica, Ca. Lines: 17 I thank Alain Callebaut and Richard O'Keefe for quite useful answers to my query about bagof. The problem arose in the implementation of a simulation technique in Prolog. A model consists of causality rules, roughly of the form: A causes B if C Given that an event E has occurred, one needs to compute the set of all F such that E causes F. It turns out that in important cases the use of setof (or bagof) can be eliminated. This has yielded a speedup of 20 for our current model. Regards. Sanjai