Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 5ee7712a65135f0dd95d1c92938a0193 > files > 266

ocaml-facile-doc-1.1-2mdv2010.0.i586.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=ANSI_X3.4-1968">
<META name="GENERATOR" content="hevea 1.07">
<TITLE>
Foreword
</TITLE>
</HEAD>
<BODY >
<A HREF="manual001.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="manual003.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H1>Foreword</H1>
<A NAME="toc1"></A>
<H2>Portability</H2>
FaCiLe requires only the OCaml system (release 3.02 or greater) and should
work in any environment supporting this system. It is developed in a Linux
environment on PC architecture but does not use any specificities of Unix. It
should work on other operating systems (i.e. MS Windows, Mac OS...), provided
that the installation process is customised to the environment.<BR>
<BR>
<A NAME="toc2"></A>
<H2>FaCiLe Structure and Naming Conventions</H2>
The library is split into numerous modules and submodules. They are all
included (possibly with a limited user-oriented interface) into the main
module <CODE>Facile</CODE> which should be opened by any other
modules using FaCiLe. All the modules are extensively described in part&nbsp;<A HREF="index.html#reference">II</A>
of this documentation. We do not recommend to users to open
modules in <CODE>Facile</CODE> but to use prefixed notations (e.g. function
<CODE>post</CODE> of <CODE>Cstr</CODE> is written <CODE>Cstr.post</CODE>). The pseudo-module
named <CODE>Easy</CODE> is the exception and should be opened: it provides several
aliases to the most frequently used values (see <A HREF="manual007.html#module_Easy">4.1</A>) and
functions.<BR>
<BR>
To avoid interferences with other modules of the user, all the modules are
aliased in the <CODE>Facile</CODE> module and implementation module files are all
prefixed by <CODE>fcl_</CODE> (except of course <CODE>Facile</CODE> itself). For example, 
implementation of module <CODE>Gcc</CODE> is in file <CODE>fcl_gcc.ml</CODE> and alias
<PRE>
module Gcc = Fcl_gcc
</PRE>is defined in <CODE>Facile</CODE> (<CODE>facile.ml</CODE>). This alias mechanism is
entirely transparent to the user of FaCiLe except for the one interested by
the implementation of the library. The only possible visibility of <CODE>Fcl_</CODE>
prefix is given by the uncaught exceptions printer (e.g. <CODE>Fcl_stak.Fail</CODE>
instead of <CODE>Stak.fail</CODE>).<BR>
<BR>
The reference part of this documentation is automatically generated from module
interfaces (<CODE>.mli</CODE>). Some available functions, types or modules are
intentionally not documented or even hidden in <CODE>Facile</CODE> module. They are
not intented to the casual user.<BR>
<BR>
Values and types names try to benefit as much as possible from the modularity.
For example, most of the types are named <CODE>t</CODE>: type of constraints is
<CODE>Cstr.t</CODE>, type of domains is <CODE>Domain.t</CODE>... In the same way, printing
functions are named <CODE>fprint</CODE>, constraints are named <CODE>cstr</CODE>
(e.g. <CODE>Gcc.cstr</CODE>)...<BR>
<BR>
Standard or <EM>label</EM> mode of the OCaml compiler (option <CODE>-labels</CODE>) may
be used with the library. FaCiLe makes use of labels (labelled arguments) as
less as possible; only optional arguments are labelled.<BR>
<BR>
<A NAME="toc3"></A>
<H2>Compilation with FaCiLe</H2>
FaCiLe is provided as bytecode and native code<SUP><A NAME="text1" HREF="#note1">1</A></SUP> libraries.<BR>
<BR>
Bytecode version is compiled with debugging information (<CODE>-g</CODE> option of
<CODE>ocamlc</CODE>) and then can be used with the source-level replay debugger
(<CODE>ocamldebug</CODE>). A lot of checks are done in this mode and exceptions may
be raised revealing bad usage of the system (``fatal'' errors) or bugs in the
system itself (``internal'' errors). In the second case, diligent users
should send a bug report to the developers.<BR>
<BR>
In the native code version, these redundant checks are not done and this mode
should be used only on well-tried code.<BR>
<BR>
The <CODE>Makefile</CODE> in the <CODE>examples</CODE> directory of the distribution
provides generic rules to compile with FaCiLe in both modes producing
<CODE>.out</CODE> (bytecode) or <CODE>.opt</CODE> (native code) executables.<BR>
<BR>
<A NAME="@default0"></A>The library may also be used through linked toplevel produced with the
following command (after installation):
<PRE>
ocamlmktop -o facile -I +facile facile.cma
</PRE>This is the toplevel used in the inlined examples of this documentation and invoked
with the command line:
<PRE>
./facile -I +facile
</PRE>
<A NAME="toc4"></A>
<H2>Availability</H2>
The FaCiLe distribution and documentation are available from the web site where general information can be found:
<DIV ALIGN=center>
<A HREF="http://www.recherche.enac.fr/opti/facile"><TT>http://www.recherche.enac.fr/opti/facile</TT></A>
</DIV><BR>
Questions, bug reports... can be mailed to
<A NAME="sendbug"></A>
<DIV ALIGN=center>
<A HREF="mailto:facile@recherche.enac.fr">facile@recherche.enac.fr</A>
</DIV><BR>
<A NAME="toc5"></A>
<H2>Installation</H2>
<A NAME="install"></A>
Installation of FaCiLe is described in the <TT>README</TT> file of the
distribution. Below is a copy of the corresponding part:
<PRE>
INSTALLATION:

  All you need is the Objective Caml 3.02 (or greater) compiler and
standard Unix tools (make...).

  0) Configure the library. The single option of configuration is the
directory you want to put the library files in (facile.cma, facile.cmxa,
facile.a facile.cmi). Default is the subdirectory "facile" of the Ocaml
library directory (returned by "ocamlc -where").

 ./configure [--faciledir &lt;target directory&gt;]

  1) First compile the library with a simple

        make

  2) Check the result

        make check

     You should get a solution for the 8 queens problem.

  3) Then install the library with a (usually as root)

        make install
</PRE>
<A NAME="toc6"></A>
<H2>Examples</H2>
<A NAME="example"></A>
The directory <TT>examples</TT> of the distribution contains some examples and a
generic <TT>Makefile</TT> to compile files with FaCiLe. Examples are taken
from the classic litterature:
<DL COMPACT=compact><DT>
 <B>Coins</B><DD> Give back change for any amount
 <DT><B>Golf</B><DD> Organize a golf tournament for 8 teams of 4 players
 <DT><B>Golomb</B><DD> Find optimal Golomb rulers
 <DT><B>Jobshop</B><DD> Solve the famous <CODE>mt10</CODE> scheduling problem --
 Edge-Finding inside!
 <DT><B>Magic</B><DD> To count and to be counted
 <DT><B>Marriage</B><DD> Stabilize preferences among spouses
 <DT><B>Prolog</B><DD> Use FaCiLe as a Prolog interpreter on a family tree problem
 <DT><B>Queens</B><DD> Place queens on a chessboard
 <DT><B>Seven_eleven</B><DD> My grocer's favorite arithmetic puzzle
 <DT><B>Tiles</B><DD> Tile a big square with small squares
</DL>

<HR WIDTH="50%" SIZE=1><DL><DT><A NAME="note1" HREF="#text1"><FONT SIZE=5>1</FONT></A><DD>If supported by your
architecture. See <A HREF="http://caml.inria.fr/ocaml/portability.html"><TT>http://caml.inria.fr/ocaml/portability.html</TT></A>
</DL>
<HR>
<A HREF="manual001.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="manual003.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>