🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #1135

Re: Arrays in Prolog

#1135
From: Lars-Henrik Eriksson
Date: Thu, 30 Aug 1990 07:34
30 lines
2021 bytes
In article <1421@quintus.UUCP> pds@quintus.UUCP (Peter Schachte) writes:
> writes:
> >First of all: it is nonesense to say that one should not use arrays
> >becauses it involves destructive assignment.
> 
> Hold on a minute.  What do arrays have to do with destructive assignment?
> It is perfectly possible to have arrays without having destructive
> assignment, and vice versa.

Mats Carlsson and Ken Kahns LM-Prolog system had an array implementation 
where you assigned array elements by creating a (conceptual) copy of the 
array with one element changed. The array primitives thus did not do any 
(visible) side effects. (Of course the arrays were not actually copied.)

Provided that once an array element had been set, the old version of the 
array was not used anymore, this scheme guaranteed constant time access and 
update of the arrays (with virtually no overhead). If older versions of an 
array was used, the access and update time increased linearly with the number 
of changes made since that version.

I haven't seen this or any array scheme with similar properties implemented 
in any other Prolog than LM-Prolog.

An article about this was presented at the 2nd international Logic 
Programming conference in Uppsala 1984.

Lars-Henrik Eriksson                           Internet: lhe@sics.se
Swedish Institute of Computer Science          Phone (intn'l): +46 8 752 15 09
Box 1263                                       Telefon (nat'l): 08 - 752 15 09
S-164 28  KISTA, SWEDEN
Technical Details
Message-ID: <1990Aug30.073456.2998@sics.se>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!mit-eddie!bloom-beacon!eru!hagbard!sunic!sics.se!sics.se!lhe
References: <90239.175243SCHMIED@DB0TUI11.BITNET> <1600024@otter.hpl.hp.com> <1421@quintus.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!mit-eddie!bloom-beacon!eru!hagbard!sunic!sics.se!sics.se!lhe
From: lhe@sics.se (Lars-Henrik Eriksson)
Newsgroups: comp.lang.prolog
Subject: Re: Arrays in Prolog
Message-ID: <1990Aug30.073456.2998@sics.se>
Date: 30 Aug 90 07:34:56 GMT
Sender: news@sics.se
Organization: Swedish Institute of Computer Science
Lines: 30
References: <90239.175243SCHMIED@DB0TUI11.BITNET> <1600024@otter.hpl.hp.com> <1421@quintus.UUCP>