home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / prolog / 1428 next >
Encoding:
Text File  |  1992-07-20  |  1.9 KB  |  42 lines

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