Article View: comp.lang.prolog
Article #1132Re: Arrays in Prolog
From: David John Hawley
Date: Thu, 30 Aug 1990 00:40
Date: Thu, 30 Aug 1990 00:40
25 lines
1743 bytes
1743 bytes
In article <1990Aug29.095308.18522@sics.se> roland@sics.se (Roland Karlsson) writes:
>
>OK Kym. I am lost. I do not understand what you mean by ! making the
>destructive change made by setarg permanent. This is how it works
>in SICStus though.
I'm lost too. There seems to be some confusion between deleting choice-
points, and throwing away trail information. I thought that (*) trail
entries can only be thrown away when the trailed item is not accessible
at or above ANY choice point. As far as trailing is concerned, a cut
just "concatenates" segments of the trail corresponding to the choice-points
that are deleted (+ garbage collection for inaccessible items as noted above).
In the example
a(X) :- write(first - X), b(X).
a(X) :- write(second - X), c(X).
a ! inside b/1 will not remove the choice-point from a/1, and so
any trail entries for X (from setarg/* or $$anything else for that matter$$)
will remain after the cut.
Footnote: (*) Better (correct?) explanations from gurus are welcome.
---------------------------
David Hawley, ICOT, 4th Lab
csnet: hawley%icot.jp@relay.cs.net uucp:{enea,inria,mit-eddie,ukc}!icot!hawley
ICOT, 1-4-28 Mita, Minato-ku, Tokyo 108 JAPAN. TEL/FAX {81-3-456-}2514/1618
Technical Details
Message-ID:
<7463@icot32.icot.or.jp>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sun-barr!ccut!s.u-tokyo!rkna50!nttlab!icot32!hawleyReferences:
<1990Aug28.065353.13951@sics.se> <3904@bingvaxu.cc.binghamton.edu> <1990Aug29.095308.18522@sics.se>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sun-barr!ccut!s.u-tokyo!rkna50!nttlab!icot32!hawley From: hawley@icot32.icot.or.jp (David John Hawley) Newsgroups: comp.lang.prolog Subject: Re: Arrays in Prolog Message-ID: <7463@icot32.icot.or.jp> Date: 30 Aug 90 00:40:59 GMT References: <1990Aug28.065353.13951@sics.se> <3904@bingvaxu.cc.binghamton.edu> <1990Aug29.095308.18522@sics.se> Organization: Fifth Generation Computing Systems (ICOT), Tokyo, Japan Lines: 25