Towards description and optimization of abstract machines in an extension of prolog

  • Authors:
  • José F. morales;Manuel Carro;Manuel Hermenegildo

  • Affiliations:
  • U. Complutense de Madrid;T. University of Madrid;T. University of Madrid and U. of New Mexico

  • Venue:
  • LOPSTR'06 Proceedings of the 16th international conference on Logic-based program synthesis and transformation
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Competitive abstract machines for Prolog are usually large, intricate, and incorporate sophisticated optimizations. This makes them difficult to code, optimize, and, especially, maintain and extend. This is partly due to the fact that efficiency considerations make it necessary to use low-level languages in their implementation. Writing the abstract machine (and ancillary code) in a higher-level language can help harness this inherent complexity. In this paper we show how the semantics of basic components of an efficient virtual machine for Prolog can be described using (a variant of) Prolog which retains much of its semantics. 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 descriptions 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 highly-tuned, handcrafted emulators.