🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #2962

Question: Lists or Assert?

#2962
From: Jeff De Vries
Date: Fri, 05 Feb 1988 19:57
16 lines
1306 bytes
I needed to do a breadth-first search in Prolog, so being the naturally lazy
person that I am, I started to look through some Prolog books to see if they
had an example program I could just copy.  I noticed that one author used 
lists to maintain which nodes still needed to be expanded, while another
author used assert/1 (and retract/1) to maintain those nodes.  Since I am
not into Prolog internals, I was wondering about the ramifications of the two
approaches.  Is one approach going to be, in general, faster than the other,
(my gut feeling is that the list approach would be faster, but...)?  Are there
occasions where dynamic assertions are the way to go?  Are there things that
you can do with assertions that you can't do with lists?

Thanks!

Jeff De Vries (jdevries@ads.com or jdevries@ads.arpa)
Advanced Decision Systems
Disclaimer: I am speaking for myself, and not ADS.
Technical Details
Message-ID: <2207@zodiac.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-lcc!mordor!sri-spam!zodiac!jdevries

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-lcc!mordor!sri-spam!zodiac!jdevries
From: jdevries@zodiac.ads.com (Jeff De Vries)
Newsgroups: comp.lang.prolog
Subject: Question: Lists or Assert?
Message-ID: <2207@zodiac.UUCP>
Date: 5 Feb 88 19:57:39 GMT
Sender: news@zodiac.UUCP
Reply-To: jdevries@ads.com (Jeff De Vries)
Organization: Advanced Decision Systems, Mt. View, CA (415) 941-3912
Lines: 15