Replaced old makefile (we use ocamlbuild now).

Added .merlin (still may needs some work though).
Fixed some warning of deprecated use of 'Pervasives.or'
This commit is contained in:
Guillaume Bury 2014-10-29 12:41:24 +01:00
parent 5ddf970009
commit ed037a4aab
9 changed files with 30 additions and 3365 deletions

2
.gitignore vendored
View file

@ -1,3 +1,4 @@
_build/
*.annot *.annot
*.cma *.cma
*.cmi *.cmi
@ -10,7 +11,6 @@
*.native *.native
*.log *.log
*.status *.status
Makefile
.*.swp .*.swp
TAGS TAGS
.session .session

22
Makefile Normal file
View file

@ -0,0 +1,22 @@
# copyright (c) 2014, guillaume bury
LOG=build.log
COMP=ocamlbuild -log $(LOG)
OCAMLFIND= -use-ocamlfind -tag package\(zarith\)
FLAGS=
DIRS=-Is smt,common
DOC=lib.docdir/index.html
LIB=sat.cma
GENERATED=$(MAIN) $(BIN) gmon.out
all:$(LIB)
$(LIB):
$(COMP) $(FLAGS) $(DIRS) $(LIB)
doc:
$(COMP) $(FLAGS) $(DIRS) $(DOC)
clean:
$(COMP) -clean
rm -f $(GENERATED)

View file

@ -1,184 +0,0 @@
##########################################################################
# #
# Alt-Ergo Zero #
# #
# Sylvain Conchon and Alain Mebsout #
# Universite Paris-Sud 11 #
# #
# Copyright 2011. This file is distributed under the terms of the #
# Apache Software License version 2.0 #
# #
##########################################################################
QUIET=""
# where to install the binaries
DESTDIR=
prefix=@prefix@
exec_prefix=@exec_prefix@
BINDIR=$(DESTDIR)@bindir@
LIBDIR=$(DESTDIR)@libdir@/alt-ergo-zero
# where to install the man page
MANDIR=$(DESTDIR)@mandir@
# other variables set by ./configure
OCAMLC = @OCAMLC@
OCAMLOPT = @OCAMLOPT@
OCAMLDEP = @OCAMLDEP@
OCAMLLEX = @OCAMLLEX@
OCAMLYACC= @OCAMLYACC@
OCAMLLIB = @OCAMLLIB@
OCAMLBEST= @OCAMLBEST@
OCAMLVERSION = @OCAMLVERSION@
OCAMLWIN32 = @OCAMLWIN32@
EXE = @EXE@
LIBEXT = @LIBEXT@
OBJEXT = @OBJEXT@
INCLUDES = -I common/ -I smt/
BFLAGS = -dtypes -g $(INCLUDES) -annot
OFLAGS = -dtypes $(INCLUDES) -annot -for-pack Aez
BIBBYTE=nums.cma unix.cma
BIBOPT=$(BIBBYTE:.cma=.cmxa)
# main target
#############
NAME = aez
CMA = aez.cma
CMXA = aez.cmxa
all: $(OCAMLBEST)
byte: $(CMA)
opt: $(CMA) $(CMXA)
# bytecode and native-code compilation
######################################
SMTCMO = smt/exception.cmo smt/symbols.cmo \
smt/ty.cmo smt/term.cmo smt/literal.cmo \
smt/solver_types.cmo smt/explanation.cmo \
smt/polynome.cmo smt/uf.cmo smt/use.cmo \
smt/intervals.cmo smt/fm.cmo smt/arith.cmo smt/sum.cmo \
smt/combine.cmo smt/cc.cmo smt/solver.cmo smt/smt.cmo
COMMONCMO = common/timer.cmo common/hashcons.cmo common/hstring.cmo\
common/vec.cmo common/heap.cmo common/iheap.cmo
CMO = $(COMMONCMO) $(SMTCMO)
CMX = $(CMO:.cmo=.cmx)
$(CMA): aez.cmo
$(OCAMLC) -a $(BFLAGS) -o $@ $^
$(CMXA): aez.cmx
$(OCAMLOPT) -a $(OFLAGS) $(INCLUDES) -o $@ $^
aez.cmo: smt/smt.cmi
aez.cmo: $(CMO)
$(OCAMLC) $(BFLAGS) -pack -o $@ $(CMO)
aez.cmx: smt/smt.cmi
aez.cmx: $(CMX)
$(OCAMLOPT) $(INCLUDES) -pack -o $@ $(CMX)
# generic rules
###############
.SUFFIXES: .mli .ml .cmi .cmo .cmx .mll .mly
.mli.cmi:
@true compile -w a $(BFLAGS) $<
$(if $(QUIET),@echo 'Compiling $@' &&) $(OCAMLC) -c $(BFLAGS) $<
.ml.cmo:
$(if $(QUIET),@echo 'Compiling $@' &&) $(OCAMLC) -c $(BFLAGS) $<
@true compile -w a $(BFLAGS) $<
.ml.o:
@true compile -w a $(BFLAGS) $<
$(if $(QUIET),@echo 'Compiling $@' &&) $(OCAMLOPT) -c $(OFLAGS) $<
.ml.cmx:
$(if $(QUIET),@echo 'Compiling $@' &&) $(OCAMLOPT) -c $(OFLAGS) $<
@true compile -w a $(BFLAGS) $<
.mll.ml:
$(if $(QUIET),@echo 'Compiling $<' &&) $(OCAMLLEX) $< > /dev/null
.mly.ml:
$(if $(QUIET),@echo 'Compiling $<' &&) $(OCAMLYACC) -v $<
.mly.mli:
$(if $(QUIET),@echo 'Compiling $<' &&) $(OCAMLYACC) -v $<
# Emacs tags
############
tags:
find . -name "*.ml*" | sort -r | xargs \
etags "--regex=/let[ \t]+\([^ \t]+\)/\1/" \
"--regex=/let[ \t]+rec[ \t]+\([^ \t]+\)/\1/" \
"--regex=/and[ \t]+\([^ \t]+\)/\1/" \
"--regex=/type[ \t]+\([^ \t]+\)/\1/" \
"--regex=/exception[ \t]+\([^ \t]+\)/\1/" \
"--regex=/val[ \t]+\([^ \t]+\)/\1/" \
"--regex=/module[ \t]+\([^ \t]+\)/\1/"
# installation
##############
INSTALL_LIBDIR=$(DESTDIR)$(OCAMLLIB)/alt-ergo-zero
install: install-$(OCAMLBEST)
install-byte:
mkdir -p $(INSTALL_LIBDIR)
cp -f aez.cm[iot] $(CMA) $(INSTALL_LIBDIR)
install-opt:
mkdir -p $(INSTALL_LIBDIR)
cp -f aez.cm[iot] $(CMA) $(INSTALL_LIBDIR)
cp -f aez$(LIBEXT) aez.cmx $(CMXA) $(INSTALL_LIBDIR)
ocamlfind-install: all
ocamlfind install aez META $(BUILD)aez.cmi $(CMA) $(CMXA) $(BUILD)aez.a
ocamlfind-remove:
ocamlfind remove aez
doc: smt/smt.mli
mkdir -p $(doc)
ocamldoc -html -d doc/ -I smt -I common smt/smt.mli
#######
test:
ocamlfind ocamlopt -package num,unix -linkpkg aez.cmxa tests/eval.ml -o tests/eval.native
clean::
@rm -f *.cm[itox] *.cmti *.o *~ *.annot
@rm -f common/*.cm[itox] common/*.cmti common/*.o common/*~ common/*.annot
@rm -f smt/*.cm[itox] smt/*.cmti smt/*.o smt/*~ smt/*.annot
@rm -f tests/*.cm[itox] tests/*.cmti tests/*.o tests/*~ tests/*.annot
@rm -f $(GENERATED) *.output
@rm -f $(NAME).byte $(NAME).opt
# depend
########
.depend depend:: $(GENERATED)
@rm -f .depend
@$(OCAMLDEP) -slash -I common/ common/*.ml common/*.mli > .depend
@$(OCAMLDEP) -I common/ -I smt/ smt/*.ml smt/*.mli >> .depend
@$(OCAMLDEP) -I common/ -I smt/ -slash *.ml *.mli >> .depend
include .depend

3097
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -1,81 +0,0 @@
##########################################################################
# #
# Cubicle #
# Combining model checking algorithms and SMT solvers #
# #
# Sylvain Conchon and Alain Mebsout #
# Universite Paris-Sud 11 #
# #
# Copyright 2011. This file is distributed under the terms of the #
# Apache Software License version 2.0 #
# #
##########################################################################
AC_INIT(smt/smt.mli)
AC_CHECK_PROGS(OCAMLC,ocp-ocamlc.opt ocamlc.opt,no)
if test "$OCAMLC" = no ; then
AC_MSG_ERROR(Cannot find ocamlc.)
fi
OCAMLVERSION=`$OCAMLC -version`
echo "ocaml version is $OCAMLVERSION"
OCAMLLIB=`$OCAMLC -where`
echo "ocaml library path is $OCAMLLIB"
AC_CHECK_PROGS(OCAMLOPT,ocp-ocamlopt.opt ocamlopt.opt,no)
OCAMLBEST=byte
if test "$OCAMLOPT" = no ; then
AC_MSG_WARN(Cannot find ocamlopt; bytecode compilation only.)
else
OCAMLBEST=opt
fi
AC_CHECK_PROG(OCAMLDEP,ocamldep,ocamldep,no)
if test "$OCAMLDEP" = no ; then
AC_MSG_ERROR(Cannot find ocamldep.)
fi
AC_CHECK_PROG(OCAMLLEX,ocamllex,ocamllex,no)
if test "$OCAMLLEX" = no ; then
AC_MSG_ERROR(Cannot find ocamllex.)
fi
AC_CHECK_PROG(OCAMLYACC,ocamlyacc,ocamlyacc,no)
if test "$OCAMLYACC" = no ; then
AC_MSG_ERROR(Cannot find ocamlyacc.)
fi
AC_MSG_CHECKING(platform)
if echo "let _ = Sys.os_type" | ocaml | grep -q Win32; then
echo "Windows platform"
AC_MSG_RESULT(Win32)
OCAMLWIN32=yes
EXE=.exe
LIBEXT=.lib
OBJEXT=.obj
else
echo "Unix platform"
OCAMLWIN32=no
EXE=
LIBEXT=.a
OBJEXT=.o
fi
AC_SUBST(OCAMLC)
AC_SUBST(OCAMLOPT)
AC_SUBST(OCAMLDEP)
AC_SUBST(OCAMLLEX)
AC_SUBST(OCAMLYACC)
AC_SUBST(OCAMLBEST)
AC_SUBST(OCAMLVERSION)
AC_SUBST(OCAMLLIB)
AC_SUBST(ALTERGOLIB)
AC_SUBST(FUNCTORYLIB)
AC_SUBST(OCAMLWIN32)
AC_SUBST(EXE)
AC_SUBST(LIBEXT)
AC_SUBST(OBJEXT)
AC_OUTPUT(Makefile)
chmod a-w Makefile

1
sat.mlpack Normal file
View file

@ -0,0 +1 @@
Smt

4
smt/.merlin Normal file
View file

@ -0,0 +1,4 @@
S ./
S ../common/
B ../_build/

View file

@ -260,7 +260,7 @@ module Make
let find_one_eq x u = let find_one_eq x u =
match Intervals.is_point u with match Intervals.is_point u with
| Some (v, ex) when X.type_info x <> Ty.Tint or is_integer_num v -> | Some (v, ex) when X.type_info x <> Ty.Tint || is_integer_num v ->
let eq = let eq =
L.Eq (x,(P.alien_of (P.create [] v (X.type_info x)))) in L.Eq (x,(P.alien_of (P.create [] v (X.type_info x)))) in
Some (eq, None, ex) Some (eq, None, ex)

View file

@ -539,7 +539,7 @@ let power n u =
let num_of_float x = let num_of_float x =
if x = infinity or x = neg_infinity then raise Not_a_float; if x = infinity || x = neg_infinity then raise Not_a_float;
let (f, n) = frexp x in let (f, n) = frexp x in
let z = let z =
Big_int.big_int_of_string Big_int.big_int_of_string