Improved Compilation of Prolog to C Using Moded Types and Determinism Information

  • J. Morales
  • Manuel Carro
  • Manuel Hermenegildo
Conference paper

DOI: 10.1007/978-3-540-24836-1_7

Volume 3057 of the book series Lecture Notes in Computer Science (LNCS)
Cite this paper as:
Morales J., Carro M., Hermenegildo M. (2004) Improved Compilation of Prolog to C Using Moded Types and Determinism Information. In: Jayaraman B. (eds) Practical Aspects of Declarative Languages. PADL 2004. Lecture Notes in Computer Science, vol 3057. Springer, Berlin, Heidelberg

Abstract

We describe the current status of and provide performance results for a prototype compiler of Prolog to C, ciaocc. ciaocc is novel in that it is designed to accept different kinds of high-level information, typically obtained via an automatic analysis of the initial Prolog program and expressed in a standardized language of assertions. This information is used to optimize the resulting C code, which is then processed by an off-the-shelf C compiler. The basic translation process essentially mimics the unfolding of a bytecode emulator with respect to the particular bytecode corresponding to the Prolog program. This is facilitated by a flexible design of the instructions and their lower-level components. This approach allows reusing a sizable amount of the machinery of the bytecode emulator: predicates already written in C, data definitions, memory management routines and areas, etc., as well as mixing emulated bytecode with native code in a relatively straightforward way. We report on the performance of programs compiled by the current version of the system, both with and without analysis information.

Keywords

Prolog optimizing compilation global analysis 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2004

Authors and Affiliations

  • J. Morales
    • 1
  • Manuel Carro
    • 1
  • Manuel Hermenegildo
    • 1
    • 2
  1. 1.C.S. SchoolTechnical U. of Madrid 
  2. 2.Depts. of Comp. Sci. and Elec. and Comp. Eng.U. of New Mexico (UNM)