🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #1112

Re: Arrays in Prolog

#1112
From: R. Kym Horsell
Date: Tue, 28 Aug 1990 19:24
26 lines
1851 bytes
In article <1990Aug28.065353.13951@sics.se> roland@sics.se (Roland Karlsson) writes:
\\\
>> allows backtracking so that ``term'' may be restored to its
>> former state -- no destructuve assignment happens unless you
>> 	setarg(X,Y,Z), !.
>
>Setarg/3 is implemented in SICStus Prolog.  But 'setarg,!' will NOT
>lead to a destructive assignment.  The correct value is reinstalled
>att backtracking.  I would consider it a bug if it did so.

I *realize* setarg/3 is implemented in Sicstus and elsewhere -- I
wasn't trying to claim anything particularly original. My
comment about ``destructive'' assignment was meant to imply that
the assignment was not really permanent -- it was *normally* undone on
backtracking -- unless a ! was subsequently specified (I try
to keep away from terms like ``executed'' and ``performed'' in
preparation for the day we *really* have logic programming -- or
maybe this is a perfect reason for doing the opposite)?.

I was, however, under the impression that setarg/3 in Sicstus
(and certainly in my current compiler) edited the actual heap
structure that represented the PROLOG term. Why do you consider
it a bug if ``setarg(X,Y,Z),!'' DOES NOT remove the backtrack
point that restores the structure ``Y''?

-Kym Horsell
Technical Details
Message-ID: <3904@bingvaxu.cc.binghamton.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!usc!zaphod.mps.ohio-state.edu!rpi!leah!bingvaxu!vu0310
References: <90239.175243SCHMIED@DB0TUI11.BITNET> <3899@bingvaxu.cc.binghamton.edu> <1990Aug28.065353.13951@sics.se>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!usc!zaphod.mps.ohio-state.edu!rpi!leah!bingvaxu!vu0310
From: vu0310@bingvaxu.cc.binghamton.edu (R. Kym Horsell)
Newsgroups: comp.lang.prolog
Subject: Re: Arrays in Prolog
Message-ID: <3904@bingvaxu.cc.binghamton.edu>
Date: 28 Aug 90 19:24:52 GMT
References: <90239.175243SCHMIED@DB0TUI11.BITNET> <3899@bingvaxu.cc.binghamton.edu> <1990Aug28.065353.13951@sics.se>
Reply-To: vu0310@bingvaxu.cc.binghamton.edu.cc.binghamton.edu (R. Kym Horsell)
Organization: SUNY Binghamton, NY
Lines: 26