Commit 01491c4d authored by POGODALLA Sylvain's avatar POGODALLA Sylvain

Merged the branch branches/sylvain-2012-11-19 back to trunk. ACG 2nd order...

Merged the branch branches/sylvain-2012-11-19 back to trunk. ACG 2nd order parsing is now available in trunk
parent 6de35473
......@@ -24,8 +24,10 @@
In order to compile the ACG toolkit, you need:
+ ocaml (>=3.07) installed (http://caml.inria.fr/)
+ dypgen (>=20080925) installed (http://dypgen.free.fr/)
+ bolt (>=1.4) installed (http://bolt.x9c.fr/downloads.html
=======
IMPORTANT:
A fast an easy way to install dypgen and all important ocaml libraries is
......@@ -36,6 +38,8 @@ The installation typically goes that way:
+ then install opam
+ then install dypgen with the command
opam install dypgen
+ then install bolt with the command
opam install bolt
+ don't forget to add the required library in your path
(look at "Initializing opam" at
http://opam.ocaml.org/doc/Advanced_Install.html)
......@@ -67,7 +71,7 @@ For instance, run:
Then run:
make
make byte
to get the bytecode executable, or
......@@ -75,7 +79,7 @@ to get the bytecode executable, or
to get native code binaries
It should produce executables in the current directory: acgc (or
It should produce two executables in the current directory: acgc (or
acgc.opt for the native code executable) and acg (or acg.opt for the
native code executable).
......
......@@ -17,9 +17,9 @@
# #
##########################################################################
.PHONY: config byte opt clean superclean install tar version release
.PHONY: config byte opt clean superclean install tar version release test force
BINARIES=acgc acgc.opt acg acg.opt
BINARIES=acg acg.opt acgc acgc.opt
VERSION_FILE = src/utils/version.ml
VERSION = $(shell date "+%Y%m%d")
......@@ -27,22 +27,38 @@ RELEASE = acg-$(VERSION)
TAR_RELEASE =acg-$(TAR_VERSION)
prefix = @prefix@
exec_prefix = @exec_prefix@
byte opt:
$(MAKE) -C src $@ && for file in $(BINARIES); do find . -name "$$file" -exec cp {} . \; ; done
ACG_DIR=src/scripting
ACGC_DIR=src/acg-data
byte: acg acgc
opt: acg.opt acgc.opt
all: byte opt test
acg acg.opt: force
$(MAKE) -C $(ACG_DIR) $@
cp $(ACG_DIR)/$@ .
acgc acgc.opt: force
$(MAKE) -C $(ACGC_DIR) $@
cp $(ACGC_DIR)/$@ .
force:
all: byte opt
test:
$(MAKE) -C src $@
clean:
-if test "$@" = clean ; then $(MAKE) -C config $@ ; fi
-$(MAKE) -C src $@
rm -rf *.log *~ autom4te.cache *.tar.gz
rm -rf *.log *~ autom4te.cache *.tar.gz *.acgo
find . -name "*~" -exec rm -f {} \;
-for file in $(BINARIES); do rm $$file ; done
-for file in $(BINARIES); do rm -f $$file ; done
superclean: clean
-find . -path "./*/*.in" -print | sed -e 's/\(.*\)\.in/\1/' | xargs -n 1 rm
......@@ -58,7 +74,7 @@ uninstall:
config: configure
configure: config/configure.ac
configure: config/configure.ac config/ac_lib_checking.m4
cd $(<D) && autoconf && mv configure .. & cd ..
tar: TAR_VERSION = $(shell grep "^DEFINE" $(VERSION_FILE) | sed -e 's/DEFINE.* = "\(.*\)"/\1/')
......@@ -67,7 +83,7 @@ tar: superclean
if test -d ../$(TAR_RELEASE) ; then rm ../$(TAR_RELEASE) ; fi
cd .. && ln -s trunk $(TAR_RELEASE) && cd trunk
echo $(TAR_RELEASE).tar.gz
tar cvfz ../$(TAR_RELEASE).tar.gz -C .. -h $(TAR_RELEASE) --exclude="*/.svn*" --exclude "$(TAR_RELEASE)/data" --exclude "$(TAR_RELEASE)/src/data" --exclude "$(TAR_RELEASE)/src/*.old" --exclude "$(TAR_RELEASE)/*.tar.*" && mv ../$(TAR_RELEASE).tar.gz .
tar cvfz ../$(TAR_RELEASE).tar.gz -C .. -h $(TAR_RELEASE) --exclude="*/.svn*" --exclude "$(TAR_RELEASE)/data" --exclude "$(TAR_RELEASE)/src/data" --exclude "$(TAR_RELEASE)/src/*.old" --exclude "$(TAR_RELEASE)/*.tar.*" --exclude "$(TAR_RELEASE)/TODO" --exclude "$(TAR_RELEASE)/*~" && mv ../$(TAR_RELEASE).tar.gz .
if test -d ../$(TAR_RELEASE) ; then rm ../$(TAR_RELEASE) ; fi
./configure
......
......@@ -32,8 +32,8 @@ and
acgc is a "compiler" of ACG source code, i.e. files containing
definitions of signarures and lexicons. It basically checks whether
they are correctly written (syntactically and wrt types and constant
typing). An interactive mode is available to parse terms according to
signatures.
typing) and outputs a .acgo object file. An interactive mode is
available to parse terms according to signatures.
Run
......@@ -55,11 +55,57 @@ then on the prompt type
help;
Example files are given in the ./examples directory. Read the
./examples/README file
***************
* Basic usage *
***************
Let's assume you defined a file my_acg.acg in directory my_dir. A
basic usage of the acgc and acg commands could be:
$ acgc -o my_acg.acgo my_acg.acg
This will produce a my_acg.acgo file (note that this is the default
name and location if the -o option is not provided).
Then, running :
$ acg
will open a prompt in which you can type:
# load o my_acg.acgo;
to load the data contained in the my_acg.acg file. Assuming you have
defined the signature Sig and the lexicon Lex, you can then run the
following commands:
# Sig check lambda x.some_cst x: NP ->S;
to check whether "lambda x.cst x" is a term of type "NP ->S" according
to Sig.
You can type:
# Lex realize lambda x.cst x: NP ->S;
to compute the image of "lambda x.cst x" is a term of type "NP ->S" by
Lex (assuming this term and this type are correct according to the
abstract signature of Lex).
You can type:
# Lex parse John+loves+Mary: S;
to check whether the term "John+loves+Mary" has an antecend of type
"S" by Lex, assuming that "John+loves+Mary" is a term of type "Lex
(S)" in the object signature of Lex.
Type CTRL-D to exit from the program.
********************
** ACG emacs mode **
********************
......@@ -152,6 +198,9 @@ lexicon my_lex_name(abstract_sig_name) : object_sig_name =
lex_entries
end
or by lexicon composition as in:
lexicon my_new_lex = lex_2 << lex_1
Lex_entries always ends with a ; and have the following form:
abstract_atomic_type1, abstract_atomic_type2 := object_type;
abstract_const1, abstract_const2 := object_term;
; -*-org-*-
* Général
** Avant Prochaine release
+ [ ] merge avec trunk
+ [ ] remplacer tous les gforge.loria en gforge.inria
+ [ ] réfléchir si changement de construction des numéros de version
+ [ ] renommer s_datalog et datalog en datalog.prover et datalog.solver
+ [X] modifier la documentation
** TODO Faire un Bolt package
** DONE Utiliser Bolt (http://bolt.x9c.fr/)
+ [X] Intégrer dans le configure.ac la dépendance à Bolt
+ [X] Laisser la possibilité que la librairie ne soit pas installée *Impossible*
+ [X] Gérer la présence d'un fichier bolt_config (bolt.config) (DONE:
bug fix in BOLT)
** DONE Configuration
+ [X] Utiliser les outils de Paul
** Permettre l'utilisation des PersistentArray
** TODO Vérifier (et supprimer ou mettre en IFDEBUG) les assert
** TODO Avant merge et prochaine release :
+ [X] mettre la commande "analyse" en deprecated
+ [X] la remplacer par
+ [X] une commande "check"
+ [X] une commande "realise"
+ [X] mettre une commande "idb"
+ [X] mettre une commande "query"
+ [ ] vérifier que tous les "help cmd" fonctionnent
** lexer and parser
+ [ ] change the compilation order and the token emission
* datalog.ml
+ [ ] Vérifier pourquoi "pred_table" est paramètre de Rule.to_abstract
et aussi de Datalog_AbstractSyntax.Rule.to_string
+ [ ] Vérifier pourquoi content est passé en paramètre dans les
to_abstract alors que c'est un champ du record rule
+ [ ] Idem pour Rule.extract_consequence
+ [ ] Réfléchir à la possibilité de faire de l'unification directement
entre contents. Ça réduirait par exemple les itérations dans
"extract_consequence"
+ [X] Autoriser l'instanciation avec des variables encore présentes
+ [X] Implanter la réponse à une requête.
+ [ ] Ajouter dans le programme l'enregistrement de toutes les
constantes et les parcourir pour ajouter aux faits ceux qui ont
encore des variables.
+ [ ] Ajouter la possibilité d'étendre un programme datalog
+ [ ] changer le champ idb de prog en Set plutôt que list
+ [ ] changer edb et idb en Set plutôt que list
+ [ ] build_forest sans query n'est pas correct (il faut faire
plusieurs forêts)
* alterTrees.ml
+ [ ] changer la focused list des forêts en simple liste ?
+ [ ] garder trace de Link_to plutôt que de l'actual forest dans les move
+ [X] gérer les analyses infinies (ordre sur les chemins)
* unionFind.ml
+ [ ] Changer le rank dans "union" lorsque match de Value contre
Link_to
* lambda.ml
+ [ ] Vérifier les passages de paramètres dans les
unfold_{labs|abs|binder} pour l'affichage, et simplifier
* typeInference.ml
+ [ ] change or add inference (possibly with a signature) to principal
typing
+ [ ] remove the level parameter (and any other useless parameter)
from the inference_aux function (when no LOG occur)
* acg_lexicon.ml
+ [X] rebuild the datalog program after composition
+ [ ] add the int id (as in Lambda.Const i) in the map from the
constant name for abstract constants
+ [X] Définir le parsing de la composition de lexique
+ [ ] Définir le parsing pour les types non atomiques
+ [ ] Définir le parsing pour les almost linear terms
* Divers
+ [X] ajouter la commande compose dans les fichiers de définition de
lexiques et signature
+ [ ] ajouter un espace de nommage pour les lexiques et signatures
+ [X] faire des dumps des interfaces et des représentations binaires
pour charger plus vite
+ [ ] Ajouter un -nooout option pour acgc ?
logger "" {
level = trace;
filter = all;
layout = default;
mode = direct;
output = file;
name = "acg.log";
}
################################################################################
# AC_LIB_CHECKING
# permet le test de la présence d'une librairie Ocaml dans le repertoire
# standard d'installation des librairies (ocamlc -where), dans un repertoire
# dédié (+...), ou installée avec ocamlfind
# @param $1 : le nom a afficher de la librairie
# @param $2 : le repertoire standard de la librairie (par ex : zen pour -I +zen)
# @param $3 : le nom du fichier contenant la librairie
# @param $4 : le nom de la librairie pour ocamlfind
# @param $5 : le nom du package opam (s'il existe)
# @param $6 : le module a tester pour vérifier la présence de la librairie
# @param $7 : les options de "compilation" pour la verification de la présence de la lib
# @param $8 : true si la librairie est obligatoire, false si elle est optionnelle
# @param $9 : nom de la variable si un chemin non standard est spécifié
AC_DEFUN([AC_LIB_CHECKING],
MACRO="A"
MACRO=$MACRO"C_LIB_CHECKING"
NAME=$1
STD_FOLDER=$2
LIB_FILE=$3
OFIND_NAME=$4
OPAM_PACKAGE=$5
MOD=$6
OPTIONS=$7
NO_OPTIONAL=$8
LIB_PATH=$9
# test au cas ou un argument obligatoire est manquant
if test "$NAME" = "" || test "$STD_FOLDER" = "" || test "$OFIND_NAME" = "" || test "$LIB_FILE" = "" || test "$MOD" = "" ; then
echo ""
echo "Can't check a library"
echo "Missing argument in $MACRO($NAME,$STD_FOLDER,$OFIND_NAME,$LIB_FILE,$MOD,$OPTIONS,$NO_OPTIONAL)"
echo ""
exit 1
fi
# affichage du nom de la librairie a checker (avec details sur l'optionalité)
if test "$NO_OPTIONAL" = true; then
AC_MSG_CHECKING([for requested library : $NAME])
else
AC_MSG_CHECKING([for optional library : $NAME])
fi
# si le fichier ml de test existe
if test -f c_check_$STD_FOLDER.ml ; then
# si on peut le supprimer
if test -w c_check_$STD_FOLDER.ml ; then
# on le supprimer
rm c_check_$STD_FOLDER.ml >& /dev/null
# sinon on arrete et on balance un message d'erreur (ie on a pas les droits sur le fichier
else
AC_MSG_FAILURE(Cannot remove c_check_$2.ml. Please change its right with chmod 666 c_check_$2.ml)
fi
fi
# on prepare le fichier ml de test
echo "open $MOD;;" > c_check_$STD_FOLDER.ml
# définition de la variable disant si on a trouvé la librairie ou pas
FOUND_LIB="no"
if test -n "$LIB_PATH" ; then
LIB_INCLUDE="-I $LIB_PATH"
# on teste maintenant si on peut exectuer le fichier ml de test
if ($OCAMLC -c $OPTIONS $LIB_INCLUDE $LIB_FILE.cma c_check_$STD_FOLDER.ml >& /dev/null) ; then
# on y arrive, on dit qu'on a trouvé la lib avec la variable d'environnement
FOUND_LIB=yes
AC_MSG_RESULT(Found with the environment variable => $LIB_INCLUDE)
fi
fi
if test "$FOUND_LIB" = "no" ; then
# si on arrive à l'executer avec la librairie dans le rep de lib de caml
if ($OCAMLC -c $OPTIONS c_check_$STD_FOLDER.ml >& /dev/null) ; then
# pas besoin d'include
LIB_INCLUDE=""
LIB_DIR=`$OCAMLC -where`
FOUND_LIB=yes
AC_MSG_RESULT(Found in ocaml lib directory)
fi
fi
# sinon on essaie avec un repertoire dedié à la lib (-I +xxx yyy.cma)
if test "$FOUND_LIB" = "no" ; then
if ($OCAMLC -c $OPTIONS -I +$STD_FOLDER $LIB_FILE.cma c_check_$STD_FOLDER.ml >& /dev/null) ; then
# si ca marche, on s'arrete et on precise le include
LIB_INCLUDE="-I +$STD_FOLDER"
LIB_DIR=`$OCAMLC -where`
LIB_DIR="$LIB_DIR/$STD_FOLDER"
FOUND_LIB=yes
AC_MSG_RESULT(Found in $STD_FOLDER directory => $LIB_INCLUDE)
fi
fi
# sinon, on essaie avec ocamlfind
if test "$FOUND_LIB" = "no" ; then
# si on n'a pas ocamlfind , on s'arrete (dans le cas d'une lib oblig.) ou
# on lance un warning (dans le cas d'une lib optionelle)
if test "$OCAMLFIND" != "no" ; then
echo testing with $OCAMLFIND
# on regarde déjà si la lib est installée avec ocamlfind
if $OCAMLFIND query $OFIND_NAME > /dev/null 2>&1 ; then
# si c'est le cas, on recupere le repertoire d'installation et le include correspondant
LIB_INCLUDE=`$OCAMLFIND query $OFIND_NAME`
LIB_INCLUDE="-I $LIB_INCLUDE"
# on teste maintenant si on peut exectuer le fichier ml de test
if ($OCAMLC -c $OPTIONS $LIB_INCLUDE $LIB_FILE.cma c_check_$STD_FOLDER.ml >& /dev/null) ; then
# on y arrive, on dit qu'on a trouvé la lib avec ocamlfind
FOUND_LIB=yes
LIB_DIR=`$OCAMLFIND query $OFIND_NAME`
AC_MSG_RESULT(Found with $OCAMLFIND => $LIB_INCLUDE)
fi
fi
fi
fi
if test "$FOUND_LIB" = "no" ; then
# si opam est installé, on essaye dans la lib de opam
if test "$OPAM$" != "no" ; then
if test "$OPAM config var $OPAM_PACKAGE:installed" = "true" ; then
OPAM_OCAML_VERSION=`opam config var ocaml-version`
OCAML_VERSION=`$OCAMLC -version`
if test "$OPAM_OCAML_VERSION" = "$OCAML_VERSION" ; then
LIB_INCLUDE=`$OPAM config var lib`
LIB_INCLUDE="-I $LIB_INCLUDE/$STD_FOLDER"
# on teste maintenant si on peut exectuer le fichier ml de test
if ($OCAMLC -c $OPTIONS $LIB_INCLUDE $LIB_FILE.cma c_check_$STD_FOLDER.ml >& /dev/null) ; then
# on y arrive, on dit qu'on a trouvé la lib avec opam
FOUND_LIB=yes
LIB_DIR=`$OPAM config var lib`
LIB_DIR="$LIB_DIR/$STD_FOLDER"
AC_MSG_RESULT(Found with $OPAM => $LIB_INCLUDE)
fi
else
AC_MSG_RESULT(There is an opam installation of the library, but the current $OPAM switch does not correspond to the $OCAMLC compiler)
fi
fi
fi
fi
if test "$FOUND_LIB" = "no" ; then
# suivant l'optionalité de la lib: un warning ou une erreur
if test "$NO_OPTIONAL" = "true"; then
AC_MSG_ERROR(The $NAME library is missing.)
LIB_INCLUDE="no"
else
AC_MSG_RESULT(The $NAME library is missing.)
LIB_INCLUDE="no"
fi
fi
# suppression du fichier ml de test
rm c_check_$STD_FOLDER.ml >& /dev/null
rm c_check_$STD_FOLDER.cmo >& /dev/null
rm c_check_$STD_FOLDER.cmi >& /dev/null
)
################################################################################
......@@ -20,6 +20,7 @@
AC_INIT([ACG DTK],[0.1],[sylvain.pogodalla@loria.fr])
#AC_COPYRIGHT([Cecill])
m4_include(ac_lib_checking.m4)
OCAML_REQUIRED=3.07
......@@ -62,23 +63,32 @@ if test "$OCAMLDEP" = no ; then
AC_MSG_ERROR(Cannot find ocamldep.)
fi
# Look for camllex
# Look for ocamllex
AC_CHECK_PROGS(OCAMLLEX,ocamllex.opt ocamllex,no)
if test "$OCAMLLEX" = no ; then
AC_MSG_ERROR(Cannot find ocamllex)
fi
# Look for ocamlyacc
AC_CHECK_PROGS(OCAMLYACC,ocamlyacc.opt ocamlyacc,no)
if test "$OCAMLYACC" = no ; then
AC_MSG_ERROR(Cannot find ocamlyac)
fi
# Look for ocamlfind
AC_PATH_PROG(OCAMLFIND,ocamlfind,no)
# Look for opam
AC_PATH_PROG(OPAM,opam,no)
#Look for dypgen
DYPGEN_NEEDED=20080925
AC_ARG_VAR(DYPGEN_PATH,[Directory where to find dypgen if not in a standard location])
if test -n "$DYPGEN_PATH" ; then
AC_CHECK_PROG(DYPGEN,dypgen,$DYPGEN_PATH/dypgen,no,$DYPGEN_PATH)
else
AC_CHECK_PROGS(DYPGEN,dypgen.opt dypgen,no)
AC_CHECK_PROGS(DYPGEN,dypgen.opt dypgen,no)
fi
if test "$DYPGEN" = no ; then
AC_MSG_ERROR(Cannot find dypgen)
......@@ -87,85 +97,67 @@ else
AC_MSG_CHECKING([for $DYPGEN version])
if test $DYPGEN_VERSION -ge $DYPGEN_NEEDED ; then
AC_MSG_RESULT($DYPGEN ($DYPGEN_VERSION) is ok)
AC_SUBST(DYPGEN)
else
AC_MSG_ERROR($DYPGEN version $DYPGEN_VERSION found ; version $DYPGEN_NEEDED or greater is needed)
fi
fi
# Look for DYPGEN_LIB with or without ocamlfind
AC_MSG_CHECKING([dypgen library])
AC_ARG_VAR(DYPGENLIB_PATH,[Directory where to find dypgen library if not in a standard location])
if test -n "$DYPGENLIB_PATH" ; then
DYPGEN_PLACE=$DYPGENLIB_PATH
DYPGEN_INCLUDE="-I $DYPGEN_PLACE"
if test -f $DYPGEN_PLACE/dyp.cma ; then
AC_MSG_RESULT(dypgen library is $DYPGEN_PLACE/dyp.cma)
else
AC_MSG_ERROR(Could not find dypgen library in $DYPGEN_PLACE)
AC_ARG_VAR(DYPGENLIB_PATH,[Directory where to find the dypgen library if not in a standard location])
AC_LIB_CHECKING(dypgen,dyp,dyp,dyp,dypgen,Dyp,,true,$DYPGENLIB_PATH)
if test "$FOUND_LIB" != "no" ; then
AC_SUBST(DYPGEN_INCLUDE,$LIB_INCLUDE)
fi
AC_ARG_ENABLE(
[kaputt],
[AS_HELP_STRING([--enable-kaputt], [Compile with kaputt for unit testing])],
[with_kaputt=$enableval],
[with_kaputt=no])
if test "$with_kaputt" != no ; then
# Look for KAPUTT_LIB
AC_LIB_CHECKING(kaputt,kaputt,kaputt,kaputt,kaputt,Kaputt,,false,,)
if test "$FOUND_LIB" != "no" ; then
if test -f $LIB_DIR/kaputt_pp.byte ; then
KAPUTT_PP="$LIB_DIR/kaputt_pp.byte"
AC_MSG_RESULT(kaputt_pp.byte preprocessor is $KAPUTT_PP)
AC_SUBST(KAPUTT_INCLUDE,$LIB_INCLUDE)
AC_SUBST(KAPUTT_LIB,$LIB_FILE.cma)
AC_SUBST(KAPUTT_PP)
else
AC_MSG_ERROR(Could not find kaputt_pp.byte preprocessor in $LIB_DIR.)
fi
fi
else
if test "$OCAMLFIND" != no ; then
if $OCAMLFIND query dypgen > /dev/null 2>&1 ; then
DYPGEN_INCLUDE_DIR=`$OCAMLFIND query dypgen`
DYPGEN_PLACE=$DYPGEN_INCLUDE_DIR
DYPGEN_INCLUDE="-I $DYPGEN_INCLUDE_DIR"
else
if $OCAMLFIND query dyp > /dev/null 2>&1 ; then
DYPGEN_INCLUDE_DIR=`$OCAMLFIND query dyp`
DYPGEN_PLACE=$DYPGEN_INCLUDE_DIR
DYPGEN_INCLUDE="-I $DYPGEN_INCLUDE_DIR"
else
AC_MSG_RESULT(dypgen library was not installed by ocamlfind)
fi
fi
else
OCAML_LIB=`$OCAMLC -where`
# Old versions of dypgen where put in a dypgen directory
if test -d $OCAML_LIB/dypgen ; then
DYPGEN_PLACE=$OCAML_LIB/dypgen
DYPGEN_INCLUDE="-I +dypgen"
else
# New versions of dypgen where put in a dyp directory
if test -d $OCAML_LIB/dyp ; then
DYPGEN_PLACE=$OCAML_LIB/dyp
DYPGEN_INCLUDE="-I +dyp"
else
AC_MSG_ERROR(Could not find a suitable place for dypgen library in $OCAML_LIB)
fi
fi
fi
fi
if test -f $DYPGEN_PLACE/dyp.cma ; then
AC_MSG_RESULT(dypgen library is $DYPGEN_PLACE/dyp.cma)
else
AC_MSG_ERROR(Could not find dypgen library "dyp.cma" in $DYPGEN_PLACE)
fi
# Look for KAPUTT_LIB with ocamlfind
AC_MSG_CHECKING([(optional) kaputt library])
if test "$OCAMLFIND" != no ; then
if $OCAMLFIND query kaputt > /dev/null 2>&1 ; then
KAPUTT_INCLUDE_DIR=`$OCAMLFIND query kaputt`
KAPUTT_PLACE=$KAPUTT_INCLUDE_DIR
KAPUTT_INCLUDE="-I $KAPUTT_INCLUDE_DIR"
# Look for BOLT_LIB with ocamlfind
AC_ARG_VAR(BOLTLIB_PATH,[Directory where to find the bolt library if not in a standard location])
AC_LIB_CHECKING(bolt,bolt,bolt,bolt,bolt,Bolt,"unix.cma dynlink.cma",true,$BOLTLIB_PATH)
if test "$FOUND_LIB" != "no" ; then
if test -f $LIB_DIR/bolt_pp.cmo ; then
BOLT_PP="$LIB_DIR/bolt_pp.cmo -level \$(BOLT_LEVEL)"
AC_MSG_RESULT(bolt_pp.byte preprocessor is $BOLT_PP)
AC_SUBST(BOLT_INCLUDE,$LIB_INCLUDE)
AC_SUBST(BOLT_LIB,$LIB_FILE.cma)
AC_SUBST(BOLT_PP)
else
AC_MSG_RESULT(kaputt library was not installed by ocamlfind)
AC_MSG_ERROR(Could not find bolt_pp.byte preprocessor in $LIB_DIR.)
fi
else
OCAML_LIB=`$OCAMLC -where`
if test -d $OCAML_LIB/kaputt ; then
KAPUTT_PLACE=$OCAML_LIB/kaputt
KAPUTT_INCLUDE="-I +kaputt"
else
AC_MSG_RESULT(Could not find a suitable place for kaputt library in $OCAML_LIB. No link to the kaputt library will be allowed in compilation)
fi
fi
if test -f $KAPUTT_PLACE/kaputt.cma ; then
AC_MSG_RESULT(kaputt library is $KAPUTT_PLACE/kaputt.cma)
else
AC_MSG_RESULT(Could not find kaputt library "kaputt.cma" in $KAPUTT_PLACE. No link to the kaputt library will be allowed in compilation)
fi
AC_ARG_ENABLE(
[log],
[AS_HELP_STRING([--enable-log], [Enable log information to be produced by bolt])],
[with_log=$enableval],
[with_log=no])
if test "$with_log" = "no" ; then
AC_SUBST(BOLT_LEVEL,NONE)
else
AC_SUBST(BOLT_LEVEL,TRACE)
fi
AC_MSG_RESULT(Bolt log level is $BOLT_LEVEL.)
# What is the OCAML version ?
......@@ -226,10 +218,10 @@ AC_SUBST(OCAMLDOC)
AC_SUBST(OCAMLDEP)
AC_SUBST(OCAMLLEX)
#AC_SUBST(OCAMLYACC)
AC_SUBST(DYPGEN)
AC_SUBST(DYPGEN_INCLUDE)
AC_SUBST(KAPUTT_INCLUDE)
AC_SUBST(OCAMLYACC)
AC_SUBST(TYPES)
AC_SUBST(OCAML09WARNINGS)
......@@ -237,7 +229,7 @@ AC_SUBST(OCAMLP4_LOC)
AC_SUBST(SET_MAKE)
AC_CONFIG_FILES([./Makefile config/Makefile src/Makefile.master src/Makefile.common src/Makefile src/utils/Makefile src/logic/Makefile src/grammars/Makefile src/acg-data/Makefile src/scripting/Makefile src/datalog/Makefile src/reduction/Makefile])
AC_CONFIG_FILES([./Makefile config/Makefile src/Makefile.master src/Makefile.common src/Makefile src/utils/Makefile src/logic/Makefile src/grammars/Makefile src/acg-data/Makefile src/scripting/Makefile src/datalog/Makefile src/reduction/Makefile src/s_datalog/Makefile])
AC_PROG_MAKE_SET
......
This diff is collapsed.
......@@ -31,7 +31,8 @@
"end"
"type"
"signature"
"lexicon")
"lexicon"
"<<")
'(
; FIXME while this regexp correctly capture multi-line comments,
; they they're not highlighted in the emace buffer. Only single
......@@ -48,6 +49,14 @@
("\\(lexicon\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\((\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\()\\)[ \n\t]*\\(:\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\(=\\)" 6 'font-lock-keyword-face)
("\\(lexicon\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\((\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\()\\)[ \n\t]*\\(:\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\(=\\)" 7 'font-lock-constant-face)
("\\(lexicon\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\((\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\()\\)[ \n\t]*\\(:\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\(=\\)" 8 'font-lock-keyword-face)
("\\(lexicon\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\(=\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\(<<\\)" 1 'font-lock-keyword-face)
("\\(lexicon\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\(=\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\(<<\\)" 2 'font-lock-constant-face)
("\\(lexicon\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\(=\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\(<<\\)" 3 'font-lock-keyword-face)
("\\(lexicon\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\(=\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\(<<\\)" 4 'font-lock-constant-face)
("\\(lexicon\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\(=\\)[ \n\t]*\\([a-zA-Z0-9_']*\\)[ \n\t]*\\(<<\\)" 5 'font-lock-keyword-face)
("\\([a-zA-Z0-9_']*\\)[ \t\n]*\\(<<\\)[ \t\n]*\\([a-zA-Z0-9_']*\\)" 1 'font-lock-constant-face)
("\\([a-zA-Z0-9_']*\\)[ \t\n]*\\(<<\\)[ \t\n]*\\([a-zA-Z0-9_']*\\)" 2 'font-lock-keyword-face)
("\\([a-zA-Z0-9_']*\\)[ \t\n]*\\(<<\\)[ \t\n]*\\([a-zA-Z0-9_']*\\)" 3 'font-lock-constant-face)
)
'(".*\\.acg")
nil
......
......@@ -84,19 +84,32 @@ signature derived_trees =
end
(* Then a signature for the strings *)
signature strings =
string: type;
signature complex_strings =
o:type;
string=o->o: type;
(* we can define infix and prefix symbols.
Note that as for now, the length of symbols can only be 1 *)
infix +=lambda a b.lambda z.a(b z) : string -> string -> string;
every,dog,chases,a,cat,sleeps,slowly,new,big,black,seems,john,mary,bill,paul,
claims,loves,to,love,who,said,liked,does,think:string;
end
signature strings =
string: type;
(* we can define infix and prefix symbols. *)
(* Note that as for now, the length of symbols can only be 1 *)
infix + : string -> string -> string;
every,dog,chases,a,cat,sleeps,slowly,new,big,black,seems,john,mary,bill,paul,
claims,loves,to,love,who,said,liked,does,think:string;
end
(* Ok. Now is our first lexicon. It translates derived trees into strings *)
lexicon tag_strings(derived_trees) : strings =
......@@ -236,3 +249,4 @@ lexicon tag_syntax (derivation_trees) : derived_trees =
I_n,I_vp,I_s := lambda x.x;
end
lexicon tag_yields = tag_strings << tag_syntax
\ No newline at end of file
......@@ -40,7 +40,7 @@ CMX = $(ML:.ml=.cmx)
.PHONY : all byte opt clean $(PRELIMINARY) superclean
.PRECIOUS : $(DYP:%.dyp=%.ml %.mli) $(CAMLLEX:%.mll=%.ml)
.PRECIOUS : $(DYP:%.dyp=%.ml %.mli) $(CAMLLEX:%.mll=%.ml) $(CAMLYACC:%.mly=%.ml)
PP = $(OCAMLPP)
......@@ -48,6 +48,7 @@ EXE = $(EXE_SOURCES:%.ml=%)
EXEOPT = $(EXE_SOURCES:%.ml=%.opt)
CAMLLEX_ML=$(CAMLLEX:%.mll=%.ml)
CAMLYACC_ML=$(CAMLYACC:%.mly=%.ml)
DYP_ML=$(DYP:%.dyp=%.ml)
DYP_MLI=$(DYP:%.dyp=%.mli)
......@@ -105,6 +106,9 @@ DYPGEN_EXE = @DYPGEN@ --no-pp --no-obj-type --ocamlc "$(LIBDIR) $(I_PREVIOUS_DIR
%.ml : %.mll
@OCAMLLEX@ $<