| OCR Text |
Show APPENDIX A AN EXTENDED WAM INSTRUCTION SET This appendix contains descriptions of the Extended Warren Abstract Machine (EWAM) instruction set generated by the Extended PLM (EPLM) compiler for Boplog. It seiVes the same purpose as s1milar descriptions in [53], [52]. and [20]. Instead of textual descriptions, the actual code executed by Boplog processes is presented. The code should be compared with the instruction descriptions in other documents for a more complete understanding of their meanings. Some instructions are handled with c macros; most are handled by a short macro which expands into a c function call. The macros are presented first, in alphabetical order, followed by the code for the functions. Both the macros and the functions use several auxillacy functions and macros. Most of these are selfexplanatory; some important ones are: • deref (A) (function) disambiguates and dereferences the A, assumed to be a reference. It returns a reference to the correct binding for A. • push_area (area, nbytes) (function) extends the stack area referenced by area by nbytes bytes. It increments the value of area and returns a reference to the beginning of an area nbytes long. • heap_constant (value) (function) pushes the constant value onto the heap using push_area. • REFOFY {Y) (macro) returns a reference to the yth value cell of the current enviromnent. • unify ( rl, r2) (function) attempts to unify the terms referenced by rl and r2. It returns FALSE if unsuccessful, and a reference to the resolvent (usually either rl or r2) if successful. • varbind (rl, r2) (function) binds the value cell referenced by rl to r2. • RSMASH ( r, s) (macro) places the SAR value indicated by the reference |