Results 1 - 10
of
26
The execution algorithm of Mercury, an efficient purely declarative logic programming language
, 1996
"... Machine or WAM. Section 5 describes some optimizations and shows how Mercury handles I/O. Section 6 gives the current state of the Mercury system while section 7 presents performance results. 2. The Mercury language Syntactically, Mercury is similar to Prolog with additional declarations, partly b ..."
Abstract
-
Cited by 175 (20 self)
- Add to MetaCart
Machine or WAM. Section 5 describes some optimizations and shows how Mercury handles I/O. Section 6 gives the current state of the Mercury system while section 7 presents performance results. 2. The Mercury language Syntactically, Mercury is similar to Prolog with additional declarations, partly because Prolog syntax is standard in the logic programming community and partly because this made it simple to execute Mercury programs using Prolog systems early in our project. Semantically, however, Mercury is very different from Prolog. Mercury is a pure logic programming language with a well-defined declarative semantics. Like Godel [14], Mercury provides declarative replacements for Prolog 's non-logical features. Unlike Godel, Mercury does not retain any non-logical features; in Mercury even I/O is declarative. Mercury is designed to appeal to at least two groups of programmers. One group is those with backgrounds in imperative languages such as C who are looking for a higher level an...
Compiling Constraints in clp(FD)
, 1996
"... We present the clp(FD) system: a Constraint Logic Programming language with finite domain constraints... ..."
Abstract
-
Cited by 135 (19 self)
- Add to MetaCart
We present the clp(FD) system: a Constraint Logic Programming language with finite domain constraints...
A Compiler for Natural Semantics
- 6TH INTERNATIONAL CONFERENCE ON COMPILER CONSTRUCTION, CC'96, LINKĂ–PING
, 1996
"... Natural semantics is a formalism used for specifying both semantics and implementations of programming languages. Until recently, no practical implementation of the formalism existed. We have defined the Relational Meta-Language, RML, as an executable specification language for natural semantics. Af ..."
Abstract
-
Cited by 27 (2 self)
- Add to MetaCart
Natural semantics is a formalism used for specifying both semantics and implementations of programming languages. Until recently, no practical implementation of the formalism existed. We have defined the Relational Meta-Language, RML, as an executable specification language for natural semantics. After a brief outline of the language, we describe the compilation strategy used by our rml2c compiler: transformations are applied to minimize non-determinism, and a continuation-passing style form is produced and simplified. Finally the CPS is emitted as low-level C code, using an efficient technique for implementing tailcalls. We also present performance measurements that support our choice of compilation strategy.
Design and Implementation of the GNU Prolog System
- Journal of Functional and Logic Programming
, 2001
"... In this paper we describe the design and the implementation of the GNU Prolog system. This system draws on our previous experience of compiling Prolog to C in the wamcc system and of compiling finite domain constraints in the clp(FD) system. The compilation scheme has however been redesigned in orde ..."
Abstract
-
Cited by 26 (3 self)
- Add to MetaCart
In this paper we describe the design and the implementation of the GNU Prolog system. This system draws on our previous experience of compiling Prolog to C in the wamcc system and of compiling finite domain constraints in the clp(FD) system. The compilation scheme has however been redesigned in order to overcome the drawbacks of compiling to C. In particular, GNU-Prolog is based on a low-level mini-assembly platform-independent language that makes it possible to avoid compiling C code, and thus drastically reduces compilation time. It also makes it possible to produce small stand-alone executable files as the result of the compilation process. Interestingly, GNU Prolog is now compliant to the ISO standard, includes several extensions (OS interface, sockets, global variables, etc) and integrates a powerful constraint solver over finite domains. The system is efficient and in terms of performance is comparable with commercial systems for both the Prolog and constraint aspects.
The GNU Prolog System and its Implementation
, 2000
"... We describe in this paper the GNU-Prolog system, a free system consisting of a Prolog compiler and a constraint solver on finite domains. GNU-Prolog is based on a low-level mini-assembly platform-independent language that makes it possible for efficient compilation time, and allows to produce small ..."
Abstract
-
Cited by 18 (2 self)
- Add to MetaCart
We describe in this paper the GNU-Prolog system, a free system consisting of a Prolog compiler and a constraint solver on finite domains. GNU-Prolog is based on a low-level mini-assembly platform-independent language that makes it possible for efficient compilation time, and allows to produce small stand alone executable files as the result of the compilation process. Interestingly, the Prolog part is compliant to the ISO standard, and the constraint part includes several extensions, such as an efficient handling of reified constraints. The overall system is efficient and comparable in performances with commercial systems, both for the Prolog and constraint parts. 1. INTRODUCTION GNU Prolog 1 is a free Prolog compiler supported by the GNU organization. It was released in April 1999 and more than 2500 copies have been downloaded up to now from the INRIA ftp mirror site 2 . It is built on previous systems developed at INRIA, namely wamcc [4] for Prolog and clp(FD) [5] for constrain...
Compiling logic programs to C using GNU C as a portable assembler
, 1995
"... This paper discusses the merits of using C, and in particular GNU C, as an intermediate target language for the compilation of logic programs, and describes the approach we have taken in the implementation of Mercury. We start with a simple approach using ANSI C, and investigate a variety of improve ..."
Abstract
-
Cited by 16 (5 self)
- Add to MetaCart
This paper discusses the merits of using C, and in particular GNU C, as an intermediate target language for the compilation of logic programs, and describes the approach we have taken in the implementation of Mercury. We start with a simple approach using ANSI C, and investigate a variety of improvements on this basic approach. Keywords: compilation techniques, programming language implementation, logic programming languages, Mercury, C, GNU C. 1 Introduction There are many different ways of implementing a logic programming language, each with its own advantages and disadvantages. Each method makes its own trade-offs in terms of simplicity, portability, interactivity, compilation time, code size, speed at runtime, ease of debugging, interoperation with other languages, and so on. The choice of a particular method must be governed by the relative weights placed on these different trade-offs. This paper discusses the approach we took in the implementation of Mercury [11, 12], a new pure...
Code generation for Mercury
- In Proceedings of the Twelfth International Conference on Logic Programming
, 1995
"... Mercury is a new purely declarative logic programming language that requires programmers to write declarations for every predicate in the program. Although the main motivation for this requirement is that it allows the compiler to catch most programmer errors, it also allows the Mercury code generat ..."
Abstract
-
Cited by 13 (5 self)
- Add to MetaCart
Mercury is a new purely declarative logic programming language that requires programmers to write declarations for every predicate in the program. Although the main motivation for this requirement is that it allows the compiler to catch most programmer errors, it also allows the Mercury code generator to rely on the presence of type, mode and determinism information about every predicate in the program. The code generator exploits a new execution algorithm based on the availability of this information as well as some novel techniques (lazy code generation, follow-code migration, the use of a compile-time failure continuation stack) to produce very high quality code. This code is in C and is therefore quite portable. Benchmarks show that the Mercury implementation produces much faster code than wamcc, Quintus Prolog, SICStus Prolog and Aquarius Prolog.
Improved Compilation of Prolog to C Using Moded Types and Determinism Information
- In Proceedings of the Sixth International Symposium on Practical Aspects of Declarative Languages, number 3057 in LNCS
, 2004
"... We describe the current status of and provide performance results for a prototype compiler of Prolog to C. The compiler is novel in that it is designed to accept di#erent kinds of high-level information, typically obtained via an automatic analysis of the initial Prolog program and expressed in a st ..."
Abstract
-
Cited by 11 (7 self)
- Add to MetaCart
We describe the current status of and provide performance results for a prototype compiler of Prolog to C. The compiler is novel in that it is designed to accept di#erent kinds of high-level information, typically obtained via an automatic analysis of the initial Prolog program and expressed in a standardized language of assertions, and use this information to optimize the resulting C code, which is then further processed by an o#-the-shelf C compiler. The basic translation process used essentially mimics an unfolding of a C-coded bytecode emulator with respect to the particular bytecode corresponding to the Prolog program. Optimizations are then applied to this unfolded program. This is facilitated by a more flexible design of the bytecode instructions and their lower-level components. This approach allows reusing a sizable amount of the machinery of the bytecode emulator: ancillary pieces of C code, data definitions, memory management routines and areas, etc., as well as mixing bytecode emulated code with natively compiled 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.
GNU Prolog: beyond compiling Prolog to C
"... We describe in this paper the compilation scheme of the GNU Prolog system. This system is built on our previous experience of compiling Prolog to C in wamcc. The compilation scheme has been however redesigned to overcome drawbacks of the compilation to C. In particular, GNU-Prolog is based on a low- ..."
Abstract
-
Cited by 10 (0 self)
- Add to MetaCart
We describe in this paper the compilation scheme of the GNU Prolog system. This system is built on our previous experience of compiling Prolog to C in wamcc. The compilation scheme has been however redesigned to overcome drawbacks of the compilation to C. In particular, GNU-Prolog is based on a low-level miniassembly platform-independent language that makes it possible to avoid the phase of compiling C code, and thus speeds up drastically compilation time. It also makes it possible to produce small stand alone executable les as the result of the compilation process. Interestingly, GNU Prolog is now compliant to the ISO standard and includes several extensions (constraint solving, OS interface, sockets, global variables, etc). The overall system is ecient and comparable in performances with commercial systems.
Metalevel Interval Arithmetic and Verifiable Constraint Solving
, 2001
"... CLIP is an implementation of CLP(Intervals) which has been designed to be verifiably correct in the sense that the answers it returns are mathematically correct solutions to the underlying arithmetic constraints. This fundamental design criteria affects many aspects of the implementation from the in ..."
Abstract
-
Cited by 10 (3 self)
- Add to MetaCart
CLIP is an implementation of CLP(Intervals) which has been designed to be verifiably correct in the sense that the answers it returns are mathematically correct solutions to the underlying arithmetic constraints. This fundamental design criteria affects many aspects of the implementation from the input and output of decimal constants to the design of the interval arithmetic libraries and the constraint solving algorithms. In particular, to enhance verifiability, CLIP employs the simplest model of constraint solving in which constraints are decomposed into sets of primitive constraints which are then solved using a library of primitive constraint contractors. This approach results in a simple constraint solver whose correctness is relatively straightforward to verify, but the solver is only able to solve relatively simple constraints. In this paper, we present the syntax, semantics, and implementation of CLIP, and we show how to use metalevel techniques to enhance the power of the CLIP constraint solver while preserving the simple structure of the system. In particular, we demonstrate that several of the box-narrowing algorithms from the Newton and Numerica systems can be easily implemented in CLIP. The principal advantages of this approach are (1) the resulting solvers are relatively easy to prove correct, (2) new solvers can be rapidly prototyped since the code is more concise and declarative than for imperative languages, and (3) contractors can be implemented directly from mathematical formulae without having to first prove results about interval arithmetic operators. Finally, the source code for the system is publicly available, which is a clear prerequisite for public, independent verifiability.

