Compiling Prolog to Logic Virtual Machine

YF Wang,XN Li
DOI: https://doi.org/10.1109/ccece.1998.682748
1998-01-01
Abstract:The Logic Virtual Machine (LVM) is an efficient Prolog execution model consisting of a set of high-level instructions and a memory architecture for handling control and unification. Different from the well-known Warren's Abstract Machine which uses Structure Copying method, the LVM adopts a hybrid of Program Sharing and Structure Copying to represent first-order terms. In addition, the LVM employs a single stack paradigm for dynamical memory allocation and embeds an efficient garbage collection algorithm to reclaim useless memory cells. This paper will present the design of the LVM compiler - LVMC. It is developed to translate Prolog programs into LVM bytecode instructions. The compiler heavily depends on the input mode to generate optimized LVM code. It will extract the necessary properties, such as determinacy and garbage estimation, from source programs. At the implementation level, the LVMC carries out determinism transformation, garbage collection assistance, last argument dispatching, and some special optimizations. The first version of the LVMC (about 8000 lines of C code) has been developed. Some compiled programs have been tested under the LVM emulator. Benchmarks show that the LVM system is highly promising in memory utilization and performance.
What problem does this paper attempt to address?