Hostname: page-component-89b8bd64d-j4x9h Total loading time: 0 Render date: 2026-05-10T16:31:22.059Z Has data issue: false hasContentIssue false

Description and Optimization of Abstract Machines in a Dialect of Prolog*

Published online by Cambridge University Press:  05 January 2015

JOSÉ F. MORALES
Affiliation:
IMDEA Software Institute, Madrid, Spain (e-mail: josef.morales@imdea.org, manuel.carro@imdea.org, manuel.hermenegildo@imdea.org)
MANUEL CARRO
Affiliation:
IMDEA Software Institute, Madrid, Spain (e-mail: josef.morales@imdea.org, manuel.carro@imdea.org, manuel.hermenegildo@imdea.org) School of Computer Science, Technical University of Madrid (UPM), Madrid, Spain (email: mcarro@fi.upm.es, herme@fi.upm.es)
MANUEL HERMENEGILDO
Affiliation:
IMDEA Software Institute, Madrid, Spain (e-mail: josef.morales@imdea.org, manuel.carro@imdea.org, manuel.hermenegildo@imdea.org) School of Computer Science, Technical University of Madrid (UPM), Madrid, Spain (email: mcarro@fi.upm.es, herme@fi.upm.es)

Abstract

In order to achieve competitive performance, abstract machines for Prolog and related languages end up being large and intricate, and incorporate sophisticated optimizations, both at the design and at the implementation levels. At the same time, efficiency considerations make it necessary to use low-level languages in their implementation. This makes them laborious to code, optimize, and, especially, maintain and extend. Writing the abstract machine (and ancillary code) in a higher-level language can help tame this inherent complexity. We show how the semantics of most basic components of an efficient virtual machine for Prolog can be described using (a variant of) Prolog. These descriptions are then compiled to C and assembled to build a complete bytecode emulator. Thanks to the high-level of the language used and its closeness to Prolog, the abstract machine description can be manipulated using standard Prolog compilation and optimization techniques with relative ease. We also show how, by applying program transformations selectively, we obtain abstract machine implementations whose performance can match and even exceed that of state-of-the-art, highly-tuned, hand-crafted emulators.

Information

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2015 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Article purchase

Temporarily unavailable