179 research outputs found
Incremental copying garbage collection for WAM-based Prolog systems
The design and implementation of an incremental copying heap garbage
collector for WAM-based Prolog systems is presented. Its heap layout consists
of a number of equal-sized blocks. Other changes to the standard WAM allow
these blocks to be garbage collected independently. The independent collection
of heap blocks forms the basis of an incremental collecting algorithm which
employs copying without marking (contrary to the more frequently used mark©
or mark&slide algorithms in the context of Prolog). Compared to standard
semi-space copying collectors, this approach to heap garbage collection lowers
in many cases the memory usage and reduces pause times. The algorithm also
allows for a wide variety of garbage collection policies including generational
ones. The algorithm is implemented and evaluated in the context of hProlog.Comment: 33 pages, 22 figures, 5 tables. To appear in Theory and Practice of
Logic Programming (TPLP
Delimited continuations for Prolog
Delimited continuations are a famous control primitive that originates in the functional programming world. It allows the programmer to suspend and capture the remaining part of a computation in order to resume it later. We put a new Prolog-compatible face on this primitive and specify its semantics by means of a meta-interpreter. Moreover, we establish the power of delimited continuations in Prolog with several example definitions of high-level language features. Finally, we show how to easily and effectively add delimited continuations support to the WAM
SICStus MT - A Multithreaded Execution Environment for SICStus Prolog
The development of intelligent software agents and other
complex applications which continuously interact with their
environments has been one of the reasons why explicit concurrency has
become a necessity in a modern Prolog system today. Such applications
need to perform several tasks which may be very different with respect
to how they are implemented in Prolog. Performing these tasks
simultaneously is very tedious without language support.
This paper describes the design, implementation and evaluation of a
prototype multithreaded execution environment for SICStus Prolog. The
threads are dynamically managed using a small and compact set of
Prolog primitives implemented in a portable way, requiring almost no
support from the underlying operating system
Cache performance of chronological garbage collection
This thesis presents cache performance analysis of the Chronological Garbage Collection
Algorithm used in LVM system. LVM is a new Logic Virtual Machine for Prolog. It
adopts one stack policy for all dynamic memory requirements and cooperates with an
efficient garbage collection algorithm, the Chronological Garbage Collection, to recycle
space, not as a deliberate garbage collection operation, but as a natural activity of the
LVM engine to gather useful objects. This algorithm combines the advantages of the
traditional copying, mark-compact, generational, and incremental garbage collection
schemes.
In order to determine the improvement of cache performance under our garbage-
collection algorithm, we developed a simulator to do trace-driven cache simulation.
Direct-mapped cache and set-associative cache with different cache sizes, write policies,
block sizes and set associativities are simulated and measured. A comparison of LVM
and SICStus 3.1 for the same benchmarks was performed.
From the simulation results, we found important factors influencing the
performance of the CGC algorithm. Meanwhile, the results from the cache simulator fully
support the experimental results gathered from the LVM system: the cost of CGC Is
almost paid by the improved cache performance. Further, we found that the memory
reference patterns of our benchmarks share the same properties: most writes are for
allocation and most reads are to recently written objects. In addition, the results also
showed that the write-miss policy can have a dramatic effect on the cache performance of
the benchmarks and a write-validate policy gives the best performance. The comparison
shows that when the input size of benchmarks is small, SICStus is about 3-8 times faster
than LVM. This is an acceptable range of performance ratio for comparing a binary-code
engine against a byte-code emulator. When we increase the input sizes, some benchmarks
maintain this performance ratio, whereas others greatly narrow the performance gap and
at certain breakthrough points perform better than their counterparts under SICStus
Compiler architecture using a portable intermediate language
The back end of a compiler performs machine-dependent tasks and low-level optimisations that are laborious to implement and difficult to debug. In addition, in languages that require run-time services such as garbage collection, the back end must interface with the run-time system to provide
those services. The net result is that building a compiler back end entails a high implementation cost.
In this dissertation I describe reusable code generation infrastructure that enables the construction of a complete programming language implementation (compiler and run-time system) with reduced effort. The infrastructure consists of a portable intermediate language, a compiler for this language and a low-level run-time system. I provide an implementation of this system and I show that it can support a variety of source programming languages, it reduces the overall eort required to implement a programming
language, it can capture and retain information necessary to support run-time services and optimisations, and it produces efficient code
- …