compiling prolog to logic-inference virtual machine
abstract
the logic-inference virtual machine (lvm) is a new prolog execution model
consisting of a set of high-level instructions and memory architecture for handling control
and unification. different from the well-known warren's abstract machine [1], which uses
structure copying method, the lvm adopts a hybrid of program sharing [2] and
structure copying to represent first-order terms. in addition, the lvm employs a single
stack paradigm for dynamic memory allocation and embeds a very efficient garbage
collection algorithm to reclaim the useless memory cells. in order to construct a complete
prolog system based on the lvm, a corresponding compiler must be written.
in this thesis, a design of such lvm compiler is presented and all important
components of the compiler are described. the lvm compiler is developed to translate
prolog programs into lvm bytecode instructions, so that a prolog program is compiled
once and can run anywhere.
the first version of lvm compiler (about 8000 lines of c code) has been
developed. the compilation time is approximately proportional to the size of source
codes. about 80 percent of the time are spent on the global analysis. some compiled
programs have been tested under a lvm emulator. benchmarks show that the lvm
system is very promising in memory utilization and performance.
collections
- retrospective theses [1604]