home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.prolog
- Path: sparky!uunet!haven.umd.edu!decuac!pa.dec.com!decprl!decprl!vanroy
- From: vanroy@prl.dec.com (Peter Van Roy)
- Subject: Re: Term comparisons w/ variables (and GC)
- Message-ID: <1992Jul21.075634.16789@prl.dec.com>
- Sender: news@prl.dec.com (USENET News System)
- Nntp-Posting-Host: prl332.prl.dec.com
- Organization: Digital Equipment Corporation - Paris Research Laboratory
- References: <1992Jul20.174202.12993@cs.sfu.ca>
- Date: Tue, 21 Jul 1992 07:56:34 GMT
- Lines: 29
-
- In article <1992Jul20.174202.12993@cs.sfu.ca>, gregory@cs.sfu.ca (Gregory Sidebottom) writes:
- > In article <1992Jul20.083703.18058@prl.dec.com> vanroy@prl.dec.com (Peter Van Roy) writes:
- >
- > In article <1992Jul17.152828.3861@cs.kuleuven.ac.be>, bimbart@cs.kuleuven.ac.be (Bart Demoen) writes:
- > >
- > > The implementation of ProLog by BIM has no "unsafe" variables
- >
- > Aquarius Prolog does not have unsafe variables either.
- >
- > I am curious, what does it mean for a Prolog to not have unsafe
- > variables. Does this mean the compiler never uses the put_variable
- > instruction? Is a different instruction used in certain cases? What
- > about unsafe variables nested in structures? Do 'safe' Prologs use
- > more heap space? Can somebody please clarify this for me?
- >
- > Greg
-
- Consider the two main stacks in a typical Prolog implementation: the local
- stack (or "stack") which I will assume contains both environments and choice
- points, and the global stack (or "heap") which contains all compound terms.
-
- In Aquarius, the only kinds of pointers allowed are from the stack to the
- heap and from the heap to the heap. In other words, there are no pointers
- from the stack to the stack, and therefore no unbound variables on the stack.
- It is only these variables that are sometimes "unsafe", i.e. that have to be
- moved to the heap (or "globalized") to avoid pointing to a deallocated piece
- of stack.
-
- Peter
-