Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > d1f06a5336fd6bf4a381b72b8d2b5ce1 > files > 138

gprolog-1.2.16-3mdk.ppc.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.06-7 of 2001-11-14">
<TITLE>
 Introduction
</TITLE>
</HEAD>
<BODY TEXT=black BGCOLOR=white>
<A HREF="manual002.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="manual004.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#2dbae5"><DIV ALIGN=center><TABLE>
<TR><TD><FONT SIZE=5><B><A NAME="htoc2">2</A></B></FONT></TD>
<TD WIDTH="100%" ALIGN=center><FONT SIZE=5><B>Introduction</B></FONT></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE><BR>
GNU Prolog is a free Prolog compiler with constraint solving over finite
domains developed by <A HREF="http://pauillac.inria.fr/~diaz">Daniel Diaz</A>.
For recent information about GNU Prolog please consult
<A HREF="http://www.gnu.org/software/prolog">the GNU Prolog page</A>.<BR>
<BR>
 GNU Prolog is a Prolog compiler
based on the Warren Abstract Machine (WAM) [<CITE><A HREF="manual071.html#Warren83">8</A>, <A HREF="manual071.html#Ait-Kaci91">1</A></CITE>].
It first compiles a Prolog program to a WAM file which is then translated to
a low-level machine independent language called mini-assembly
specifically designed for GNU Prolog. The resulting file is then translated
to the assembly language of the target machine (from which an object is
obtained). This allows GNU Prolog to produce a native stand alone executable
from a Prolog source (similarly to what does a C compiler from a C program).
The main advantage of this compilation scheme is to produce native code and
to be fast. Another interesting feature is that executables are small.
Indeed, the code of most unused built-in predicates is not included in the
executables at link-time.<BR>
<BR>
A lot of work has been devoted to the ISO compatibility. Indeed, GNU Prolog
is very close to the
<A HREF="http://www.logic-programming.org/prolog_std.html">ISO standard for
 Prolog</A> [<CITE><A HREF="manual071.html#iso-part1">5</A></CITE>].<BR>
<BR>
GNU Prolog also offers various extensions very useful in practice (global
variables, OS interface, sockets,...). In particular, GNU Prolog contains an
efficient constraint solver over Finite Domains (FD). This opens contraint
logic pogramming to the user combining the power of constraint programming to
the declarativity of logic programming. The key feature of the GNU Prolog
solver is the use of a single (low-level) primitive to define all
(high-level) FD constraints. There are many advantages of this approach:
constraints can be compiled, the user can define his own constraints (in
terms of the primitive), the solver is open and extensible (as opposed to
black-box solvers like CHIP),...Moreover, the GNU Prolog solver is rather
efficient, often more than commercial solvers.<BR>
<BR>
GNU Prolog is inspired from two systems developed by the same author:
<UL><LI><TT>wamcc</TT>: a Prolog to C compiler [<CITE><A HREF="manual071.html#wamcc">3</A></CITE>]. the key point of <TT>wamcc</TT> was its
ability to produce stand alone executables using an original compilation
scheme: the translation of Prolog to C via the WAM. Its drawback was the time
needed by <TT>gcc</TT> to compile the produced sources. GNU Prolog can also
produce stand alone executables but using a faster compilation scheme.<BR>
<BR>
<LI><TT>clp(FD)</TT>: a constraint programming language over FD
[<CITE><A HREF="manual071.html#long-clp-fd">4</A></CITE>]. Its key feature was the use of a
single primitive to define FD constraints. GNU Prolog is based on the same
idea but offers an extended constraint definition language. In comparison to
<TT>clp(FD)</TT>, GNU Prolog offers new predefined constraints, new
predefined heuristics, reified constraints,...</UL>
Here are some features of GNU Prolog:
<UL><LI>Prolog system:
<UL><LI>conforms to the ISO standard for Prolog (floating point numbers,
streams, dynamic code,...).<BR>
<BR>
<LI>a lot of extensions: global variables, definite clause grammars (DCG), 
sockets interface, operating system interface,...<BR>
<BR>
<LI>more than 300 Prolog built-in predicates.<BR>
<BR>
<LI>Prolog debugger and a low-level WAM debugger.<BR>
<BR>
<LI>line editing facility under the interactive interpreter with
completion on atoms.<BR>
<BR>
<LI>powerful bidirectional interface between Prolog and C.</UL><BR>
<BR>
<LI>Compiler:
<UL><LI>native-code compiler producing stand alone executables.<BR>
<BR>
<LI>simple command-line compiler accepting a wide variety of files:
Prolog files, C files, WAM files,...<BR>
<BR>
<LI>direct generation of assembly code 15 times faster than
<TT>wamcc</TT> + <TT>gcc</TT>.<BR>
<BR>
<LI>most of unused built-in predicates are not linked (to reduce the size
of the executables).<BR>
<BR>
<LI>compiled predicates (native-code) as fast as <TT>wamcmcc</TT> on average.<BR>
<BR>
<LI>consulted predicates (byte-code) 5 times faster than <TT>wamcc</TT>.</UL><BR>
<BR>
<LI>Constraint solver:
<UL><LI>FD variables well integrated into the Prolog environment (full
compatibility with Prolog variables and integers). No need for
explicit FD declarations.<BR>
<BR>
<LI>very efficient FD solver (comparable to commercial solvers).<BR>
<BR>
<LI>high-level constraints can be described in terms of simple primitives.<BR>
<BR>
<LI>a lot of predefined constraints: arithmetic constraints, boolean
constraints, symbolic constraints, reified constraints,...<BR>
<BR>
<LI>several predefined enumeration heuristics.<BR>
<BR>
<LI>the user can define his own new constraints.<BR>
<BR>
<LI>more than 50 FD built-in constraints/predicates.</UL></UL>



<HR SIZE=2>
Copyright (C) 1999-2002 Daniel Diaz
<BR>
<BR>
Verbatim copying and distribution of this entire article is permitted in any
medium, provided this notice is preserved. <BR>
<BR>
<A HREF="index.html#copyright">More about the copyright</A>
<HR>
<A HREF="manual002.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="manual004.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>