diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..81a9c21 --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +include ./config + +.PHONY: help install uninstall example + +help: + @printf "Type 'make install' to install Zélus into:\n" + @printf " ${bindir}\n" + @printf " ${libdir}\n" + @printf "\n" + @printf "Type 'make example' to build the example.\n" + +install: + mkdir -p ${bindir} + cp bin/zeluc.byte ${bindir}/ + cp bin/zeluc ${bindir}/ + mkdir -p ${libdir} + cp lib/* ${libdir}/ + $(OCAMLFIND) install zelus META || true + +uninstall: + rm -f ${bindir}/zeluc.byte + rm -f ${bindir}/zeluc + rm -rf ${libdir} + $(OCAMLFIND) remove zelus || true + +example: + ${MAKE} -C example + diff --git a/README.md b/README.md new file mode 100755 index 0000000..a6372e6 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# ZSy: A Synchronous Language with Timers + +This distribution includes the Zélus compiler extended to compile ZSy +programs, runtime libraries, and example source code. The OCaml +runtime (ocamlrun) is required to transform ZSy programs into +imperative code. The OCaml compiler is required to compile imperative +code into executables. + +## Dependencies + +| Dependency | Version | Reason | +|------------|---------|--------| +| [OCaml](http://ocaml.org/) | Required == 4.04.0 | Run the Zélus compiler and compile the examples | +| [XQuartz](http://www.xquartz.org/) | Optional >= 2.7.9 | Required on MacOS to run the examples using OCaml Graphics | + + +## Installing the compiler + +Run the configure script (optionally setting an installation prefix): + +``` +./configure --prefix=/usr/local +``` + +Zélus can then be installed by running: + +``` +sudo make install +``` + +There is an option `-symb ` to compile ZSy programs. +An example of a ZSy program is given in `example`. + +## Example + +An example of a ZSy program simulating a simple two-node architecture +can be found in `example/qpa.zls`. To build and run the example run: + +``` +make example +./example/qpa.byte +``` diff --git a/bin/zeluc b/bin/zeluc new file mode 100755 index 0000000..577d0a2 --- /dev/null +++ b/bin/zeluc @@ -0,0 +1,4 @@ +#!/bin/sh +ZLLIB=/usr/local/lib/zelus +export ZLLIB +exec ocamlrun /usr/local/bin/zeluc.byte $@ diff --git a/bin/zeluc.byte b/bin/zeluc.byte new file mode 100755 index 0000000..ddca5e7 Binary files /dev/null and b/bin/zeluc.byte differ diff --git a/config.in b/config.in new file mode 100755 index 0000000..7baab44 --- /dev/null +++ b/config.in @@ -0,0 +1,153 @@ + +VERSION = @VERSION@ + +# configure variables +bindir = @bindir@ +libdir = @libdir@/zelus + +# options +gtktargets = @gtktargets@ +targets = @targets@ + +# programs used + +OCAML ?= @OCAMLBIN@ocaml +OCAMLC ?= @OCAMLBIN@ocamlc +OCAMLLEX ?= @OCAMLBIN@ocamllex +OCAMLYACC ?= @OCAMLBIN@ocamlyacc +OCAMLOPT ?= @OCAMLBIN@ocamlopt +OCAMLDEP ?= @OCAMLBIN@ocamldep +OCAMLRUN ?= @OCAMLBIN@ocamlrun +OCAMLFIND ?= @OCAMLFIND@ +MENHIR ?= @OCAMLBIN@menhir +OTAGS ?= otags + +ZLLIB = ../lib +TOOLS = ../tools + +OCAMLFLAGS ?= -annot -w -3-26 +OCAMLOPTFLAGS ?= -annot -w -3-26 +CPPFLAGS ?= -P -x c + +BIN = zeluc +TARGET ?= $(word 1, $(targets)) + +ifeq (@for_compile@,1) +ZELUC := ../bin/$(BIN) +else +ZELUC := ../bin/$(BIN).$(TARGET) -stdlib ../lib +endif + +UNIX = unix.cma +UNIXX = unix.cmxa + +GLMLITE_ENABLED = @GLMLITE_ENABLED@ +GLMLITE = -I @GLMLITE_INCL@ + +LABLGTK2 = -I @LABLGTK2_PATH@ + +MENHIRLIB = @MENHIRLIB@ +MENHIRFLAGS = --table + +MATLAB = @MATLAB@ +MATLABFLAGS = -nodesktop -nosplash + +PTOLEMY = @PTOLEMY@ +PTOLEMYFLAGS = + +SOLVER = @DEFAULT_SOLVER@ + +SUNDIALS=@SUNDIALSML_INCL@ +ifneq ($(SUNDIALS),) +SUNDIALS_CVODE = sundials.cma +OPTIONAL_SOLVER_OBJS = solvers/sundials_cvode.cmo +DISTOPTION = -sundials +else +DISTOPTION = -nosundials +endif + +ZLSTDLIBS = bigarray.cma unix.cma $(SUNDIALS) $(SUNDIALS_CVODE) +ZLEXTRALIBS = zllib.cma +ZLGTKLIBS = $(LABLGTK2) lablgtk.cma zllibgtk.cma + +DIRECTORIES = global parsing typing analysis rewrite gencode verif main + +# colours (used in tests) + +ifdef NOCOLOR + S_BLUE = "" + S_GREEN = "" + S_RED = "" + S_NORMAL = "" +else + S_BLUE = "\\033[34m" + S_GREEN = "\\033[32m" + S_RED = "\\033[31m" + S_NORMAL = "\\033[0m" +endif + +# debugger commands + +define DEBUG_PRELUDE +directory $(DIRECTORIES) + +load_printer "debugprinter.cma" +install_printer Ident.fprint_t +install_printer Ident.Env.fprint_3ident +install_printer Ident.S.fprint_t +install_printer Lident.fprint_t +install_printer Ptypes.output +install_printer Printer.expression +install_printer Printer.equation +install_printer Printer.print_env +install_printer Printer.implementation +install_printer Printer.interface +install_printer Printer.state_ident_typ +install_printer Printer.state_eq +install_printer Printer.local +install_printer Oprinter.implementation +install_printer Oprinter.ptype +install_printer Oprinter.pattern +install_printer Oprinter.expression +install_printer Causal.Cenv.penv +install_printer Causal.Cenv.pcaus +install_printer Causal.Cenv.ptype +install_printer Deadcode.print + +endef +export DEBUG_PRELUDE + +# implicit rules + +.SUFFIXES : .mli .ml .cmi .cmo .cmx .mll .mly .zli .zli .byte .opt + +%.cmi: %.mli + $(OCAMLC) $(OCAMLFLAGS) -c $(INCLUDES) $< + +%.cmo %.cmi: %.ml + $(OCAMLC) $(OCAMLFLAGS) -c -I $(ZLLIB) $(INCLUDES) $< + +%.cmx %.cmi: %.ml + $(OCAMLOPT) $(OCAMLOPTFLAGS) -I $(ZLLIB) -c $(INCLUDES:.cma=.cmxa) $< + +%.zci: %.zli + $(ZELUC) $(ZELUCFLAGS) $< + +%.ml: %.mll + $(OCAMLLEX) $< + +%.ml %.mli: %.mly + $(MENHIR) $(MENHIRFLAGS) $< + +# set ZLEXTRALIBS to ZLGTKLIBS to compile examples that use gtk +%.byte: %.ml + $(OCAMLC) $(OCAMLFLAGS) -o $@ $(INCLUDES) \ + -I $(ZLLIB) $(ZLSTDLIBS) $(ZLEXTRALIBS) \ + $< $(<:.ml=_main.ml) + +# set ZLEXTRALIBS to ZLGTKLIBS to compile examples that use gtk +%.opt: %.ml + $(OCAMLOPT) $(OCAMLOPTFLAGS) -o $@ $(INCLUDES) \ + -I $(ZLLIB) $(ZLSTDLIBS:.cma=.cmxa) $(ZLEXTRALIBS:.cma=.cmxa) \ + $< $(<:.ml=_main.ml) + diff --git a/config.log b/config.log new file mode 100755 index 0000000..a1fc560 --- /dev/null +++ b/config.log @@ -0,0 +1,17 @@ + +Configuration +------------- + + OCaml /usr/local/lib/ocaml (4.04.0) + Lablgtk2 /Users/baudart/.opam/4.04.0/lib/lablgtk2 + SundialsML /usr/local/lib/ocaml/sundialsml + glMLite NOT WORKING (/Users/baudart/.opam/4.04.0/lib/glMLite; 3D demos disabled) + + targets: byte opt withgtk.byte withgtk.opt + +Installation paths + prefix: /usr/local + bindir: /usr/local/bin + libdir: /usr/local/lib + mandir: /usr/local/share/man/ + diff --git a/configure b/configure new file mode 100755 index 0000000..8f84ebf --- /dev/null +++ b/configure @@ -0,0 +1,383 @@ +#! /bin/sh + +sysname='Zélus' +version='zsy-1.0.0' +contact='marc.pouzet@ens.fr' + +for_compile=0 + +prefix=/usr/local +unset bindir +unset libdir +unset mandir + +with_byte='byte' +with_opt='opt' +with_gtk_byte='withgtk.byte' +with_gtk_opt='withgtk.opt' +with_sundials=1 + + +while : ; do + case "$1" in + "") break;; + + --prefix) + prefix=$2; shift;; + --prefix=*) + prefix=`expr "$1" : '--[^=]*=\(.*\)'`;; + + --bindir) + bindir=$2; shift;; + --bindir=*) + bindir=`expr "$1" : '--[^=]*=\(.*\)'`;; + + --libdir) + libdir=$2; shift;; + --libdir=*) + libdir=`expr "$1" : '--[^=]*=\(.*\)'`;; + + --mandir) + mandir=$2; shift;; + --mandir=*) + mandir=`expr "$1" : '--[^=]*=\(.*\)'`;; + + --disable-opt) + with_opt='' + with_gtk_opt=''; + shift; + continue;; + + --disable-byte) + with_byte='' + with_gtk_byte=''; + shift; + continue;; + + --disable-gtk) + with_gtk_opt='' + with_gtk_byte=''; + shift; + continue;; + + --disable-sundials) + with_sundials=0; + shift; + continue;; + + -h|--help) + cat <<-END_HELP_TEXT + 'configure' configures $sysname $version to adapt to many kinds of systems. + + Usage: $0 [OPTION]... [VAR=VALUE]... + + To assign environment variables (e.g., CC, CFLAGS...), specify them as + VAR=VALUE. See below for descriptions of some of the useful variables. + + Defaults for the options are specified in brackets. + + Configuration: + -h, --help display this help and exit + + Installation directories: + --prefix=PREFIX + --prefix PREFIX install architecture-independent files in PREFIX + [$prefix] + + By default, 'make install' will install all the files in + '/usr/local/bin', '/usr/local/lib' etc. You can specify + an installation prefix other than '/usr/local' using '--prefix', + for instance '--prefix \$HOME'. + + For better control, use the options below. + + Fine tuning of the installation directories: + --bindir DIR user executables [PREFIX/bin] + --libdir DIR object code libraries [PREFIX/lib] + --mandir DIR man documentation [PREFIX/share/man] + + Optional Features: + --disable-opt disable native library generation + --disable-byte disable byte-code library generation + --disable-gtk do not build gtk2-dependent features + --disable-sundials do not build sundials-dependent features + + Some influential environment variables: + OCAMLROOT Path to ocaml installation (such that $OCAMLROOT/bin/ocamlc) + MENHIRLIB Path to Menhir libraries (menhirLib.cmi, etc.) + SUNDIALSML Path to the Ocaml/Sundials interface + GLMLITE Path to the Ocaml glMLite library + + Use these variables to override the choices made by 'configure' or to help + it to find libraries and programs with nonstandard names/locations. + + Report bugs to <$contact>. + +END_HELP_TEXT + exit 0 + ;; + OCAMLROOT=*) + OCAMLROOT=`expr "$1" : 'OCAMLROOT=\(.*\)'` + OCAMLBIN="${OCAMLROOT}bin/";; + MENHIRLIB=*) + MENHIRLIB=`expr "$1" : 'MENHIRLIB=\(.*\)'`;; + SUNDIALSML=*) + SUNDIALSML=`expr "$1" : 'SUNDIALSML=\(.*\)'`;; + GLMLITE=*) + GLMLITE=`expr "$1" : 'GLMLITE=\(.*\)'`; shift;; + MATLABROOT=*) + MATLABROOT=`expr "$1" : 'MATLABROOT=\(.*\)'`;; + PTOLEMYROOT=*) + PTOLEMYROOT=`expr "$1" : 'PTOLEMYROOT=\(.*\)'`;; + *) + printf "illegal option \"$1\".\n" 1>&2; exit 2;; + esac + shift +done + +targets="${with_byte} ${with_opt}" +gtktargets="${with_gtk_byte} ${with_gtk_opt}" + +error="" + +# Check targets +if [ "${targets}" = " " ]; then + error="${error}\n\tno targets specified" +fi + +# Set an explicit Matlab path if necessary +if [ -n "${MATLABROOT}" ]; then + matlab_bin="${MATLABROOT}bin/" +else + matlab_bin="" +fi + +# Set an explicit Ptolemy path if necessary +if [ -n "${PTOLEMYROOT}" ]; then + ptolemy_bin="${PTOLEMYROOT}bin/" +else + ptolemy_bin="" +fi + +# Check for ocaml installation (and version) +ocaml_path=`${OCAMLBIN}ocamlc -where` +ocaml_version=`${OCAMLBIN}ocamlc -version` + +if [ $? -ne 0 ]; then + error="${error}\n\tcould not find ocamlc" + ocaml_path='NOT FOUND' + ocaml_version='' + ocaml_libpath='' +else + case "${ocaml_version}" in + [0-2].*.* | 3.0* | 3.[2-9].* | 3.10.* | 3.11.*) + error="${error}\n\tocaml >= 3.12.0 required" ;; + *) ;; + esac + + ocaml_libpath="${ocaml_path%/}/" + ocaml_version=" (${ocaml_version})" +fi + +# Check for opam +if command -v opam >/dev/null 2>&1; then + opam_libpath="$(opam config var lib)/" +else + opam_libpath='' +fi + +# Check for ocamlfind +OCAMLFIND=`which ocamlfind` +if [ -z "${OCAMLFIND}" ]; then + OCAMLFIND=ocamlfind +fi + +# Check for gtk installation +lablgtk2_path="${ocaml_libpath}lablgtk2" +if [ "${gtktargets}" = " " ]; then + lablgtk2_path="not needed" + gtktargets='' +else + if [ ! -x ${lablgtk2_path} ]; then + lablgtk2_path="${ocaml_libpath}site-lib/lablgtk2" + if [ ! -x ${lablgtk2_path} ]; then + lablgtk2_path="${opam_libpath}lablgtk2" + if [ ! -x ${lablgtk2_path} ]; then + lablgtk2_path='NOT FOUND (disabling gtk features)' + gtktargets='' + fi + fi + fi +fi + +# Check for menhir installation +menhirlib="${MENHIRLIB:-${ocaml_libpath}menhirLib}" +if [ ${for_compile} -eq 1 ]; then + if [ ! -e "${menhirlib}/menhirLib.cmi" ]; then + menhirlib="${ocaml_libpath}site-lib/menhirLib" + if [ ! -e "${menhirlib}/menhirLib.cmi" ]; then + menhirlib="${opam_libpath}menhirLib" + if [ ! -e "${menhirlib}/menhirLib.cmi" ]; then + menhirlib='NOT FOUND' + error="${error}\n\tcould not find MenhirLib" + fi + fi + fi +fi + +# Check for sundialsml installation +sundialsml_path=${SUNDIALSML:-"${ocaml_libpath}sundialsml"} +sundialsml_incl="-I ${SUNDIALSML:-"+sundialsml"}" + +if [ ${with_sundials} -eq 0 ]; then + sundialsml_path='' + sundialsml_incl='' + sundialsml_status='DISABLED (defaulting to ode45)' + default_solver='Odexx.Ode45' +else + sundialsml_status=${sundialsml_path} + default_solver='Sundials_cvode' + + if [ ! -r "${sundialsml_path%/}/sundials.cma" ]; then + sundialsml_path="${opam_libpath}sundialsml" + sundialsml_incl="-I ${sundialsml_path}" + + if [ ! -r "${sundialsml_path%/}/sundials.cma" ]; then + sundialsml_path='' + sundialsml_incl='' + sundialsml_status='NOT FOUND (defaulting to ode45)' + default_solver='Odexx.Ode45' + fi + fi +fi + +# Check for glMLite installation +glmlite_path=${GLMLITE:-"${ocaml_libpath}glMLite"} +glmlite_incl=${GLMLITE:-"+glMLite"} + +if [ ! -x ${glmlite_path} ]; then + glmlite_path=${GLMLITE:-"${opam_libpath}glMLite"} + glmlite_incl=${glmlite_path} + if [ ! -x ${glmlite_path} ]; then + glmlite_status='NOT FOUND (3D demos disabled)' + glmlite_enabled=0 + fi +fi + +if [ "${ocaml_path}" != "NOT_FOUND" ]; then + + # TODO: change after patch integrated into glMLite + # "exit (if major >= 0 && minor >= 3 && patch > 50 then 100 else 200);;" \ + printf "let major, minor, patch = GL.glmlite_version in \ + exit (if major >= 0 && minor >= 3 && patch >= 50 then 100 \ + else (if major + minor + patch = 0 then 110 else 200));;\n" \ + | ${OCAMLBIN}ocaml -I ${glmlite_incl} GL.cma >/dev/null 2>&1 + GLMLV=$? + + if [ $GLMLV -eq 100 ]; then + glmlite_status="${glmlite_path} (>= 0.3.51)" + glmlite_enabled=1 + elif [ $GLMLV -eq 200 ]; then + glmlite_status="INCORRECT VERSION (must be >= 0.3.51, 3D demos disabled)" + glmlite_enabled=0 + elif [ $GLMLV -eq 110 ]; then + glmlite_status="${glmlite_path} (SVN HEAD version)" + glmlite_enabled=1 + else + glmlite_status="NOT WORKING (${glmlite_incl}; 3D demos disabled)" + glmlite_enabled=0 + fi +else + glmlite_status="${glmlite_path} (assuming version >= 0.3.51)" + glmlite_enabled=1 +fi + +printf "\nConfiguration\n-------------\n" > config.log + +printf "\n" >> config.log +printf " OCaml\t\t\t${ocaml_path}${ocaml_version}\n" >> config.log +if [ ${for_compile} -eq 1 ]; then +printf " MenhirLib\t\t${menhirlib}\n" >> config.log +fi +printf " Lablgtk2\t\t${lablgtk2_path}\n" >> config.log +printf " SundialsML\t\t${sundialsml_status}\n" >> config.log +printf " glMLite\t\t${glmlite_status}\n" >> config.log +printf "\n" >> config.log +printf " targets:\t\t${targets} ${gtktargets}\n" >> config.log +printf "\n" >> config.log +printf "Installation paths\n" >> config.log +printf " prefix:\t\t${prefix}\n" >> config.log +printf " bindir:\t\t${bindir:-$prefix/bin}\n" >> config.log +printf " libdir:\t\t${libdir:-$prefix/lib}\n" >> config.log +printf " mandir:\t\t${mandir:-$prefix/share/man/}\n" >> config.log +printf "\n" >> config.log + +if [ -n "${error}" ]; then + printf "Some errors occurred during configuration:${error}\n" >> config.log + printf "The 'config' file has not been written." >> config.log + printf "\n" >> config.log + cat config.log + exit 1 +fi + +cat config.log + +(printf "# # # THIS FILE IS GENERATED AUTOMATICALLY BY CONFIGURE # # #\n"; \ + sed -e "s#@prefix@#${prefix}#; + s#@bindir@#${bindir:-$prefix/bin}#; + s#@libdir@#${libdir:-$prefix/lib}#; + s#@mandir@#${mandir:-$prefix/share/man/}#; + s#@targets@#${targets}#; + s#@gtktargets@#${gtktargets}#; + s#@for_compile@#${for_compile}#; + s#@VERSION@#${version}#; + s#@DEFAULT_SOLVER@#${default_solver}#; + s#@SUNDIALSML_INCL@#${sundialsml_incl}#; + s#@LABLGTK2_PATH@#${lablgtk2_path}#; + s#@MENHIRLIB@#${menhirlib}#; + s#@GLMLITE_INCL@#${glmlite_incl}#; + s#@GLMLITE_ENABLED@#${glmlite_enabled}#; + s#@MATLAB@#${matlab_bin}matlab#; + s#@PTOLEMY@#${ptolemy_bin}ptolemy#; + s#@OCAMLFIND@#${OCAMLFIND}#; + s#@OCAMLBIN@#${OCAMLBIN}#; + s#@OCAMLROOT@#${OCAMLROOT}#;" config.in) > config + +mkdir -p bin +if [ ${for_compile} -eq 1 ]; then +cat > bin/zeluc < bin/zeluc < META < qpa_run.zls + $(ZELUC) qpa_run.zls + +qpa_main.cmo: INCLUDE += $(SUNDIALS) + +qpa_run.ml qpa_main.ml: qpa_run.zls + $(ZELUC) -I $(ZLLIB) -s main -sampling 0 qpa_run.zls + mv main.ml qpa_main.ml + +clean: + -@rm -f qpa_symb.* + -@rm -f scheduler.* + -@rm -f qpa_run.* + -@rm -f qpa_main.* + -@rm -f *~ *.zci *.cm* + +realclean cleanall: clean + -@rm -f qpa.byte diff --git a/example/README.md b/example/README.md new file mode 100755 index 0000000..55507fd --- /dev/null +++ b/example/README.md @@ -0,0 +1,36 @@ +# A simple two-node architecture + +File `qpa.zls` contains ZSy source code of a simple two-node +architecture where each node is triggered by its own jittery clock. + +``` +let hybrid clock(t_min, t_max) = c where + rec timer t init 0 reset c() -> 0 + and emit c when { t >= t_min } + and always { t <= t_max } + +let hybrid scheduler(t_min, t_max) = c1, c2 where + rec c1 = clock(t_min, t_max) + and c2 = clock(t_min, t_max) +``` + +To compile and run the symbolic simulation, type the following +command: + +``` +make +./qpa.byte +``` + +This will launch an OCaml graphics window. + +To start the simulation, focus on the terminal again an press enter. + +At each step, the graphics window shows a visualization of the current +zone. The active guards are listed in the terminal. + +To execute an action type its name on the terminal and press enter: +- `wait` for the wait transition +- `c1` to emit signal c1 +- `c2` to emit signal c2 +- `c1c2` to emit signals c1 and c2 simultaneously diff --git a/example/qpa.zls b/example/qpa.zls new file mode 100755 index 0000000..8040c36 --- /dev/null +++ b/example/qpa.zls @@ -0,0 +1,8 @@ +let hybrid clock(t_min, t_max) = c where + rec timer t init 0 reset c() -> 0 + and emit c when {t >= t_min} + and always {t <= t_max} + +let hybrid scheduler(t_min, t_max) = c1, c2 where + rec c1 = clock(t_min, t_max) + and c2 = clock(t_min, t_max) diff --git a/example/runtime.zls b/example/runtime.zls new file mode 100755 index 0000000..df68f7e --- /dev/null +++ b/example/runtime.zls @@ -0,0 +1,42 @@ +open Zone +open Basics + +let graph = open_graph " 700x700" + +(** Simulation **) +type event = Inactive | Wait | C1 | C2 | C1C2 + +let b_min = 3 +let b_max = 5 + + +let node main_symb(choice) = zc, bw, bc1, bc2 where + rec c1 = choice=C1 or choice=C1C2 + and c2 = choice=C2 or choice=C1C2 + and wait = choice = Wait + and (_, _), bv, bw, zc = scheduler(wait, (c1, c2), (b_min, b_max)) + and bc1 = nth(bv, 0) + and bc2 = nth(bv, 1) + +let node input (key, bw, bc1, bc2) = o where + o = match key with + | "c1" -> if bc1 then C1 else Inactive + | "c2" -> if bc2 then C2 else Inactive + | "c1c2" -> if bc1 && bc2 then C1C2 else Inactive + | "wait" -> if bw then Wait else Inactive + | "quit" -> kill("Goodbye!") + | _ -> Inactive + end + +let node simulation () = zc, prg where + rec key = read_line () + and choice = input (key, false fby bw, false fby bc1, false fby bc2) + and prg = print_guards(bw, cons(guard("c1", bc1), cons(guard("c2", bc2), nil))) + and zc, bw, bc1, bc2 = + present (true fby false) | (choice <> Inactive) -> main_symb(choice) + init zall(), false, false, false + +let node main () = + let zc, prg = simulation() in + (* zdraw_clocks (1,2,b_min,b_max, zc) *) (* require graphics of size " 600x300" *) + zdraw (1,2, 6, 6, zc) (* require graphics of size " 700x700" *) diff --git a/lib/basics.cmi b/lib/basics.cmi new file mode 100755 index 0000000..79e2871 Binary files /dev/null and b/lib/basics.cmi differ diff --git a/lib/basics.zci b/lib/basics.zci new file mode 100755 index 0000000..5c43679 Binary files /dev/null and b/lib/basics.zci differ diff --git a/lib/basics.zli b/lib/basics.zli new file mode 100755 index 0000000..ac53f66 --- /dev/null +++ b/lib/basics.zli @@ -0,0 +1,28 @@ + +val cons : 'a * 'a list -> 'a list +val nil : 'a list +val singleton : 'a -> 'a list +val append : 'a list * 'a list -> 'a list + +val unsafe output_strings : out_channel * string list -> unit +val unsafe output_quoted_strings : out_channel * string list -> unit +val unsafe output_floats : out_channel * float list -> unit + +val empty : 'a list -> bool + +val hd : 'a list -> 'a +val tl : 'a list -> 'a list + +(** [float_eq (max_relative_err, a, b)] returns true if + * [a] = [b] to within ((1 - max_relative_error) * 100)% *) +val float_eq : float * float * float -> bool + +(* to within 99.9999% *) +val (=~=) : float * float -AD-> bool + +val major_step : unit -A-> zero +val minor_step : unit -A-> zero + +(* discontinuous sgn function for testing *) +val bad_sgn : float -A-> float + diff --git a/lib/char.zci b/lib/char.zci new file mode 100755 index 0000000..70b9c33 Binary files /dev/null and b/lib/char.zci differ diff --git a/lib/char.zli b/lib/char.zli new file mode 100755 index 0000000..92dc81f --- /dev/null +++ b/lib/char.zli @@ -0,0 +1,28 @@ +val code : char -> int +(** Return the ASCII code of the argument. *) + +val chr : int -> char +(** Return the character with the given ASCII code. + Raise [Invalid_argument "Char.chr"] if the argument is + outside the range 0--255. *) + +val escaped : char -> string +(** Return a string representing the given character, + with special characters escaped following the lexical conventions + of Objective Caml. *) + +val lowercase : char -> char +(** Convert the given character to its equivalent lowercase character. *) + +val uppercase : char -> char +(** Convert the given character to its equivalent uppercase character. *) + +val compare: char * char -> int +(** The comparison function for characters, with the same specification as + {!Pervasives.compare}. Along with the type [t], this function [compare] + allows the module [Char] to be passed as argument to the functors + {!Set.Make} and {!Map.Make}. *) + +(**/**) + +val unsafe_chr : int -> char diff --git a/lib/complex.zci b/lib/complex.zci new file mode 100755 index 0000000..2a17643 Binary files /dev/null and b/lib/complex.zci differ diff --git a/lib/complex.zli b/lib/complex.zli new file mode 100755 index 0000000..ee9a1e6 --- /dev/null +++ b/lib/complex.zli @@ -0,0 +1,64 @@ +type t = { re: float; im: float } +(** The type of complex numbers. [re] is the real part and [im] the + imaginary part. *) + +val zero: t +(** The complex number [0]. *) + +val one: t +(** The complex number [1]. *) + +val i: t +(** The complex number [i]. *) + +val neg: t -> t +(** Unary negation. *) + +val conj: t -> t +(** Conjugate: given the complex [x + i.y], returns [x - i.y]. *) + +val add: t * t -> t +(** Addition *) + +val sub: t * t -> t +(** Subtraction *) + +val mul: t * t -> t +(** Multiplication *) + +val inv: t -> t +(** Multiplicative inverse ([1/z]). *) + +val div: t * t -> t +(** Division *) + +val sqrt: t -> t +(** Square root. The result [x + i.y] is such that [x > 0] or + [x = 0] and [y >= 0]. + This function has a discontinuity along the negative real axis. *) + +val norm2: t -> float +(** Norm squared: given [x + i.y], returns [x^2 + y^2]. *) + +val norm: t -> float +(** Norm: given [x + i.y], returns [sqrt(x^2 + y^2)]. *) + +val arg: t -> float +(** Argument. The argument of a complex number is the angle + in the complex plane between the positive real axis and a line + passing through zero and the number. This angle ranges from + [-pi] to [pi]. This function has a discontinuity along the + negative real axis. *) + +val polar: float * float -> t +(** [polar norm arg] returns the complex having norm [norm] + and argument [arg]. *) + +val exp: t -> t +(** Exponentiation. [exp z] returns [e] to the [z] power. *) + +val log: t -> t +(** Natural logarithm (in base [e]). *) + +val pow: t * t -> t +(** Power function. [pow z1 z2] returns [z1] to the [z2] power. *) diff --git a/lib/defaultsolver.cmi b/lib/defaultsolver.cmi new file mode 100755 index 0000000..990c056 Binary files /dev/null and b/lib/defaultsolver.cmi differ diff --git a/lib/dump.cmi b/lib/dump.cmi new file mode 100755 index 0000000..e7e93e8 Binary files /dev/null and b/lib/dump.cmi differ diff --git a/lib/dump.zci b/lib/dump.zci new file mode 100755 index 0000000..a8ec4dc Binary files /dev/null and b/lib/dump.zci differ diff --git a/lib/graphics.zci b/lib/graphics.zci new file mode 100755 index 0000000..01ed2bd Binary files /dev/null and b/lib/graphics.zci differ diff --git a/lib/graphics.zli b/lib/graphics.zli new file mode 100755 index 0000000..e688377 --- /dev/null +++ b/lib/graphics.zli @@ -0,0 +1,78 @@ +val unsafe open_graph : string -> unit +val unsafe close_graph : unit -> unit +val unsafe set_window_title : string -> unit +val unsafe clear_graph : unit -> unit +val size_x : unit -> int +val size_y : unit -> int +type color +val rgb : int * int * int -> color +val unsafe set_color : color -> unit +val background : color +val foreground : color +val black : color +val white : color +val red : color +val green : color +val blue : color +val yellow : color +val cyan : color +val magenta : color +val unsafe plot : int * int -> unit +val unsafe plots : (int * int) array -> unit +val point_color : int * int -> color +val unsafe moveto : int * int -> unit +val unsafe rmoveto : int * int -> unit +val current_x : unit -> int +val current_y : unit -> int +val current_point : unit -> int * int +val unsafe lineto : int * int -> unit +val unsafe rlineto : int * int -> unit +val unsafe curveto : (int * int) * (int * int) * (int * int) -> unit +val unsafe draw_rect : int * int * int * int -> unit +val unsafe draw_poly_line : (int * int) array -> unit +val unsafe draw_poly : (int * int) array -> unit +val unsafe draw_segments : (int * int * int * int) array -> unit +val unsafe draw_arc : int * int * int * int * int * int -> unit +val unsafe draw_ellipse : int * int * int * int -> unit +val unsafe draw_circle : int * int * int -> unit +val unsafe set_line_width : int -> unit +val unsafe draw_char : char -> unit +val unsafe draw_string : string -> unit +val unsafe set_font : string -> unit +val unsafe set_text_size : int -> unit +val text_size : string -> int * int +val unsafe fill_rect : int * int * int * int -> unit +val unsafe fill_poly : (int * int) array -> unit +val unsafe fill_arc : int * int * int * int * int * int -> unit +val unsafe fill_ellipse : int * int * int * int -> unit +val unsafe fill_circle : int * int * int -> unit +type image +val transp : color +val make_image : color array array -> image +val dump_image : image -> color array array +val draw_image : image * int * int -> unit +val get_image : int * int * int * int -> image +val create_image : int * int -> image +val unsafe blit_image : image * int * int -> unit +type status = + { mouse_x : int; (** X coordinate of the mouse *) + mouse_y : int; (** Y coordinate of the mouse *) + button : bool; (** true if a mouse button is pressed *) + keypressed : bool; (** true if a key has been pressed *) + key : char; (** the character for the key pressed *) + } +type event = + Button_down (** A mouse button is pressed *) + | Button_up (** A mouse button is released *) + | Key_pressed (** A key is pressed *) + | Mouse_motion (** The mouse is moved *) + | Poll (** Don't wait; return immediately *) +val unsafe wait_next_event : event list -> status +val mouse_pos : unit -> int * int +val button_down : unit -> bool +val read_key : unit -> char +val key_pressed : unit -> bool +val sound : int * int -> unit +val unsafe auto_synchronize : bool -> unit +val unsafe synchronize : unit -> unit +val unsafe display_mode : bool -> unit diff --git a/lib/gtkplot.cmi b/lib/gtkplot.cmi new file mode 100755 index 0000000..acd7e3c Binary files /dev/null and b/lib/gtkplot.cmi differ diff --git a/lib/gtkplot.zci b/lib/gtkplot.zci new file mode 100755 index 0000000..3e459dc Binary files /dev/null and b/lib/gtkplot.zci differ diff --git a/lib/gtkplot.zli b/lib/gtkplot.zli new file mode 100755 index 0000000..039da16 --- /dev/null +++ b/lib/gtkplot.zli @@ -0,0 +1,18 @@ + +type signal_type + +val points : bool -> signal_type +val piecewise : signal_type +val square : signal_type +val linear : signal_type + +type signal +type scope +type window + +val signal : string * signal_type -> signal +val unsafe update : signal * float -> unit +val scope : float * float * signal list -> scope +val window : string * float * scope list -> window +val unsafe tick : window * float -> unit + diff --git a/lib/int32.zci b/lib/int32.zci new file mode 100755 index 0000000..41f14d0 Binary files /dev/null and b/lib/int32.zci differ diff --git a/lib/int32.zli b/lib/int32.zli new file mode 100755 index 0000000..0fa6163 --- /dev/null +++ b/lib/int32.zli @@ -0,0 +1,139 @@ +type t + +val zero : t +(** The 32-bit integer 0. *) + +val one : t +(** The 32-bit integer 1. *) + +val minus_one : t +(** The 32-bit integer -1. *) + +val neg : t -> t +(** Unary negation. *) + +val add : t * t -> t +(** Addition. *) + +val sub : t * t -> t +(** Subtraction. *) + +val mul : t * t -> t +(** Multiplication. *) + +val div : t * t -> t +(** Integer division. Raise [Division_by_zero] if the second + argument is zero. This division rounds the real quotient of + its arguments towards zero, as specified for {!Pervasives.(/)}. *) + +val rem : t * t -> t +(** Integer remainder. If [y] is not zero, the result + of [Int32.rem x y] satisfies the following property: + [x = Int32.add (Int32.mul (Int32.div x y) y) (Int32.rem x y)]. + If [y = 0], [Int32.rem x y] raises [Division_by_zero]. *) + +val succ : t -> t +(** Successor. [Int32.succ x] is [Int32.add x Int32.one]. *) + +val pred : t -> t +(** Predecessor. [Int32.pred x] is [Int32.sub x Int32.one]. *) + +val abs : t -> t +(** Return the absolute value of its argument. *) + +val max_int : t +(** The greatest representable 32-bit integer, 2{^31} - 1. *) + +val min_int : t +(** The smallest representable 32-bit integer, -2{^31}. *) + + +val logand : t * t -> t +(** Bitwise logical and. *) + +val logor : t * t -> t +(** Bitwise logical or. *) + +val logxor : t * t -> t +(** Bitwise logical exclusive or. *) + +val lognot : t -> t +(** Bitwise logical negation *) + +val shift_left : t * int -> t +(** [Int32.shift_left x y] shifts [x] to the left by [y] bits. + The result is unspecified if [y < 0] or [y >= 32]. *) + +val shift_right : t * int -> t +(** [Int32.shift_right x y] shifts [x] to the right by [y] bits. + This is an arithmetic shift: the sign bit of [x] is replicated + and inserted in the vacated bits. + The result is unspecified if [y < 0] or [y >= 32]. *) + +val shift_right_logical : t * int -> t +(** [Int32.shift_right_logical x y] shifts [x] to the right by [y] bits. + This is a logical shift: zeroes are inserted in the vacated bits + regardless of the sign of [x]. + The result is unspecified if [y < 0] or [y >= 32]. *) + +val of_int : int -> t +(** Convert the given integer (type [int]) to a 32-bit integer + (type [t]). *) + +val to_int : t -> int +(** Convert the given 32-bit integer (type [t]) to an + integer (type [int]). On 32-bit platforms, the 32-bit integer + is taken modulo 2{^31}, i.e. the high-order bit is lost + during the conversion. On 64-bit platforms, the conversion + is exact. *) + +val of_float : float -> t +(** Convert the given floating-point number to a 32-bit integer, + discarding the fractional part (truncate towards 0). + The result of the conversion is undefined if, after truncation, + the number is outside the range \[{!Int32.min_int}, {!Int32.max_int}\]. *) + +val to_float : t -> float +(** Convert the given 32-bit integer to a floating-point number. *) + +val of_string : string -> t +(** Convert the given string to a 32-bit integer. + The string is read in decimal (by default) or in hexadecimal, + octal or binary if the string begins with [0x], [0o] or [0b] + respectively. + Raise [Failure "int_of_string"] if the given string is not + a valid representation of an integer, or if the integer represented + exceeds the range of integers representable in type [t]. *) + +val to_string : t -> string +(** Return the string representation of its argument, in signed decimal. *) + +val bits_of_float : float -> t +(** Return the internal representation of the given float according + to the IEEE 754 floating-point ``single format'' bit layout. + Bit 31 of the result represents the sign of the float; + bits 30 to 23 represent the (biased) exponent; bits 22 to 0 + represent the mantissa. *) + +val float_of_bits : t -> float +(** Return the floating-point number whose internal representation, + according to the IEEE 754 floating-point ``single format'' bit layout, + is the given [t]. *) + +val compare: t * t -> int +(** The comparison function for 32-bit integers, with the same specification as + {!Pervasives.compare}. Along with the type [t], this function [compare] + allows the module [Int32] to be passed as argument to the functors + {!Set.Make} and {!Map.Make}. *) + +(**/**) + +(** {6 Deprecated functions} *) + +val format : string * t -> string +(** [Int32.format fmt n] return the string representation of the + 32-bit integer [n] in the format specified by [fmt]. + [fmt] is a [Printf]-style format consisting of exactly + one [%d], [%i], [%u], [%x], [%X] or [%o] conversion specification. + This function is deprecated; use {!Printf.sprintf} with a [%lx] format + instead. *) diff --git a/lib/int64.zci b/lib/int64.zci new file mode 100755 index 0000000..7eb672c Binary files /dev/null and b/lib/int64.zci differ diff --git a/lib/int64.zli b/lib/int64.zli new file mode 100755 index 0000000..eb7d37f --- /dev/null +++ b/lib/int64.zli @@ -0,0 +1,160 @@ +type t + +val zero : t +(** The 64-bit integer 0. *) + +val one : t +(** The 64-bit integer 1. *) + +val minus_one : t +(** The 64-bit integer -1. *) + +val neg : t -> t +(** Unary negation. *) + +val add : t * t -> t +(** Addition. *) + +val sub : t * t -> t +(** Subtraction. *) + +val mul : t * t -> t +(** Multiplication. *) + +val div : t * t -> t +(** Integer division. Raise [Division_by_zero] if the second + argument is zero. This division rounds the real quotient of + its arguments towards zero, as specified for {!Pervasives.(/)}. *) + +val rem : t * t -> t +(** Integer remainder. If [y] is not zero, the result + of [Int64.rem x y] satisfies the following property: + [x = Int64.add (Int64.mul (Int64.div x y) y) (Int64.rem x y)]. + If [y = 0], [Int64.rem x y] raises [Division_by_zero]. *) + +val succ : t -> t +(** Successor. [Int64.succ x] is [Int64.add x Int64.one]. *) + +val pred : t -> t +(** Predecessor. [Int64.pred x] is [Int64.sub x Int64.one]. *) + +val abs : t -> t +(** Return the absolute value of its argument. *) + +val max_int : t +(** The greatest representable 64-bit integer, 2{^63} - 1. *) + +val min_int : t +(** The smallest representable 64-bit integer, -2{^63}. *) + +val logand : t * t -> t +(** Bitwise logical and. *) + +val logor : t * t -> t +(** Bitwise logical or. *) + +val logxor : t * t -> t +(** Bitwise logical exclusive or. *) + +val lognot : t -> t +(** Bitwise logical negation *) + +val shift_left : t * int -> t +(** [Int64.shift_left x y] shifts [x] to the left by [y] bits. + The result is unspecified if [y < 0] or [y >= 64]. *) + +val shift_right : t * int -> t +(** [Int64.shift_right x y] shifts [x] to the right by [y] bits. + This is an arithmetic shift: the sign bit of [x] is replicated + and inserted in the vacated bits. + The result is unspecified if [y < 0] or [y >= 64]. *) + +val shift_right_logical : t * int -> t +(** [Int64.shift_right_logical x y] shifts [x] to the right by [y] bits. + This is a logical shift: zeroes are inserted in the vacated bits + regardless of the sign of [x]. + The result is unspecified if [y < 0] or [y >= 64]. *) + +val of_int : int -> t +(** Convert the given integer (type [int]) to a 64-bit integer + (type [t]). *) + +val to_int : t -> int +(** Convert the given 64-bit integer (type [t]) to an + integer (type [int]). On 64-bit platforms, the 64-bit integer + is taken modulo 2{^63}, i.e. the high-order bit is lost + during the conversion. On 32-bit platforms, the 64-bit integer + is taken modulo 2{^31}, i.e. the top 33 bits are lost + during the conversion. *) + +val of_float : float -> t +(** Convert the given floating-point number to a 64-bit integer, + discarding the fractional part (truncate towards 0). + The result of the conversion is undefined if, after truncation, + the number is outside the range \[{!Int64.min_int}, {!Int64.max_int}\]. *) + +val to_float : t -> float +(** Convert the given 64-bit integer to a floating-point number. *) + + +val of_int32 : Int32.t -> t +(** Convert the given 32-bit integer (type [int32]) + to a 64-bit integer (type [t]). *) + +val to_int32 : t -> Int32.t +(** Convert the given 64-bit integer (type [int64]) to a + 32-bit integer (type [int32]). The 64-bit integer + is taken modulo 2{^32}, i.e. the top 32 bits are lost + during the conversion. *) + +val of_nativeint : Nativeint.t +(** Convert the given native integer (type [nativeint]) + to a 64-bit integer (type [t]). *) + +val to_nativeint : t -> Nativeint.t +(** Convert the given 64-bit integer (type [t]) to a + native integer. On 32-bit platforms, the 64-bit integer + is taken modulo 2{^32}. On 64-bit platforms, + the conversion is exact. *) + +val of_string : string -> t +(** Convert the given string to a 64-bit integer. + The string is read in decimal (by default) or in hexadecimal, + octal or binary if the string begins with [0x], [0o] or [0b] + respectively. + Raise [Failure "int_of_string"] if the given string is not + a valid representation of an integer, or if the integer represented + exceeds the range of integers representable in type [t]. *) + +val to_string : t -> string +(** Return the string representation of its argument, in decimal. *) + +val bits_of_float : float -> t +(** Return the internal representation of the given float according + to the IEEE 754 floating-point ``double format'' bit layout. + Bit 63 of the result represents the sign of the float; + bits 62 to 52 represent the (biased) exponent; bits 51 to 0 + represent the mantissa. *) + +val float_of_bits : t -> float +(** Return the floating-point number whose internal representation, + according to the IEEE 754 floating-point ``double format'' bit layout, + is the given [t]. *) + +val compare: t * t -> int +(** The comparison function for 64-bit integers, with the same specification as + {!Pervasives.compare}. Along with the type [t], this function [compare] + allows the module [Int64] to be passed as argument to the functors + {!Set.Make} and {!Map.Make}. *) + +(**/**) + +(** {6 Deprecated functions} *) + +val format : string * t -> string +(** [Int64.format fmt n] return the string representation of the + 64-bit integer [n] in the format specified by [fmt]. + [fmt] is a {!Printf}-style format consisting of exactly one + [%d], [%i], [%u], [%x], [%X] or [%o] conversion specification. + This function is deprecated; use {!Printf.sprintf} with a [%Lx] format + instead. *) diff --git a/lib/nativeint.zci b/lib/nativeint.zci new file mode 100755 index 0000000..346a8c7 Binary files /dev/null and b/lib/nativeint.zci differ diff --git a/lib/nativeint.zli b/lib/nativeint.zli new file mode 100755 index 0000000..011db63 --- /dev/null +++ b/lib/nativeint.zli @@ -0,0 +1,151 @@ +type t + +val zero : t +(** The native integer 0.*) + +val one : t +(** The native integer 1.*) + +val minus_one : t +(** The native integer -1.*) + +val neg : t -> t +(** Unary negation. *) + +val add : t * t -> t +(** Addition. *) + +val sub : t * t -> t +(** Subtraction. *) + +val mul : t * t -> t +(** Multiplication. *) + +val div : t * t -> t +(** Integer division. Raise [Division_by_zero] if the second + argument is zero. This division rounds the real quotient of + its arguments towards zero, as specified for {!Pervasives.(/)}. *) + +val rem : t * t -> t +(** Integer remainder. If [y] is not zero, the result + of [Nativeint.rem x y] satisfies the following properties: + [Nativeint.zero <= Nativeint.rem x y < Nativeint.abs y] and + [x = Nativeint.add (Nativeint.mul (Nativeint.div x y) y) (Nativeint.rem x y)]. + If [y = 0], [Nativeint.rem x y] raises [Division_by_zero]. *) + +val succ : t -> t +(** Successor. + [Nativeint.succ x] is [Nativeint.add x Nativeint.one]. *) + +val pred : t -> t +(** Predecessor. + [Nativeint.pred x] is [Nativeint.sub x Nativeint.one]. *) + +val abs : t -> t +(** Return the absolute value of its argument. *) + +val size : int +(** The size in bits of a native integer. This is equal to [32] + on a 32-bit platform and to [64] on a 64-bit platform. *) + +val max_int : t +(** The greatest representable native integer, + either 2{^31} - 1 on a 32-bit platform, + or 2{^63} - 1 on a 64-bit platform. *) + +val min_int : t +(** The greatest representable native integer, + either -2{^31} on a 32-bit platform, + or -2{^63} on a 64-bit platform. *) + +val logand : t * t -> t +(** Bitwise logical and. *) + +val logor : t * t -> t +(** Bitwise logical or. *) + +val logxor : t * t -> t +(** Bitwise logical exclusive or. *) + +val lognot : t -> t +(** Bitwise logical negation *) + +val shift_left : t * int -> t +(** [Nativeint.shift_left x y] shifts [x] to the left by [y] bits. + The result is unspecified if [y < 0] or [y >= bitsize], + where [bitsize] is [32] on a 32-bit platform and + [64] on a 64-bit platform. *) + +val shift_right : t * int -> t +(** [Nativeint.shift_right x y] shifts [x] to the right by [y] bits. + This is an arithmetic shift: the sign bit of [x] is replicated + and inserted in the vacated bits. + The result is unspecified if [y < 0] or [y >= bitsize]. *) + +val shift_right_logical : t * int -> t +(** [Nativeint.shift_right_logical x y] shifts [x] to the right + by [y] bits. + This is a logical shift: zeroes are inserted in the vacated bits + regardless of the sign of [x]. + The result is unspecified if [y < 0] or [y >= bitsize]. *) + + +val of_int : int -> t +(** Convert the given integer (type [int]) to a native integer + (type [t]). *) + +val to_int : t -> int +(** Convert the given native integer (type [t]) to an + integer (type [int]). The high-order bit is lost during + the conversion. *) + +val of_float : float -> t +(** Convert the given floating-point number to a native integer, + discarding the fractional part (truncate towards 0). + The result of the conversion is undefined if, after truncation, + the number is outside the range + \[{!Nativeint.min_int}, {!Nativeint.max_int}\]. *) + +val to_float : t -> float +(** Convert the given native integer to a floating-point number. *) + +val of_int32 : Int32.t -> t +(** Convert the given 32-bit integer (type [int32]) + to a native integer. *) + +val to_int32 : t -> Int32.t +(** Convert the given native integer to a + 32-bit integer (type [int32]). On 64-bit platforms, + the 64-bit native integer is taken modulo 2{^32}, + i.e. the top 32 bits are lost. On 32-bit platforms, + the conversion is exact. *) + +val of_string : string -> t +(** Convert the given string to a native integer. + The string is read in decimal (by default) or in hexadecimal, + octal or binary if the string begins with [0x], [0o] or [0b] + respectively. + Raise [Failure "int_of_string"] if the given string is not + a valid representation of an integer, or if the integer represented + exceeds the range of integers representable in type [t]. *) + +val to_string : t -> string +(** Return the string representation of its argument, in decimal. *) + +val compare: t * t -> int +(** The comparison function for native integers, with the same specification as + {!Pervasives.compare}. Along with the type [t], this function [compare] + allows the module [Nativeint] to be passed as argument to the functors + {!Set.Make} and {!Map.Make}. *) + +(**/**) + +(** {6 Deprecated functions} *) + +val format : string * t * string +(** [Nativeint.format fmt n] return the string representation of the + native integer [n] in the format specified by [fmt]. + [fmt] is a [Printf]-style format consisting of exactly + one [%d], [%i], [%u], [%x], [%X] or [%o] conversion specification. + This function is deprecated; use {!Printf.sprintf} with a [%nx] format + instead. *) diff --git a/lib/pervasives.zci b/lib/pervasives.zci new file mode 100755 index 0000000..e4c45ef Binary files /dev/null and b/lib/pervasives.zci differ diff --git a/lib/pervasives.zli b/lib/pervasives.zli new file mode 100755 index 0000000..36e5ad0 --- /dev/null +++ b/lib/pervasives.zli @@ -0,0 +1,161 @@ +(* the core module. taken from Ocaml *) +(* to debut set arguments -nopervasives -i lib/pervasives.lsi *) + +type 'a list + +val ( on ) : zero * bool -> zero +val orz : zero * zero -> zero +val ( = ) : 'a * 'a -AD-> bool +val ( <> ) : 'a * 'a -AD-> bool +val ( < ) : 'a * 'a -AD-> bool +val ( > ) : 'a * 'a -AD-> bool +val ( <= ) : 'a * 'a -AD-> bool +val ( >= ) : 'a * 'a -AD-> bool +val compare : 'a * 'a -AD-> int +val min : 'a * 'a -A-> 'a +val max : 'a * 'a -A-> 'a +val ( == ) : 'a * 'a -AD-> bool +val ( != ) : 'a * 'a -AD-> bool +val not : bool -> bool +val ( && ) : bool * bool -> bool +val ( & ) : bool * bool -> bool +val ( || ) : bool * bool -> bool +val ( or ) : bool * bool -> bool +val ( ~- ) : int -> int +val succ : int -> int +val pred : int -> int +val ( + ) : int * int -> int +val ( - ) : int * int -> int +val ( * ) : int * int -> int +val ( / ) : int * int -> int +val ( mod ) : int * int -> int +val abs : int -> int +val max_int : int +val min_int : int +val ( land ) : int * int -> int +val ( lor ) : int * int -> int +val ( lxor ) : int * int -> int +val lnot : int -> int +val ( lsl ) : int * int -> int +val ( lsr ) : int * int -> int +val ( asr ) : int * int -> int +val ( ~-. ) : float -> float +val ( +. ) : float * float -> float +val ( -. ) : float * float -> float +val ( *. ) : float * float -> float +val ( /. ) : float * float -> float +val ( ** ) : float * float -> float +val sqrt : float -> float +val exp : float -> float +val log : float -> float +val log10 : float -> float +val cos : float -> float +val sin : float -> float +val tan : float -> float +val acos : float -> float +val asin : float -> float +val atan : float -> float +val atan2 : float * float -> float +val cosh : float -> float +val sinh : float -> float +val tanh : float -> float +val ceil : float -AD-> float +val floor : float -AD-> float +val abs_float : float -> float +val mod_float : float * float -AD-> float +val frexp : float -> float * int +val ldexp : float * int -> float +val modf : float -AD-> float * float +val float : int -> float +val float_of_int : int -> float +val float_abs : float -> float +val truncate : float -AD-> int +val int_of_float : float -AD-> int +val infinity : float +val neg_infinity : float +val nan : float +val max_float : float +val min_float : float +val epsilon_float : float +type fpclass = + FP_normal (** Normal number, none of the below *) + | FP_subnormal (** Number very close to 0.0, has reduced precision *) + | FP_zero (** Number is 0.0 or -0.0 *) + | FP_infinite (** Number is positive or negative infinity *) + | FP_nan (** Not a number: result of an undefined operation *) +val classify_float : float -> fpclass +val ( ^ ) : string * string -> string +val int_of_char : char -> int +val char_of_int : int -> char +val ignore : 'a -> unit +val string_of_bool : bool -> string +val bool_of_string : string -> bool +val string_of_int : int -> string +val int_of_string : string -> int +val string_of_float : float -> string +val float_of_string : string -> float +val fst : 'a * 'b -> 'a +val snd : 'a * 'b -> 'b +type in_channel +type out_channel +val stdin : in_channel +val stdout : out_channel +val stderr : out_channel +val unsafe print_char : char -> unit +val unsafe print_string : string -> unit +val unsafe print_int : int -> unit +val unsafe print_float : float -> unit +val unsafe print_endline : string -> unit +val unsafe print_newline : unit -> unit +val unsafe prerr_char : char -> unit +val unsafe prerr_string : string -> unit +val unsafe prerr_int : int -> unit +val unsafe prerr_float : float -> unit +val unsafe prerr_endline : string -> unit +val unsafe prerr_newline : unit -> unit +val unsafe read_line : unit -> string +val unsafe read_int : unit -> int +val unsafe read_float : unit -> float +type open_flag = + Open_rdonly (** open for reading. *) + | Open_wronly (** open for writing. *) + | Open_append (** open for appending: always write at end of file. *) + | Open_creat (** create the file if it does not exist. *) + | Open_trunc (** empty the file if it already exists. *) + | Open_excl (** fail if Open_creat and the file already exists. *) + | Open_binary (** open in binary mode (no conversion). *) + | Open_text (** open in text mode (may perform conversions). *) + | Open_nonblock (** open in non-blocking mode. *) +val unsafe open_out : string -> out_channel +val unsafe open_out_bin : string -> out_channel +val unsafe open_out_gen : open_flag list * int * string -> out_channel +val unsafe flush : out_channel -> unit +val unsafe flush_all : unit -> unit +val unsafe output_char : out_channel * char -> unit +val unsafe output_string : out_channel * string -> unit +val unsafe output : out_channel * string * int * int -> unit +val unsafe output_byte : out_channel * int -> unit +val unsafe output_binary_int : out_channel * int -> unit +val unsafe output_value : out_channel * 'a -> unit +val unsafe seek_out : out_channel * int -> unit +val unsafe pos_out : out_channel -> int +val unsafe out_channel_length : out_channel -> int +val unsafe close_out : out_channel -> unit +val unsafe close_out_noerr : out_channel -> unit +val unsafe set_binary_mode_out : out_channel * bool -> unit +val unsafe open_in : string -> in_channel +val unsafe open_in_bin : string -> in_channel +val unsafe open_in_gen : open_flag list * int * string -> in_channel +val unsafe input_char : in_channel -> char +val unsafe input_line : in_channel -> string +val unsafe input : in_channel * string * int * int -> int +val unsafe really_input : in_channel * string * int * int -> unit +val unsafe input_byte : in_channel -> int +val unsafe input_binary_int : in_channel -> int +val unsafe input_value : in_channel -> 'a +val unsafe seek_in : in_channel * int -> unit +val unsafe pos_in : in_channel -> int +val unsafe in_channel_length : in_channel -> int +val unsafe close_in : in_channel -> unit +val unsafe close_in_noerr : in_channel -> unit +val unsafe set_binary_mode_in : in_channel * bool -> unit diff --git a/lib/pervasives__dual.zli b/lib/pervasives__dual.zli new file mode 100755 index 0000000..9398147 --- /dev/null +++ b/lib/pervasives__dual.zli @@ -0,0 +1,153 @@ +(* Dual numbers, used for automatic differentiation *) +(* Added by B. Caillaud *) + +type dual = Dual.t + +(* the core module. taken from Ocaml *) +(* pour debugger set arguments -nopervasives -i lib/pervasives.lsi *) + +(* Every occurrence of type float has been replaced by type dual *) + +type 'a list = 'a Pervasives.list + +val ( on ) : zero * bool -> zero +val orz : zero * zero -> zero +val ( = ) : 'a * 'a -> bool +val ( <> ) : 'a * 'a -> bool +val ( < ) : 'a * 'a -> bool +val ( > ) : 'a * 'a -> bool +val ( <= ) : 'a * 'a -> bool +val ( >= ) : 'a * 'a -> bool +val compare : 'a * 'a -> int +val min : 'a * 'a -> 'a +val max : 'a * 'a -> 'a +val ( == ) : 'a * 'a -> bool +val ( != ) : 'a * 'a -> bool +val not : bool -> bool +val ( && ) : bool * bool -> bool +val ( & ) : bool * bool -> bool +val ( || ) : bool * bool -> bool +val ( or ) : bool * bool -> bool +val ( ~- ) : int -> int +val succ : int -> int +val pred : int -> int +val ( + ) : int * int -> int +val ( - ) : int * int -> int +val ( * ) : int * int -> int +val ( / ) : int * int -> int +val ( mod ) : int * int -> int +val abs : int -> int +val max_int : int +val min_int : int +val ( land ) : int * int -> int +val ( lor ) : int * int -> int +val ( lxor ) : int * int -> int +val lnot : int -> int +val ( lsl ) : int * int -> int +val ( lsr ) : int * int -> int +val ( asr ) : int * int -> int +val ( ~-. ) : dual -> dual +val ( +. ) : dual * dual -> dual +val ( -. ) : dual * dual -> dual +val ( *. ) : dual * dual -> dual +val ( /. ) : dual * dual -> dual +val ( ** ) : dual * dual -> dual +val sqrt : dual -> dual +val exp : dual -> dual +val log : dual -> dual +val log10 : dual -> dual +val cos : dual -> dual +val sin : dual -> dual +val tan : dual -> dual +val acos : dual -> dual +val asin : dual -> dual +val atan : dual -> dual +val atan2 : dual * dual -> dual +val cosh : dual -> dual +val sinh : dual -> dual +val tanh : dual -> dual +val ceil : dual -> dual +val floor : dual -> dual +val abs_float : dual -> dual +val mod_float : dual * dual -> dual +val frexp : dual -> dual * int +val ldexp : dual * int -> dual +val modf : dual -> dual * dual +val float : int -> dual +val float_of_int : int -> dual +val truncate : dual -> int +val int_of_float : dual -> int +val infinity : dual +val neg_infinity : dual +val nan : dual +val max_float : dual +val min_float : dual +val epsilon_float : dual +type fpclass = Pervasives.fpclass +val classify_float : dual -> fpclass +val ( ^ ) : string * string -> string +val int_of_char : char -> int +val char_of_int : int -> char +val ignore : 'a -> unit +val string_of_bool : bool -> string +val bool_of_string : string -> bool +val string_of_int : int -> string +val int_of_string : string -> int +val string_of_float : dual -> string +val float_of_string : string -> dual +val fst : 'a * 'b -> 'a +val snd : 'a * 'b -> 'b +type in_channel = Pervasives.in_channel +type out_channel = Pervasives.out_channel +val stdin : in_channel +val stdout : out_channel +val stderr : out_channel +val unsafe print_char : char -> unit +val unsafe print_string : string -> unit +val unsafe print_int : int -> unit +val unsafe print_float : dual -> unit +val unsafe print_endline : string -> unit +val unsafe print_newline : unit -> unit +val unsafe prerr_char : char -> unit +val unsafe prerr_string : string -> unit +val unsafe prerr_int : int -> unit +val unsafe prerr_float : dual -> unit +val unsafe prerr_endline : string -> unit +val unsafe prerr_newline : unit -> unit +val unsafe read_line : unit -> string +val unsafe read_int : unit -> int +val unsafe read_float : unit -> dual +type open_flag = Pervasives.open_flag +val unsafe open_out : string -> out_channel +val unsafe open_out_bin : string -> out_channel +val unsafe open_out_gen : open_flag list * int * string -> out_channel +val unsafe flush : out_channel -> unit +val unsafe flush_all : unit -> unit +val unsafe output_char : out_channel * char -> unit +val unsafe output_string : out_channel * string -> unit +val unsafe output : out_channel * string * int * int -> unit +val unsafe output_byte : out_channel * int -> unit +val unsafe output_binary_int : out_channel * int -> unit +val unsafe output_value : out_channel * 'a -> unit +val unsafe seek_out : out_channel * int -> unit +val unsafe pos_out : out_channel -> int +val unsafe out_channel_length : out_channel -> int +val unsafe close_out : out_channel -> unit +val unsafe close_out_noerr : out_channel -> unit +val unsafe set_binary_mode_out : out_channel * bool -> unit +val unsafe open_in : string -> in_channel +val unsafe open_in_bin : string -> in_channel +val unsafe open_in_gen : open_flag list * int * string -> in_channel +val unsafe input_char : in_channel -> char +val unsafe input_line : in_channel -> string +val unsafe input : in_channel * string * int * int -> int +val unsafe really_input : in_channel * string * int * int -> unit +val unsafe input_byte : in_channel -> int +val unsafe input_binary_int : in_channel -> int +val unsafe input_value : in_channel -> 'a +val unsafe seek_in : in_channel * int -> unit +val unsafe pos_in : in_channel -> int +val unsafe in_channel_length : in_channel -> int +val unsafe close_in : in_channel -> unit +val unsafe close_in_noerr : in_channel -> unit +val unsafe set_binary_mode_in : in_channel * bool -> unit diff --git a/lib/random.zci b/lib/random.zci new file mode 100755 index 0000000..35113a6 Binary files /dev/null and b/lib/random.zci differ diff --git a/lib/random.zli b/lib/random.zli new file mode 100755 index 0000000..94194f7 --- /dev/null +++ b/lib/random.zli @@ -0,0 +1,39 @@ +val unsafe initialize : int -> unit +(** Initialize the generator, using the argument as a seed. + The same seed will always yield the same sequence of numbers. *) + +val unsafe full_init : int array -> unit +(** Same as {!Random.init} but takes more data as seed. *) + +val unsafe self_init : unit -> unit +(** Initialize the generator with a more-or-less random seed chosen + in a system-dependent way. *) + +val bits : unit -> int +(** Return 30 random bits in a nonnegative integer. *) + +val int : int -> int +(** [Random.int bound] returns a random integer between 0 (inclusive) + and [bound] (exclusive). [bound] must be more than 0 and less + than 2{^30}. *) + +val int32 : Int32.t -> Int32.t;; +(** [Random.int32 bound] returns a random integer between 0 (inclusive) + and [bound] (exclusive). [bound] must be greater than 0. *) + +val nativeint : Nativeint.t -> Nativeint.t;; +(** [Random.nativeint bound] returns a random integer between 0 (inclusive) + and [bound] (exclusive). [bound] must be greater than 0. *) + +val int64 : Int64.t -> Int64.t;; +(** [Random.int64 bound] returns a random integer between 0 (inclusive) + and [bound] (exclusive). [bound] must be greater than 0. *) + +val float : float -> float +(** [Random.float bound] returns a random floating-point number + between 0 (inclusive) and [bound] (exclusive). If [bound] is + negative, the result is negative or zero. If [bound] is 0, + the result is 0. *) + +val bool : unit -> bool +(** [Random.bool ()] returns [true] or [false] with probability 0.5 each. *) diff --git a/lib/scope.cmi b/lib/scope.cmi new file mode 100755 index 0000000..f870c4c Binary files /dev/null and b/lib/scope.cmi differ diff --git a/lib/scope.zci b/lib/scope.zci new file mode 100755 index 0000000..7393fef Binary files /dev/null and b/lib/scope.zci differ diff --git a/lib/string.zci b/lib/string.zci new file mode 100755 index 0000000..1b7e20e Binary files /dev/null and b/lib/string.zci differ diff --git a/lib/string.zli b/lib/string.zli new file mode 100755 index 0000000..aad3be5 --- /dev/null +++ b/lib/string.zli @@ -0,0 +1,136 @@ +val length : string -> int +(** Return the length (number of characters) of the given string. *) + +val get : string * int -> char +(** [String.get s n] returns character number [n] in string [s]. + The first character is character number 0. + The last character is character number [String.length s - 1]. + You can also write [s.[n]] instead of [String.get s n]. + + Raise [Invalid_argument "index out of bounds"] + if [n] is outside the range 0 to [(String.length s - 1)]. *) + + +val unsafe set : string * int * char -> unit +(** [String.set s n c] modifies string [s] in place, + replacing the character number [n] by [c]. + You can also write [s.[n] <- c] instead of [String.set s n c]. + Raise [Invalid_argument "index out of bounds"] + if [n] is outside the range 0 to [(String.length s - 1)]. *) + +val create : int -> string +(** [String.create n] returns a fresh string of length [n]. + The string initially contains arbitrary characters. + Raise [Invalid_argument] if [n < 0] or [n > Sys.max_string_length]. +*) + +val make : int * char -> string +(** [String.make n c] returns a fresh string of length [n], + filled with the character [c]. + Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}.*) + +val copy : string -> string +(** Return a copy of the given string. *) + +val sub : string * int * int -> string +(** [String.sub s start len] returns a fresh string of length [len], + containing the characters number [start] to [start + len - 1] + of string [s]. + Raise [Invalid_argument] if [start] and [len] do not + designate a valid substring of [s]; that is, if [start < 0], + or [len < 0], or [start + len > ]{!String.length}[ s]. *) + +val fill : string * int * int * char -> unit +(** [String.fill s start len c] modifies string [s] in place, + replacing the characters number [start] to [start + len - 1] + by [c]. + Raise [Invalid_argument] if [start] and [len] do not + designate a valid substring of [s]. *) + +val blit : string * int * string * int * int -> unit +(** [String.blit src srcoff dst dstoff len] copies [len] characters + from string [src], starting at character number [srcoff], to + string [dst], starting at character number [dstoff]. It works + correctly even if [src] and [dst] are the same string, + and the source and destination chunks overlap. + Raise [Invalid_argument] if [srcoff] and [len] do not + designate a valid substring of [src], or if [dstoff] and [len] + do not designate a valid substring of [dst]. *) + +val concat : string * string list -> string +(** [String.concat sep sl] concatenates the list of strings [sl], + inserting the separator string [sep] between each. *) + +val escaped : string -> string +(** Return a copy of the argument, with special characters + represented by escape sequences, following the lexical + conventions of Objective Caml. If there is no special + character in the argument, return the original string itself, + not a copy. *) + +val index : string * char -> int +(** [String.index s c] returns the position of the leftmost + occurrence of character [c] in string [s]. + Raise [Not_found] if [c] does not occur in [s]. *) + +val rindex : string * char -> int +(** [String.rindex s c] returns the position of the rightmost + occurrence of character [c] in string [s]. + Raise [Not_found] if [c] does not occur in [s]. *) + +val index_from : string * int * char -> int +(** Same as {!String.index}, but start + searching at the character position given as second argument. + [String.index s c] is equivalent to [String.index_from s 0 c].*) + +val rindex_from : string * int * char -> int +(** Same as {!String.rindex}, but start + searching at the character position given as second argument. + [String.rindex s c] is equivalent to + [String.rindex_from s (String.length s - 1) c]. *) + +val contains : string * char -> bool +(** [String.contains s c] tests if character [c] + appears in the string [s]. *) + +val contains_from : string * int * char -> bool +(** [String.contains_from s start c] tests if character [c] + appears in the substring of [s] starting from [start] to the end + of [s]. + Raise [Invalid_argument] if [start] is not a valid index of [s]. *) + +val rcontains_from : string * int * char -> bool +(** [String.rcontains_from s stop c] tests if character [c] + appears in the substring of [s] starting from the beginning + of [s] to index [stop]. + Raise [Invalid_argument] if [stop] is not a valid index of [s]. *) + +val uppercase : string -> string +(** Return a copy of the argument, with all lowercase letters + translated to uppercase, including accented letters of the ISO + Latin-1 (8859-1) character set. *) + +val lowercase : string -> string +(** Return a copy of the argument, with all uppercase letters + translated to lowercase, including accented letters of the ISO + Latin-1 (8859-1) character set. *) + +val capitalize : string -> string +(** Return a copy of the argument, with the first character set to uppercase. *) + +val uncapitalize : string -> string +(** Return a copy of the argument, with the first character set to lowercase. *) + +val compare: string * string -> int +(** The comparison function for strings, with the same specification as + {!Pervasives.compare}. Along with the type [t], this function [compare] + allows the module [String] to be passed as argument to the functors + {!Set.Make} and {!Map.Make}. *) + +(**/**) + +val unsafe_get : string * int -> char +val unsafe_set : string * int * char -> unit +val unsafe_blit : + string * int * string * int * int -> unit +val unsafe_fill : string * int * int * char -> unit diff --git a/lib/symb.cmi b/lib/symb.cmi new file mode 100755 index 0000000..54d9396 Binary files /dev/null and b/lib/symb.cmi differ diff --git a/lib/symb.zci b/lib/symb.zci new file mode 100755 index 0000000..daa7e23 Binary files /dev/null and b/lib/symb.zci differ diff --git a/lib/zllib.cma b/lib/zllib.cma new file mode 100755 index 0000000..85fa99d Binary files /dev/null and b/lib/zllib.cma differ diff --git a/lib/zllibgtk.cma b/lib/zllibgtk.cma new file mode 100755 index 0000000..ff6ceca Binary files /dev/null and b/lib/zllibgtk.cma differ diff --git a/lib/zls.cmi b/lib/zls.cmi new file mode 100755 index 0000000..a076506 Binary files /dev/null and b/lib/zls.cmi differ diff --git a/lib/zlsolve.cmi b/lib/zlsolve.cmi new file mode 100755 index 0000000..004ce0c Binary files /dev/null and b/lib/zlsolve.cmi differ diff --git a/lib/zlsrun.cmi b/lib/zlsrun.cmi new file mode 100755 index 0000000..5ec00b4 Binary files /dev/null and b/lib/zlsrun.cmi differ diff --git a/lib/zlsrungtk.cmi b/lib/zlsrungtk.cmi new file mode 100755 index 0000000..a7a35dd Binary files /dev/null and b/lib/zlsrungtk.cmi differ diff --git a/lib/zone.cmi b/lib/zone.cmi new file mode 100755 index 0000000..ee16d66 Binary files /dev/null and b/lib/zone.cmi differ diff --git a/lib/zone.zci b/lib/zone.zci new file mode 100755 index 0000000..917958b Binary files /dev/null and b/lib/zone.zci differ diff --git a/lib/zone.zli b/lib/zone.zli new file mode 100755 index 0000000..51a1468 --- /dev/null +++ b/lib/zone.zli @@ -0,0 +1,38 @@ +type dist +type zone +type constr +type rel +type guard + +val kill: string -> 'a +val nth : 'a list * int -> 'a +val filter: 'a list * bool list -> 'a list + +val dzero : dist +val mindist : dist list * dist -> dist + +val leq: rel +val lt: rel +val constr : int * int * rel * int -> constr + +val set_timer_number: int -> unit +val zall : unit -> zone +val zmake : constr list -> zone +val is_zempty : zone -> bool +val zequal : zone * zone -> bool +val zreset : zone * int * int -> zone +val zinter : zone * zone -> zone +val zinterfold : zone list -> zone +val zup : zone -> zone +val zdist: zone * zone -> dist list +val zdistmap: zone * zone list -> dist list +val zsweep : zone * dist * dist -> zone +val zenabled: zone * zone list -> bool list + +val zprint : string * zone -> unit +val open_graph: string -> unit +val zdraw : int * int * int * int * zone -> unit +val zdraw_clocks: int * int * int * int * zone -> unit + +val guard : string * bool -> guard +val print_guards : bool * guard list -> int \ No newline at end of file diff --git a/lib/zone_bndrel.cmi b/lib/zone_bndrel.cmi new file mode 100755 index 0000000..add28ca Binary files /dev/null and b/lib/zone_bndrel.cmi differ diff --git a/lib/zone_dbm.cmi b/lib/zone_dbm.cmi new file mode 100755 index 0000000..1dcdfdc Binary files /dev/null and b/lib/zone_dbm.cmi differ diff --git a/lib/zone_draw.cmi b/lib/zone_draw.cmi new file mode 100755 index 0000000..6e1d18b Binary files /dev/null and b/lib/zone_draw.cmi differ diff --git a/license.en.txt b/license.en.txt new file mode 100755 index 0000000..3d2a819 --- /dev/null +++ b/license.en.txt @@ -0,0 +1,517 @@ + +CeCILL-C FREE SOFTWARE LICENSE AGREEMENT + + + Notice + +This Agreement is a Free Software license agreement that is the result +of discussions between its authors in order to ensure compliance with +the two main principles guiding its drafting: + + * firstly, compliance with the principles governing the distribution + of Free Software: access to source code, broad rights granted to + users, + * secondly, the election of a governing law, French law, with which + it is conformant, both as regards the law of torts and + intellectual property law, and the protection that it offers to + both authors and holders of the economic rights over software. + +The authors of the CeCILL-C (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre]) +license are: + +Commissariat à l'Energie Atomique - CEA, a public scientific, technical +and industrial research establishment, having its principal place of +business at 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris, France. + +Centre National de la Recherche Scientifique - CNRS, a public scientific +and technological establishment, having its principal place of business +at 3 rue Michel-Ange, 75794 Paris cedex 16, France. + +Institut National de Recherche en Informatique et en Automatique - +INRIA, a public scientific and technological establishment, having its +principal place of business at Domaine de Voluceau, Rocquencourt, BP +105, 78153 Le Chesnay cedex, France. + + + Preamble + +The purpose of this Free Software license agreement is to grant users +the right to modify and re-use the software governed by this license. + +The exercising of this right is conditional upon the obligation to make +available to the community the modifications made to the source code of +the software so as to contribute to its evolution. + +In consideration of access to the source code and the rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors only have limited liability. + +In this respect, the risks associated with loading, using, modifying +and/or developing or reproducing the software by the user are brought to +the user's attention, given its Free Software status, which may make it +complicated to use, with the result that its use is reserved for +developers and experienced professionals having in-depth computer +knowledge. Users are therefore encouraged to load and test the +suitability of the software as regards their requirements in conditions +enabling the security of their systems and/or data to be ensured and, +more generally, to use and operate it in the same conditions of +security. This Agreement may be freely reproduced and published, +provided it is not altered, and that no provisions are either added or +removed herefrom. + +This Agreement may apply to any or all software for which the holder of +the economic rights decides to submit the use thereof to its provisions. + + + Article 1 - DEFINITIONS + +For the purpose of this Agreement, when the following expressions +commence with a capital letter, they shall have the following meaning: + +Agreement: means this license agreement, and its possible subsequent +versions and annexes. + +Software: means the software in its Object Code and/or Source Code form +and, where applicable, its documentation, "as is" when the Licensee +accepts the Agreement. + +Initial Software: means the Software in its Source Code and possibly its +Object Code form and, where applicable, its documentation, "as is" when +it is first distributed under the terms and conditions of the Agreement. + +Modified Software: means the Software modified by at least one +Integrated Contribution. + +Source Code: means all the Software's instructions and program lines to +which access is required so as to modify the Software. + +Object Code: means the binary files originating from the compilation of +the Source Code. + +Holder: means the holder(s) of the economic rights over the Initial +Software. + +Licensee: means the Software user(s) having accepted the Agreement. + +Contributor: means a Licensee having made at least one Integrated +Contribution. + +Licensor: means the Holder, or any other individual or legal entity, who +distributes the Software under the Agreement. + +Integrated Contribution: means any or all modifications, corrections, +translations, adaptations and/or new functions integrated into the +Source Code by any or all Contributors. + +Related Module: means a set of sources files including their +documentation that, without modification to the Source Code, enables +supplementary functions or services in addition to those offered by the +Software. + +Derivative Software: means any combination of the Software, modified or +not, and of a Related Module. + +Parties: mean both the Licensee and the Licensor. + +These expressions may be used both in singular and plural form. + + + Article 2 - PURPOSE + +The purpose of the Agreement is the grant by the Licensor to the +Licensee of a non-exclusive, transferable and worldwide license for the +Software as set forth in Article 5 hereinafter for the whole term of the +protection granted by the rights over said Software. + + + Article 3 - ACCEPTANCE + +3.1 The Licensee shall be deemed as having accepted the terms and +conditions of this Agreement upon the occurrence of the first of the +following events: + + * (i) loading the Software by any or all means, notably, by + downloading from a remote server, or by loading from a physical + medium; + * (ii) the first time the Licensee exercises any of the rights + granted hereunder. + +3.2 One copy of the Agreement, containing a notice relating to the +characteristics of the Software, to the limited warranty, and to the +fact that its use is restricted to experienced users has been provided +to the Licensee prior to its acceptance as set forth in Article 3.1 +hereinabove, and the Licensee hereby acknowledges that it has read and +understood it. + + + Article 4 - EFFECTIVE DATE AND TERM + + + 4.1 EFFECTIVE DATE + +The Agreement shall become effective on the date when it is accepted by +the Licensee as set forth in Article 3.1. + + + 4.2 TERM + +The Agreement shall remain in force for the entire legal term of +protection of the economic rights over the Software. + + + Article 5 - SCOPE OF RIGHTS GRANTED + +The Licensor hereby grants to the Licensee, who accepts, the following +rights over the Software for any or all use, and for the term of the +Agreement, on the basis of the terms and conditions set forth hereinafter. + +Besides, if the Licensor owns or comes to own one or more patents +protecting all or part of the functions of the Software or of its +components, the Licensor undertakes not to enforce the rights granted by +these patents against successive Licensees using, exploiting or +modifying the Software. If these patents are transferred, the Licensor +undertakes to have the transferees subscribe to the obligations set +forth in this paragraph. + + + 5.1 RIGHT OF USE + +The Licensee is authorized to use the Software, without any limitation +as to its fields of application, with it being hereinafter specified +that this comprises: + + 1. permanent or temporary reproduction of all or part of the Software + by any or all means and in any or all form. + + 2. loading, displaying, running, or storing the Software on any or + all medium. + + 3. entitlement to observe, study or test its operation so as to + determine the ideas and principles behind any or all constituent + elements of said Software. This shall apply when the Licensee + carries out any or all loading, displaying, running, transmission + or storage operation as regards the Software, that it is entitled + to carry out hereunder. + + + 5.2 RIGHT OF MODIFICATION + +The right of modification includes the right to translate, adapt, +arrange, or make any or all modifications to the Software, and the right +to reproduce the resulting software. It includes, in particular, the +right to create a Derivative Software. + +The Licensee is authorized to make any or all modification to the +Software provided that it includes an explicit notice that it is the +author of said modification and indicates the date of the creation thereof. + + + 5.3 RIGHT OF DISTRIBUTION + +In particular, the right of distribution includes the right to publish, +transmit and communicate the Software to the general public on any or +all medium, and by any or all means, and the right to market, either in +consideration of a fee, or free of charge, one or more copies of the +Software by any means. + +The Licensee is further authorized to distribute copies of the modified +or unmodified Software to third parties according to the terms and +conditions set forth hereinafter. + + + 5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION + +The Licensee is authorized to distribute true copies of the Software in +Source Code or Object Code form, provided that said distribution +complies with all the provisions of the Agreement and is accompanied by: + + 1. a copy of the Agreement, + + 2. a notice relating to the limitation of both the Licensor's + warranty and liability as set forth in Articles 8 and 9, + +and that, in the event that only the Object Code of the Software is +redistributed, the Licensee allows effective access to the full Source +Code of the Software at a minimum during the entire period of its +distribution of the Software, it being understood that the additional +cost of acquiring the Source Code shall not exceed the cost of +transferring the data. + + + 5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE + +When the Licensee makes an Integrated Contribution to the Software, the +terms and conditions for the distribution of the resulting Modified +Software become subject to all the provisions of this Agreement. + +The Licensee is authorized to distribute the Modified Software, in +source code or object code form, provided that said distribution +complies with all the provisions of the Agreement and is accompanied by: + + 1. a copy of the Agreement, + + 2. a notice relating to the limitation of both the Licensor's + warranty and liability as set forth in Articles 8 and 9, + +and that, in the event that only the object code of the Modified +Software is redistributed, the Licensee allows effective access to the +full source code of the Modified Software at a minimum during the entire +period of its distribution of the Modified Software, it being understood +that the additional cost of acquiring the source code shall not exceed +the cost of transferring the data. + + + 5.3.3 DISTRIBUTION OF DERIVATIVE SOFTWARE + +When the Licensee creates Derivative Software, this Derivative Software +may be distributed under a license agreement other than this Agreement, +subject to compliance with the requirement to include a notice +concerning the rights over the Software as defined in Article 6.4. +In the event the creation of the Derivative Software required modification +of the Source Code, the Licensee undertakes that: + + 1. the resulting Modified Software will be governed by this Agreement, + 2. the Integrated Contributions in the resulting Modified Software + will be clearly identified and documented, + 3. the Licensee will allow effective access to the source code of the + Modified Software, at a minimum during the entire period of + distribution of the Derivative Software, such that such + modifications may be carried over in a subsequent version of the + Software; it being understood that the additional cost of + purchasing the source code of the Modified Software shall not + exceed the cost of transferring the data. + + + 5.3.4 COMPATIBILITY WITH THE CeCILL LICENSE + +When a Modified Software contains an Integrated Contribution subject to +the CeCILL license agreement, or when a Derivative Software contains a +Related Module subject to the CeCILL license agreement, the provisions +set forth in the third item of Article 6.4 are optional. + + + Article 6 - INTELLECTUAL PROPERTY + + + 6.1 OVER THE INITIAL SOFTWARE + +The Holder owns the economic rights over the Initial Software. Any or +all use of the Initial Software is subject to compliance with the terms +and conditions under which the Holder has elected to distribute its work +and no one shall be entitled to modify the terms and conditions for the +distribution of said Initial Software. + +The Holder undertakes that the Initial Software will remain ruled at +least by this Agreement, for the duration set forth in Article 4.2. + + + 6.2 OVER THE INTEGRATED CONTRIBUTIONS + +The Licensee who develops an Integrated Contribution is the owner of the +intellectual property rights over this Contribution as defined by +applicable law. + + + 6.3 OVER THE RELATED MODULES + +The Licensee who develops a Related Module is the owner of the +intellectual property rights over this Related Module as defined by +applicable law and is free to choose the type of agreement that shall +govern its distribution under the conditions defined in Article 5.3.3. + + + 6.4 NOTICE OF RIGHTS + +The Licensee expressly undertakes: + + 1. not to remove, or modify, in any manner, the intellectual property + notices attached to the Software; + + 2. to reproduce said notices, in an identical manner, in the copies + of the Software modified or not; + + 3. to ensure that use of the Software, its intellectual property + notices and the fact that it is governed by the Agreement is + indicated in a text that is easily accessible, specifically from + the interface of any Derivative Software. + +The Licensee undertakes not to directly or indirectly infringe the +intellectual property rights of the Holder and/or Contributors on the +Software and to take, where applicable, vis-à-vis its staff, any and all +measures required to ensure respect of said intellectual property rights +of the Holder and/or Contributors. + + + Article 7 - RELATED SERVICES + +7.1 Under no circumstances shall the Agreement oblige the Licensor to +provide technical assistance or maintenance services for the Software. + +However, the Licensor is entitled to offer this type of services. The +terms and conditions of such technical assistance, and/or such +maintenance, shall be set forth in a separate instrument. Only the +Licensor offering said maintenance and/or technical assistance services +shall incur liability therefor. + +7.2 Similarly, any Licensor is entitled to offer to its licensees, under +its sole responsibility, a warranty, that shall only be binding upon +itself, for the redistribution of the Software and/or the Modified +Software, under terms and conditions that it is free to decide. Said +warranty, and the financial terms and conditions of its application, +shall be subject of a separate instrument executed between the Licensor +and the Licensee. + + + Article 8 - LIABILITY + +8.1 Subject to the provisions of Article 8.2, the Licensee shall be +entitled to claim compensation for any direct loss it may have suffered +from the Software as a result of a fault on the part of the relevant +Licensor, subject to providing evidence thereof. + +8.2 The Licensor's liability is limited to the commitments made under +this Agreement and shall not be incurred as a result of in particular: +(i) loss due the Licensee's total or partial failure to fulfill its +obligations, (ii) direct or consequential loss that is suffered by the +Licensee due to the use or performance of the Software, and (iii) more +generally, any consequential loss. In particular the Parties expressly +agree that any or all pecuniary or business loss (i.e. loss of data, +loss of profits, operating loss, loss of customers or orders, +opportunity cost, any disturbance to business activities) or any or all +legal proceedings instituted against the Licensee by a third party, +shall constitute consequential loss and shall not provide entitlement to +any or all compensation from the Licensor. + + + Article 9 - WARRANTY + +9.1 The Licensee acknowledges that the scientific and technical +state-of-the-art when the Software was distributed did not enable all +possible uses to be tested and verified, nor for the presence of +possible defects to be detected. In this respect, the Licensee's +attention has been drawn to the risks associated with loading, using, +modifying and/or developing and reproducing the Software which are +reserved for experienced users. + +The Licensee shall be responsible for verifying, by any or all means, +the suitability of the product for its requirements, its good working +order, and for ensuring that it shall not cause damage to either persons +or properties. + +9.2 The Licensor hereby represents, in good faith, that it is entitled +to grant all the rights over the Software (including in particular the +rights set forth in Article 5). + +9.3 The Licensee acknowledges that the Software is supplied "as is" by +the Licensor without any other express or tacit warranty, other than +that provided for in Article 9.2 and, in particular, without any warranty +as to its commercial value, its secured, safe, innovative or relevant +nature. + +Specifically, the Licensor does not warrant that the Software is free +from any error, that it will operate without interruption, that it will +be compatible with the Licensee's own equipment and software +configuration, nor that it will meet the Licensee's requirements. + +9.4 The Licensor does not either expressly or tacitly warrant that the +Software does not infringe any third party intellectual property right +relating to a patent, software or any other property right. Therefore, +the Licensor disclaims any and all liability towards the Licensee +arising out of any or all proceedings for infringement that may be +instituted in respect of the use, modification and redistribution of the +Software. Nevertheless, should such proceedings be instituted against +the Licensee, the Licensor shall provide it with technical and legal +assistance for its defense. Such technical and legal assistance shall be +decided on a case-by-case basis between the relevant Licensor and the +Licensee pursuant to a memorandum of understanding. The Licensor +disclaims any and all liability as regards the Licensee's use of the +name of the Software. No warranty is given as regards the existence of +prior rights over the name of the Software or as regards the existence +of a trademark. + + + Article 10 - TERMINATION + +10.1 In the event of a breach by the Licensee of its obligations +hereunder, the Licensor may automatically terminate this Agreement +thirty (30) days after notice has been sent to the Licensee and has +remained ineffective. + +10.2 A Licensee whose Agreement is terminated shall no longer be +authorized to use, modify or distribute the Software. However, any +licenses that it may have granted prior to termination of the Agreement +shall remain valid subject to their having been granted in compliance +with the terms and conditions hereof. + + + Article 11 - MISCELLANEOUS + + + 11.1 EXCUSABLE EVENTS + +Neither Party shall be liable for any or all delay, or failure to +perform the Agreement, that may be attributable to an event of force +majeure, an act of God or an outside cause, such as defective +functioning or interruptions of the electricity or telecommunications +networks, network paralysis following a virus attack, intervention by +government authorities, natural disasters, water damage, earthquakes, +fire, explosions, strikes and labor unrest, war, etc. + +11.2 Any failure by either Party, on one or more occasions, to invoke +one or more of the provisions hereof, shall under no circumstances be +interpreted as being a waiver by the interested Party of its right to +invoke said provision(s) subsequently. + +11.3 The Agreement cancels and replaces any or all previous agreements, +whether written or oral, between the Parties and having the same +purpose, and constitutes the entirety of the agreement between said +Parties concerning said purpose. No supplement or modification to the +terms and conditions hereof shall be effective as between the Parties +unless it is made in writing and signed by their duly authorized +representatives. + +11.4 In the event that one or more of the provisions hereof were to +conflict with a current or future applicable act or legislative text, +said act or legislative text shall prevail, and the Parties shall make +the necessary amendments so as to comply with said act or legislative +text. All other provisions shall remain effective. Similarly, invalidity +of a provision of the Agreement, for any reason whatsoever, shall not +cause the Agreement as a whole to be invalid. + + + 11.5 LANGUAGE + +The Agreement is drafted in both French and English and both versions +are deemed authentic. + + + Article 12 - NEW VERSIONS OF THE AGREEMENT + +12.1 Any person is authorized to duplicate and distribute copies of this +Agreement. + +12.2 So as to ensure coherence, the wording of this Agreement is +protected and may only be modified by the authors of the License, who +reserve the right to periodically publish updates or new versions of the +Agreement, each with a separate number. These subsequent versions may +address new issues encountered by Free Software. + +12.3 Any Software distributed under a given version of the Agreement may +only be subsequently distributed under the same version of the Agreement +or a subsequent version. + + + Article 13 - GOVERNING LAW AND JURISDICTION + +13.1 The Agreement is governed by French law. The Parties agree to +endeavor to seek an amicable solution to any disagreements or disputes +that may arise during the performance of the Agreement. + +13.2 Failing an amicable solution within two (2) months as from their +occurrence, and unless emergency proceedings are necessary, the +disagreements or disputes shall be referred to the Paris Courts having +jurisdiction, by the more diligent Party. + + +Version 1.0 dated 2006-09-05. diff --git a/license.fr.txt b/license.fr.txt new file mode 100755 index 0000000..4fa44ba --- /dev/null +++ b/license.fr.txt @@ -0,0 +1,521 @@ + +CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL-C + + + Avertissement + +Ce contrat est une licence de logiciel libre issue d'une concertation +entre ses auteurs afin que le respect de deux grands principes préside à +sa rédaction: + + * d'une part, le respect des principes de diffusion des logiciels + libres: accès au code source, droits étendus conférés aux + utilisateurs, + * d'autre part, la désignation d'un droit applicable, le droit + français, auquel elle est conforme, tant au regard du droit de la + responsabilité civile que du droit de la propriété intellectuelle + et de la protection qu'il offre aux auteurs et titulaires des + droits patrimoniaux sur un logiciel. + +Les auteurs de la licence CeCILL-C (pour Ce[a] C[nrs] I[nria] L[ogiciel] +L[ibre]) sont: + +Commissariat à l'Energie Atomique - CEA, établissement public de +recherche à caractère scientifique, technique et industriel, dont le +siège est situé 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris. + +Centre National de la Recherche Scientifique - CNRS, établissement +public à caractère scientifique et technologique, dont le siège est +situé 3 rue Michel-Ange, 75794 Paris cedex 16. + +Institut National de Recherche en Informatique et en Automatique - +INRIA, établissement public à caractère scientifique et technologique, +dont le siège est situé Domaine de Voluceau, Rocquencourt, BP 105, 78153 +Le Chesnay cedex. + + + Préambule + +Ce contrat est une licence de logiciel libre dont l'objectif est de +conférer aux utilisateurs la liberté de modifier et de réutiliser le +logiciel régi par cette licence. + +L'exercice de cette liberté est assorti d'une obligation de remettre à +la disposition de la communauté les modifications apportées au code +source du logiciel afin de contribuer à son évolution. + +L'accessibilité au code source et les droits de copie, de modification +et de redistribution qui découlent de ce contrat ont pour contrepartie +de n'offrir aux utilisateurs qu'une garantie limitée et de ne faire +peser sur l'auteur du logiciel, le titulaire des droits patrimoniaux et +les concédants successifs qu'une responsabilité restreinte. + +A cet égard l'attention de l'utilisateur est attirée sur les risques +associés au chargement, à l'utilisation, à la modification et/ou au +développement et à la reproduction du logiciel par l'utilisateur étant +donné sa spécificité de logiciel libre, qui peut le rendre complexe à +manipuler et qui le réserve donc à des développeurs ou des +professionnels avertis possédant des connaissances informatiques +approfondies. Les utilisateurs sont donc invités à charger et tester +l'adéquation du logiciel à leurs besoins dans des conditions permettant +d'assurer la sécurité de leurs systèmes et/ou de leurs données et, plus +généralement, à l'utiliser et l'exploiter dans les mêmes conditions de +sécurité. Ce contrat peut être reproduit et diffusé librement, sous +réserve de le conserver en l'état, sans ajout ni suppression de clauses. + +Ce contrat est susceptible de s'appliquer à tout logiciel dont le +titulaire des droits patrimoniaux décide de soumettre l'exploitation aux +dispositions qu'il contient. + + + Article 1 - DEFINITIONS + +Dans ce contrat, les termes suivants, lorsqu'ils seront écrits avec une +lettre capitale, auront la signification suivante: + +Contrat: désigne le présent contrat de licence, ses éventuelles versions +postérieures et annexes. + +Logiciel: désigne le logiciel sous sa forme de Code Objet et/ou de Code +Source et le cas échéant sa documentation, dans leur état au moment de +l'acceptation du Contrat par le Licencié. + +Logiciel Initial: désigne le Logiciel sous sa forme de Code Source et +éventuellement de Code Objet et le cas échéant sa documentation, dans +leur état au moment de leur première diffusion sous les termes du Contrat. + +Logiciel Modifié: désigne le Logiciel modifié par au moins une +Contribution Intégrée. + +Code Source: désigne l'ensemble des instructions et des lignes de +programme du Logiciel et auquel l'accès est nécessaire en vue de +modifier le Logiciel. + +Code Objet: désigne les fichiers binaires issus de la compilation du +Code Source. + +Titulaire: désigne le ou les détenteurs des droits patrimoniaux d'auteur +sur le Logiciel Initial. + +Licencié: désigne le ou les utilisateurs du Logiciel ayant accepté le +Contrat. + +Contributeur: désigne le Licencié auteur d'au moins une Contribution +Intégrée. + +Concédant: désigne le Titulaire ou toute personne physique ou morale +distribuant le Logiciel sous le Contrat. + +Contribution Intégrée: désigne l'ensemble des modifications, +corrections, traductions, adaptations et/ou nouvelles fonctionnalités +intégrées dans le Code Source par tout Contributeur. + +Module Lié: désigne un ensemble de fichiers sources y compris leur +documentation qui, sans modification du Code Source, permet de réaliser +des fonctionnalités ou services supplémentaires à ceux fournis par le +Logiciel. + +Logiciel Dérivé: désigne toute combinaison du Logiciel, modifié ou non, +et d'un Module Lié. + +Parties: désigne collectivement le Licencié et le Concédant. + +Ces termes s'entendent au singulier comme au pluriel. + + + Article 2 - OBJET + +Le Contrat a pour objet la concession par le Concédant au Licencié d'une +licence non exclusive, cessible et mondiale du Logiciel telle que +définie ci-après à l'article 5 pour toute la durée de protection des droits +portant sur ce Logiciel. + + + Article 3 - ACCEPTATION + +3.1 L'acceptation par le Licencié des termes du Contrat est réputée +acquise du fait du premier des faits suivants: + + * (i) le chargement du Logiciel par tout moyen notamment par + téléchargement à partir d'un serveur distant ou par chargement à + partir d'un support physique; + * (ii) le premier exercice par le Licencié de l'un quelconque des + droits concédés par le Contrat. + +3.2 Un exemplaire du Contrat, contenant notamment un avertissement +relatif aux spécificités du Logiciel, à la restriction de garantie et à +la limitation à un usage par des utilisateurs expérimentés a été mis à +disposition du Licencié préalablement à son acceptation telle que +définie à l'article 3.1 ci dessus et le Licencié reconnaît en avoir pris +connaissance. + + + Article 4 - ENTREE EN VIGUEUR ET DUREE + + + 4.1 ENTREE EN VIGUEUR + +Le Contrat entre en vigueur à la date de son acceptation par le Licencié +telle que définie en 3.1. + + + 4.2 DUREE + +Le Contrat produira ses effets pendant toute la durée légale de +protection des droits patrimoniaux portant sur le Logiciel. + + + Article 5 - ETENDUE DES DROITS CONCEDES + +Le Concédant concède au Licencié, qui accepte, les droits suivants sur +le Logiciel pour toutes destinations et pour la durée du Contrat dans +les conditions ci-après détaillées. + +Par ailleurs, si le Concédant détient ou venait à détenir un ou +plusieurs brevets d'invention protégeant tout ou partie des +fonctionnalités du Logiciel ou de ses composants, il s'engage à ne pas +opposer les éventuels droits conférés par ces brevets aux Licenciés +successifs qui utiliseraient, exploiteraient ou modifieraient le +Logiciel. En cas de cession de ces brevets, le Concédant s'engage à +faire reprendre les obligations du présent alinéa aux cessionnaires. + + + 5.1 DROIT D'UTILISATION + +Le Licencié est autorisé à utiliser le Logiciel, sans restriction quant +aux domaines d'application, étant ci-après précisé que cela comporte: + + 1. la reproduction permanente ou provisoire du Logiciel en tout ou + partie par tout moyen et sous toute forme. + + 2. le chargement, l'affichage, l'exécution, ou le stockage du + Logiciel sur tout support. + + 3. la possibilité d'en observer, d'en étudier, ou d'en tester le + fonctionnement afin de déterminer les idées et principes qui sont + à la base de n'importe quel élément de ce Logiciel; et ceci, + lorsque le Licencié effectue toute opération de chargement, + d'affichage, d'exécution, de transmission ou de stockage du + Logiciel qu'il est en droit d'effectuer en vertu du Contrat. + + + 5.2 DROIT DE MODIFICATION + +Le droit de modification comporte le droit de traduire, d'adapter, +d'arranger ou d'apporter toute autre modification au Logiciel et le +droit de reproduire le logiciel en résultant. Il comprend en particulier +le droit de créer un Logiciel Dérivé. + +Le Licencié est autorisé à apporter toute modification au Logiciel sous +réserve de mentionner, de façon explicite, son nom en tant qu'auteur de +cette modification et la date de création de celle-ci. + + + 5.3 DROIT DE DISTRIBUTION + +Le droit de distribution comporte notamment le droit de diffuser, de +transmettre et de communiquer le Logiciel au public sur tout support et +par tout moyen ainsi que le droit de mettre sur le marché à titre +onéreux ou gratuit, un ou des exemplaires du Logiciel par tout procédé. + +Le Licencié est autorisé à distribuer des copies du Logiciel, modifié ou +non, à des tiers dans les conditions ci-après détaillées. + + + 5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION + +Le Licencié est autorisé à distribuer des copies conformes du Logiciel, +sous forme de Code Source ou de Code Objet, à condition que cette +distribution respecte les dispositions du Contrat dans leur totalité et +soit accompagnée: + + 1. d'un exemplaire du Contrat, + + 2. d'un avertissement relatif à la restriction de garantie et de + responsabilité du Concédant telle que prévue aux articles 8 + et 9, + +et que, dans le cas où seul le Code Objet du Logiciel est redistribué, +le Licencié permette un accès effectif au Code Source complet du +Logiciel pendant au moins toute la durée de sa distribution du Logiciel, +étant entendu que le coût additionnel d'acquisition du Code Source ne +devra pas excéder le simple coût de transfert des données. + + + 5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE + +Lorsque le Licencié apporte une Contribution Intégrée au Logiciel, les +conditions de distribution du Logiciel Modifié en résultant sont alors +soumises à l'intégralité des dispositions du Contrat. + +Le Licencié est autorisé à distribuer le Logiciel Modifié sous forme de +code source ou de code objet, à condition que cette distribution +respecte les dispositions du Contrat dans leur totalité et soit +accompagnée: + + 1. d'un exemplaire du Contrat, + + 2. d'un avertissement relatif à la restriction de garantie et de + responsabilité du Concédant telle que prévue aux articles 8 + et 9, + +et que, dans le cas où seul le code objet du Logiciel Modifié est +redistribué, le Licencié permette un accès effectif à son code source +complet pendant au moins toute la durée de sa distribution du Logiciel +Modifié, étant entendu que le coût additionnel d'acquisition du code +source ne devra pas excéder le simple coût de transfert des données. + + + 5.3.3 DISTRIBUTION DU LOGICIEL DERIVE + +Lorsque le Licencié crée un Logiciel Dérivé, ce Logiciel Dérivé peut +être distribué sous un contrat de licence autre que le présent Contrat à +condition de respecter les obligations de mention des droits sur le +Logiciel telles que définies à l'article 6.4. Dans le cas où la création du +Logiciel Dérivé a nécessité une modification du Code Source le licencié +s'engage à ce que: + + 1. le Logiciel Modifié correspondant à cette modification soit régi + par le présent Contrat, + 2. les Contributions Intégrées dont le Logiciel Modifié résulte + soient clairement identifiées et documentées, + 3. le Licencié permette un accès effectif au code source du Logiciel + Modifié, pendant au moins toute la durée de la distribution du + Logiciel Dérivé, de telle sorte que ces modifications puissent + être reprises dans une version ultérieure du Logiciel, étant + entendu que le coût additionnel d'acquisition du code source du + Logiciel Modifié ne devra pas excéder le simple coût du transfert + des données. + + + 5.3.4 COMPATIBILITE AVEC LA LICENCE CeCILL + +Lorsqu'un Logiciel Modifié contient une Contribution Intégrée soumise au +contrat de licence CeCILL, ou lorsqu'un Logiciel Dérivé contient un +Module Lié soumis au contrat de licence CeCILL, les stipulations prévues +au troisième item de l'article 6.4 sont facultatives. + + + Article 6 - PROPRIETE INTELLECTUELLE + + + 6.1 SUR LE LOGICIEL INITIAL + +Le Titulaire est détenteur des droits patrimoniaux sur le Logiciel +Initial. Toute utilisation du Logiciel Initial est soumise au respect +des conditions dans lesquelles le Titulaire a choisi de diffuser son +oeuvre et nul autre n'a la faculté de modifier les conditions de +diffusion de ce Logiciel Initial. + +Le Titulaire s'engage à ce que le Logiciel Initial reste au moins régi +par le Contrat et ce, pour la durée visée à l'article 4.2. + + + 6.2 SUR LES CONTRIBUTIONS INTEGREES + +Le Licencié qui a développé une Contribution Intégrée est titulaire sur +celle-ci des droits de propriété intellectuelle dans les conditions +définies par la législation applicable. + + + 6.3 SUR LES MODULES LIES + +Le Licencié qui a développé un Module Lié est titulaire sur celui-ci des +droits de propriété intellectuelle dans les conditions définies par la +législation applicable et reste libre du choix du contrat régissant sa +diffusion dans les conditions définies à l'article 5.3.3. + + + 6.4 MENTIONS DES DROITS + +Le Licencié s'engage expressément: + + 1. à ne pas supprimer ou modifier de quelque manière que ce soit les + mentions de propriété intellectuelle apposées sur le Logiciel; + + 2. à reproduire à l'identique lesdites mentions de propriété + intellectuelle sur les copies du Logiciel modifié ou non; + + 3. à faire en sorte que l'utilisation du Logiciel, ses mentions de + propriété intellectuelle et le fait qu'il est régi par le Contrat + soient indiqués dans un texte facilement accessible notamment + depuis l'interface de tout Logiciel Dérivé. + +Le Licencié s'engage à ne pas porter atteinte, directement ou +indirectement, aux droits de propriété intellectuelle du Titulaire et/ou +des Contributeurs sur le Logiciel et à prendre, le cas échéant, à +l'égard de son personnel toutes les mesures nécessaires pour assurer le +respect des dits droits de propriété intellectuelle du Titulaire et/ou +des Contributeurs. + + + Article 7 - SERVICES ASSOCIES + +7.1 Le Contrat n'oblige en aucun cas le Concédant à la réalisation de +prestations d'assistance technique ou de maintenance du Logiciel. + +Cependant le Concédant reste libre de proposer ce type de services. Les +termes et conditions d'une telle assistance technique et/ou d'une telle +maintenance seront alors déterminés dans un acte séparé. Ces actes de +maintenance et/ou assistance technique n'engageront que la seule +responsabilité du Concédant qui les propose. + +7.2 De même, tout Concédant est libre de proposer, sous sa seule +responsabilité, à ses licenciés une garantie, qui n'engagera que lui, +lors de la redistribution du Logiciel et/ou du Logiciel Modifié et ce, +dans les conditions qu'il souhaite. Cette garantie et les modalités +financières de son application feront l'objet d'un acte séparé entre le +Concédant et le Licencié. + + + Article 8 - RESPONSABILITE + +8.1 Sous réserve des dispositions de l'article 8.2, le Licencié a la +faculté, sous réserve de prouver la faute du Concédant concerné, de +solliciter la réparation du préjudice direct qu'il subirait du fait du +Logiciel et dont il apportera la preuve. + +8.2 La responsabilité du Concédant est limitée aux engagements pris en +application du Contrat et ne saurait être engagée en raison notamment: +(i) des dommages dus à l'inexécution, totale ou partielle, de ses +obligations par le Licencié, (ii) des dommages directs ou indirects +découlant de l'utilisation ou des performances du Logiciel subis par le +Licencié et (iii) plus généralement d'un quelconque dommage indirect. En +particulier, les Parties conviennent expressément que tout préjudice +financier ou commercial (par exemple perte de données, perte de +bénéfices, perte d'exploitation, perte de clientèle ou de commandes, +manque à gagner, trouble commercial quelconque) ou toute action dirigée +contre le Licencié par un tiers, constitue un dommage indirect et +n'ouvre pas droit à réparation par le Concédant. + + + Article 9 - GARANTIE + +9.1 Le Licencié reconnaît que l'état actuel des connaissances +scientifiques et techniques au moment de la mise en circulation du +Logiciel ne permet pas d'en tester et d'en vérifier toutes les +utilisations ni de détecter l'existence d'éventuels défauts. L'attention +du Licencié a été attirée sur ce point sur les risques associés au +chargement, à l'utilisation, la modification et/ou au développement et à +la reproduction du Logiciel qui sont réservés à des utilisateurs avertis. + +Il relève de la responsabilité du Licencié de contrôler, par tous +moyens, l'adéquation du produit à ses besoins, son bon fonctionnement et +de s'assurer qu'il ne causera pas de dommages aux personnes et aux biens. + +9.2 Le Concédant déclare de bonne foi être en droit de concéder +l'ensemble des droits attachés au Logiciel (comprenant notamment les +droits visés à l'article 5). + +9.3 Le Licencié reconnaît que le Logiciel est fourni "en l'état" par le +Concédant sans autre garantie, expresse ou tacite, que celle prévue à +l'article 9.2 et notamment sans aucune garantie sur sa valeur commerciale, +son caractère sécurisé, innovant ou pertinent. + +En particulier, le Concédant ne garantit pas que le Logiciel est exempt +d'erreur, qu'il fonctionnera sans interruption, qu'il sera compatible +avec l'équipement du Licencié et sa configuration logicielle ni qu'il +remplira les besoins du Licencié. + +9.4 Le Concédant ne garantit pas, de manière expresse ou tacite, que le +Logiciel ne porte pas atteinte à un quelconque droit de propriété +intellectuelle d'un tiers portant sur un brevet, un logiciel ou sur tout +autre droit de propriété. Ainsi, le Concédant exclut toute garantie au +profit du Licencié contre les actions en contrefaçon qui pourraient être +diligentées au titre de l'utilisation, de la modification, et de la +redistribution du Logiciel. Néanmoins, si de telles actions sont +exercées contre le Licencié, le Concédant lui apportera son aide +technique et juridique pour sa défense. Cette aide technique et +juridique est déterminée au cas par cas entre le Concédant concerné et +le Licencié dans le cadre d'un protocole d'accord. Le Concédant dégage +toute responsabilité quant à l'utilisation de la dénomination du +Logiciel par le Licencié. Aucune garantie n'est apportée quant à +l'existence de droits antérieurs sur le nom du Logiciel et sur +l'existence d'une marque. + + + Article 10 - RESILIATION + +10.1 En cas de manquement par le Licencié aux obligations mises à sa +charge par le Contrat, le Concédant pourra résilier de plein droit le +Contrat trente (30) jours après notification adressée au Licencié et +restée sans effet. + +10.2 Le Licencié dont le Contrat est résilié n'est plus autorisé à +utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les +licences qu'il aura concédées antérieurement à la résiliation du Contrat +resteront valides sous réserve qu'elles aient été effectuées en +conformité avec le Contrat. + + + Article 11 - DISPOSITIONS DIVERSES + + + 11.1 CAUSE EXTERIEURE + +Aucune des Parties ne sera responsable d'un retard ou d'une défaillance +d'exécution du Contrat qui serait dû à un cas de force majeure, un cas +fortuit ou une cause extérieure, telle que, notamment, le mauvais +fonctionnement ou les interruptions du réseau électrique ou de +télécommunication, la paralysie du réseau liée à une attaque +informatique, l'intervention des autorités gouvernementales, les +catastrophes naturelles, les dégâts des eaux, les tremblements de terre, +le feu, les explosions, les grèves et les conflits sociaux, l'état de +guerre... + +11.2 Le fait, par l'une ou l'autre des Parties, d'omettre en une ou +plusieurs occasions de se prévaloir d'une ou plusieurs dispositions du +Contrat, ne pourra en aucun cas impliquer renonciation par la Partie +intéressée à s'en prévaloir ultérieurement. + +11.3 Le Contrat annule et remplace toute convention antérieure, écrite +ou orale, entre les Parties sur le même objet et constitue l'accord +entier entre les Parties sur cet objet. Aucune addition ou modification +aux termes du Contrat n'aura d'effet à l'égard des Parties à moins +d'être faite par écrit et signée par leurs représentants dûment habilités. + +11.4 Dans l'hypothèse où une ou plusieurs des dispositions du Contrat +s'avèrerait contraire à une loi ou à un texte applicable, existants ou +futurs, cette loi ou ce texte prévaudrait, et les Parties feraient les +amendements nécessaires pour se conformer à cette loi ou à ce texte. +Toutes les autres dispositions resteront en vigueur. De même, la +nullité, pour quelque raison que ce soit, d'une des dispositions du +Contrat ne saurait entraîner la nullité de l'ensemble du Contrat. + + + 11.5 LANGUE + +Le Contrat est rédigé en langue française et en langue anglaise, ces +deux versions faisant également foi. + + + Article 12 - NOUVELLES VERSIONS DU CONTRAT + +12.1 Toute personne est autorisée à copier et distribuer des copies de +ce Contrat. + +12.2 Afin d'en préserver la cohérence, le texte du Contrat est protégé +et ne peut être modifié que par les auteurs de la licence, lesquels se +réservent le droit de publier périodiquement des mises à jour ou de +nouvelles versions du Contrat, qui posséderont chacune un numéro +distinct. Ces versions ultérieures seront susceptibles de prendre en +compte de nouvelles problématiques rencontrées par les logiciels libres. + +12.3 Tout Logiciel diffusé sous une version donnée du Contrat ne pourra +faire l'objet d'une diffusion ultérieure que sous la même version du +Contrat ou une version postérieure. + + + Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE + +13.1 Le Contrat est régi par la loi française. Les Parties conviennent +de tenter de régler à l'amiable les différends ou litiges qui +viendraient à se produire par suite ou à l'occasion du Contrat. + +13.2 A défaut d'accord amiable dans un délai de deux (2) mois à compter +de leur survenance et sauf situation relevant d'une procédure d'urgence, +les différends ou litiges seront portés par la Partie la plus diligente +devant les Tribunaux compétents de Paris. + + +Version 1.0 du 2006-09-05.