Article View: comp.lang.prolog
Article #1171Who allocates space for perm vars on stack ?
From: Naim Abdullah
Date: Sat, 08 Sep 1990 01:17
Date: Sat, 08 Sep 1990 01:17
34 lines
1494 bytes
1494 bytes
I have been trying to understand the WAM by reading "The WAM: A (Real)
Tutorial" by Hassan Ait-Kaci (it is a technical report from DEC's Paris
Research Labs). One of the things that I am puzzled about is which
WAM instruction is responsible for storing the permanent variables
in the environment when a new rule is called.
The situation is illustrated by the following:
foo(args) :- ...., bar(args),....
This is translated to:
foo: allocate
get args of foo
..code for predicates before bar...
put args of bar
call bar/arity, N
...code for predicates after bar...
proceed
bar: allocate
get args of bar
...code for bar's body..
proceed
Now the number of permanent variables in bar is not necessarily equal to
its arity. In both Warren's original paper and the WAM tutorial referenced
above, the description of allocate does not seem to reserve space for the
permanent variables. So my question is which instruction allocates the space
for bar's permanent variables ?
Thank you.
Naim
Technical Details
Message-ID:
<10942@uswat.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!ub!boulder!uswat!naimShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!ub!boulder!uswat!naim From: naim@uswat.uswest.com (Naim Abdullah) Newsgroups: comp.lang.prolog Subject: Who allocates space for perm vars on stack ? Message-ID: <10942@uswat.UUCP> Date: 8 Sep 90 01:17:57 GMT Sender: news@uswat.UUCP Organization: US WEST Advanced Technologies, CO, USA Lines: 34