Commit bd9c508e authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Code re-organisation to abstract Lucky concrete concepts from the

rest of the modules. More precisely, the lucky tools now rely only on
Prog (see below), that is Lucky-agnostic.

The rationale is to ease the plug of a Lutin programs interpreter
afterwards. Indeed, one (ougth to) just need to implement its own
version of the Prog module.

To do that, I've splitted LusProg into :
   LucParse
   LucProg
   Prog

Then, I moved the content of Env_state into LucProg. And all this
had some consequences, that cause more code movement.
parent 5393e777
......@@ -26,7 +26,7 @@ clean:
.PHONY: test
test:
cd example ; make test
cd examples && make test
cia: test cia_notest
......
......@@ -629,6 +629,9 @@ stubs_assert:
make -k nc -f Makefile.gen_stubs OCAMLFLAGS=""
cp gen_stubs_exe gen_stubs_assert
stubs_clean:
make -f Makefile.gen_stubs clean
##############################################################################"
gen_lut:
make -k nc -f Makefile.gen_fake_lutin OCAMLFLAGS="-noassert -unsafe"
......
......@@ -2,45 +2,110 @@
-include ../Makefile.common.source
OCAMLNCFLAGS = -inline 10
ifndef OCAMLFLAGS
OCAMLFLAGS := -noassert -unsafe
OCAMLFLAGS := -noassert -unsafe
endif
OCAMLFLAGS += -I $(OCAMLLIB) -I $(PREFIX)/$(HOSTTYPE)/lib
IDLFLAGS=-nocpp
POLKA=polkag
ifdef STATIC
OCAMLLDFLAGS = -cclib -ldl -cclib -lm -cclib -lc -ccopt -static
OCAMLLDFLAGS = -cclib -lstdc++ -cclib -lm -cclib -lc -ccopt -static\
-cclib -l$(POLKA)_caml -cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
else
OCAMLLDFLAGS= -cc g++ -cclib -lstdc++ -cclib -I/usr/lib/w32api \
-cclib -l$(POLKA)_caml \
-cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
endif
CC=gcc $(DWIN32)
LIBS = str unix nums polka bdd
CLIBS = camlidl $(CLIBS_WIN32) bdd_stubs
USE_CAMLP4 = yes
HERE=$(LURETTE_PATH)/source/
HERE=./
SOURCES = \
SOURCES_C = \
$(HERE)/liblutin_c.c \
$(HERE)/liblutin.idl \
$(HERE)/Ezdl_c.c \
SOURCES_OCAML = \
$(HERE)/Ezdl.ml \
$(HERE)/Ezdl.mli \
$(HERE)/error.ml \
$(HERE)/version.ml \
$(HERE)/util.ml \
$(HERE)/util.ml \
$(HERE)/util2.ml \
$(HERE)/graphUtil.ml \
$(HERE)/graphUtil.mli \
$(HERE)/genlex.mli \
$(HERE)/genlex.ml \
$(HERE)/sol_nb.mli \
$(HERE)/sol_nb.ml \
$(HERE)/type.mli \
$(HERE)/type.ml \
$(HERE)/thickness.ml \
$(HERE)/genlex.mli \
$(HERE)/genlex.ml \
$(HERE)/lexeme.mli \
$(HERE)/lexeme.ml \
$(HERE)/graph.mli \
$(HERE)/graph.ml \
$(HERE)/poly_draw.mli \
$(HERE)/poly_draw.ml \
$(HERE)/prevar.mli \
$(HERE)/prevar.ml \
$(HERE)/value.mli \
$(HERE)/value.ml \
$(HERE)/var.mli \
$(HERE)/var.ml \
$(HERE)/ne.mli \
$(HERE)/ne.ml \
$(HERE)/exp.mli \
$(HERE)/exp.ml \
$(HERE)/constraint.mli \
$(HERE)/constraint.ml \
$(HERE)/lustreExp.mli \
$(HERE)/lustreExp.ml \
$(HERE)/parser.mly \
$(HERE)/lexer.mll \
$(HERE)/lucProg.mli \
$(HERE)/gne.mli \
$(HERE)/gne.ml \
$(HERE)/lucParse.mli \
$(HERE)/lucParse.ml \
$(HERE)/lucParse.mli \
$(HERE)/lucProg.mli \
$(HERE)/lucProg.ml \
$(HERE)/polyhedron.mli \
$(HERE)/polyhedron.ml \
$(HERE)/formula_to_bdd.mli \
$(HERE)/formula_to_bdd.ml \
$(HERE)/store.mli \
$(HERE)/store.ml \
$(HERE)/draw.mli \
$(HERE)/draw.ml \
$(HERE)/bddd.mli \
$(HERE)/bddd.ml \
$(HERE)/fair_bddd.mli \
$(HERE)/fair_bddd.ml \
$(HERE)/solver.mli \
$(HERE)/solver.ml \
$(HERE)/show_env.mli \
$(HERE)/show_env.ml \
$(HERE)/prog.mli \
$(HERE)/prog.ml \
\
$(HERE)/gen_stubs_common.mli \
$(HERE)/gen_stubs_common.ml \
$(HERE)/parse_c_scade.mli \
......@@ -52,7 +117,11 @@ SOURCES = \
$(HERE)/gen_fake_lucky.ml
RESULT = gen_fake_lucky
LIBS = str unix
ifdef MLONLY
SOURCES_OCAML =$(filter %.ml, $(SOURCES_OCAML))
endif
SOURCES = $(SOURCES_C) $(SOURCES_OCAML)
-include $(OCAMLMAKEFILE)
......
......@@ -2,46 +2,111 @@
-include ../Makefile.common.source
OCAMLNCFLAGS = -inline 10
ifndef OCAMLFLAGS
OCAMLFLAGS := -noassert -unsafe
endif
OCAMLFLAGS += -I $(OCAMLLIB) -I $(PREFIX)/$(HOSTTYPE)/lib
IDLFLAGS=-nocpp
POLKA=polkag
ifdef STATIC
OCAMLLDFLAGS = -cclib -ldl -cclib -lm -cclib -lc -ccopt -static
OCAMLLDFLAGS = -cclib -lstdc++ -cclib -lm -cclib -lc -ccopt -static\
-cclib -l$(POLKA)_caml -cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
else
OCAMLLDFLAGS= -cc g++ -cclib -lstdc++ -cclib -I/usr/lib/w32api \
-cclib -l$(POLKA)_caml \
-cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
endif
CC=gcc $(DWIN32)
LIBS = str unix nums polka bdd
CLIBS = camlidl $(CLIBS_WIN32) bdd_stubs
USE_CAMLP4 = yes
HERE=$(LURETTE_PATH)/source/
HERE=./
SOURCES = \
SOURCES_C = \
$(HERE)/liblutin_c.c \
$(HERE)/liblutin.idl \
$(HERE)/Ezdl_c.c \
SOURCES_OCAML = \
$(HERE)/Ezdl.ml \
$(HERE)/Ezdl.mli \
$(HERE)/error.ml \
$(HERE)/version.ml \
$(HERE)/util.ml \
$(HERE)/util2.ml \
$(HERE)/util.ml \
$(HERE)/util2.ml \
$(HERE)/graphUtil.ml \
$(HERE)/graphUtil.mli \
\
$(HERE)/genlex.mli \
$(HERE)/genlex.ml \
\
$(HERE)/sol_nb.mli \
$(HERE)/sol_nb.ml \
$(HERE)/type.mli \
$(HERE)/type.ml \
\
$(HERE)/thickness.ml \
$(HERE)/genlex.mli \
$(HERE)/genlex.ml \
$(HERE)/lexeme.mli \
$(HERE)/lexeme.ml \
$(HERE)/graph.mli \
$(HERE)/graph.ml \
$(HERE)/poly_draw.mli \
$(HERE)/poly_draw.ml \
$(HERE)/prevar.mli \
$(HERE)/prevar.ml \
$(HERE)/value.mli \
$(HERE)/value.ml \
$(HERE)/var.mli \
$(HERE)/var.ml \
$(HERE)/ne.mli \
$(HERE)/ne.ml \
$(HERE)/exp.mli \
$(HERE)/exp.ml \
$(HERE)/constraint.mli \
$(HERE)/constraint.ml \
$(HERE)/lustreExp.mli \
$(HERE)/lustreExp.ml \
$(HERE)/parser.mly \
$(HERE)/lexer.mll \
$(HERE)/lucProg.mli \
$(HERE)/gne.mli \
$(HERE)/gne.ml \
$(HERE)/lucParse.mli \
$(HERE)/lucParse.ml \
$(HERE)/lucParse.mli \
$(HERE)/lucProg.mli \
$(HERE)/lucProg.ml \
$(HERE)/polyhedron.mli \
$(HERE)/polyhedron.ml \
$(HERE)/formula_to_bdd.mli \
$(HERE)/formula_to_bdd.ml \
$(HERE)/store.mli \
$(HERE)/store.ml \
$(HERE)/draw.mli \
$(HERE)/draw.ml \
$(HERE)/bddd.mli \
$(HERE)/bddd.ml \
$(HERE)/fair_bddd.mli \
$(HERE)/fair_bddd.ml \
$(HERE)/solver.mli \
$(HERE)/solver.ml \
$(HERE)/show_env.mli \
$(HERE)/show_env.ml \
$(HERE)/prog.mli \
$(HERE)/prog.ml \
$(HERE)/fGen.mli \
$(HERE)/fGen.ml \
\
$(HERE)/gen_stubs_common.mli \
$(HERE)/gen_stubs_common.ml \
\
......@@ -65,9 +130,14 @@ SOURCES = \
\
$(HERE)/gen_stubs.ml
RESULT = gen_stubs_exe
LIBS = str unix
ifdef MLONLY
SOURCES_OCAML =$(filter %.ml, $(SOURCES_OCAML))
endif
SOURCES = $(SOURCES_C) $(SOURCES_OCAML)
RESULT = gen_stubs_exe
-include $(OCAMLMAKEFILE)
......@@ -5,50 +5,121 @@
######################################################################
OCAMLNCFLAGS = -inline 10
ifndef OCAMLFLAGS
OCAMLFLAGS := -noassert -unsafe
endif
OCAMLFLAGS += -I $(OCAMLLIB) -I $(PREFIX)/$(HOSTTYPE)/lib
IDLFLAGS=-nocpp
OCAMLNCFLAGS = -inline 10
POLKA=polkag
ifdef STATIC
OCAMLLDFLAGS = -cclib -ldl -cclib -lm -cclib -lc -ccopt -static
OCAMLLDFLAGS = -cclib -lstdc++ -cclib -lm -cclib -lc -ccopt -static\
-cclib -l$(POLKA)_caml -cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
else
OCAMLLDFLAGS= -cc g++ -cclib -lstdc++ -cclib -I/usr/lib/w32api \
-cclib -l$(POLKA)_caml \
-cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
endif
LIBS = str unix
#CLIBS =
CC=gcc $(DWIN32)
LIBS = str unix nums polka bdd
CLIBS = camlidl $(CLIBS_WIN32) bdd_stubs
USE_CAMLP4 = yes
HERE=$(LURETTE_PATH)/source/
HERE=./
SOURCES_OCAML = \
SOURCES_C = \
$(HERE)/liblutin_c.c \
$(HERE)/liblutin.idl \
$(HERE)/Ezdl_c.c \
SOURCES_OCAML = \
$(HERE)/Ezdl.ml \
$(HERE)/Ezdl.mli \
$(HERE)/fake_env.ml \
$(HERE)/error.ml \
$(HERE)/version.ml \
$(HERE)/util.ml \
$(HERE)/util2.ml \
$(HERE)/graphUtil.ml \
$(HERE)/graphUtil.mli \
$(HERE)/sol_nb.mli \
$(HERE)/sol_nb.ml \
$(HERE)/type.mli \
$(HERE)/type.ml \
$(HERE)/luciole.ml \
$(HERE)/genlex.mli $(HERE)/genlex.ml \
$(HERE)/lexeme.mli $(HERE)/lexeme.ml \
$(HERE)/prevar.mli $(HERE)/prevar.ml \
$(HERE)/value.mli $(HERE)/value.ml \
$(HERE)/graph.mli $(HERE)/graph.ml \
$(HERE)/var.mli \
$(HERE)/thickness.ml \
$(HERE)/genlex.mli \
$(HERE)/genlex.ml \
$(HERE)/lexeme.mli \
$(HERE)/lexeme.ml \
$(HERE)/graph.mli \
$(HERE)/graph.ml \
$(HERE)/poly_draw.mli \
$(HERE)/poly_draw.ml \
$(HERE)/prevar.mli \
$(HERE)/prevar.ml \
$(HERE)/value.mli \
$(HERE)/value.ml \
$(HERE)/var.mli \
$(HERE)/var.ml \
$(HERE)/ne.mli \
$(HERE)/ne.ml \
$(HERE)/exp.mli \
$(HERE)/exp.ml \
$(HERE)/lustreExp.mli $(HERE)/lustreExp.ml \
$(HERE)/parser.mly $(HERE)/lexer.mll \
$(HERE)/lucProg.mli $(HERE)/lucProg.ml \
$(HERE)/env_state.mli $(HERE)/env_state.ml \
$(HERE)/constraint.mli \
$(HERE)/constraint.ml \
$(HERE)/lustreExp.mli \
$(HERE)/lustreExp.ml \
$(HERE)/parser.mly \
$(HERE)/lexer.mll \
$(HERE)/gne.mli \
$(HERE)/gne.ml \
$(HERE)/lucParse.mli \
$(HERE)/lucParse.ml \
$(HERE)/lucParse.mli \
$(HERE)/lucProg.mli \
$(HERE)/lucProg.ml \
$(HERE)/polyhedron.mli \
$(HERE)/polyhedron.ml \
$(HERE)/formula_to_bdd.mli \
$(HERE)/formula_to_bdd.ml \
$(HERE)/store.mli \
$(HERE)/store.ml \
$(HERE)/draw.mli \
$(HERE)/draw.ml \
$(HERE)/bddd.mli \
$(HERE)/bddd.ml \
$(HERE)/fair_bddd.mli \
$(HERE)/fair_bddd.ml \
$(HERE)/solver.mli \
$(HERE)/solver.ml \
$(HERE)/show_env.mli \
$(HERE)/show_env.ml \
$(HERE)/prog.mli \
$(HERE)/prog.ml \
$(HERE)/fGen.mli \
$(HERE)/fGen.ml \
\
$(HERE)/luciole.ml \
$(HERE)/luc2c.ml
ifdef MLONLY
SOURCES_OCAML =$(filter %.ml, $(SOURCES_OCAML))
endif
SOURCES = $(SOURCES_OCAML)
SOURCES = $(SOURCES_C) $(SOURCES_OCAML)
RESULT = luc2c
......
#
#
-include ../Makefile.common.source
######################################################################
OCAMLNCFLAGS = -inline 10
ifndef OCAMLFLAGS
OCAMLFLAGS := -noassert -unsafe
endif
OCAMLFLAGS += -I $(OCAMLLIB) -I $(PREFIX)/$(HOSTTYPE)/lib
IDLFLAGS=-nocpp
OCAMLNCFLAGS = -inline 10
POLKA=polkag
ifdef STATIC
OCAMLLDFLAGS = -cclib -ldl -cclib -lm -cclib -lc -ccopt -static
OCAMLLDFLAGS = -cclib -lstdc++ -cclib -lm -cclib -lc -ccopt -static\
-cclib -l$(POLKA)_caml -cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
else
OCAMLLDFLAGS= -cc g++ -cclib -lstdc++ -cclib -I/usr/lib/w32api \
-cclib -l$(POLKA)_caml \
-cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
endif
LIBS = str unix
#CLIBS =
CC=gcc $(DWIN32)
LIBS = str unix nums polka bdd
CLIBS = camlidl $(CLIBS_WIN32) bdd_stubs
USE_CAMLP4 = yes
HERE=$(LURETTE_PATH)/source/
HERE=./
SOURCES_OCAML = \
SOURCES_C = \
$(HERE)/liblutin_c.c \
$(HERE)/liblutin.idl \
$(HERE)/Ezdl_c.c \
SOURCES_OCAML = \
$(HERE)/Ezdl.ml \
$(HERE)/Ezdl.mli \
$(HERE)/error.ml \
$(HERE)/version.ml \
$(HERE)/util.ml \
$(HERE)/util2.ml \
$(HERE)/graphUtil.ml \
$(HERE)/graphUtil.mli \
$(HERE)/graphUtil.mli \
$(HERE)/sol_nb.mli \
$(HERE)/sol_nb.ml \
$(HERE)/type.mli \
$(HERE)/type.ml \
$(HERE)/luciole.ml \
$(HERE)/genlex.mli $(HERE)/genlex.ml \
$(HERE)/lexeme.mli $(HERE)/lexeme.ml \
$(HERE)/prevar.mli $(HERE)/prevar.ml \
$(HERE)/value.mli $(HERE)/value.ml \
$(HERE)/graph.mli $(HERE)/graph.ml \
$(HERE)/var.mli \
$(HERE)/thickness.ml \
$(HERE)/genlex.mli \
$(HERE)/genlex.ml \
$(HERE)/lexeme.mli \
$(HERE)/lexeme.ml \
$(HERE)/graph.mli \
$(HERE)/graph.ml \
$(HERE)/poly_draw.mli \
$(HERE)/poly_draw.ml \
$(HERE)/prevar.mli \
$(HERE)/prevar.ml \
$(HERE)/value.mli \
$(HERE)/value.ml \
$(HERE)/var.mli \
$(HERE)/var.ml \
$(HERE)/ne.mli \
$(HERE)/ne.ml \
$(HERE)/exp.mli \
$(HERE)/exp.ml \
$(HERE)/lustreExp.mli $(HERE)/lustreExp.ml \
$(HERE)/parser.mly $(HERE)/lexer.mll \
$(HERE)/lucProg.mli $(HERE)/lucProg.ml \
$(HERE)/constraint.mli \
$(HERE)/constraint.ml \
$(HERE)/lustreExp.mli \
$(HERE)/lustreExp.ml \
$(HERE)/parser.mly \
$(HERE)/lexer.mll \
$(HERE)/gne.mli \
$(HERE)/gne.ml \
$(HERE)/lucParse.mli \
$(HERE)/lucParse.ml \
$(HERE)/lucParse.mli \
$(HERE)/lucProg.mli \
$(HERE)/lucProg.ml \
$(HERE)/polyhedron.mli \
$(HERE)/polyhedron.ml \
$(HERE)/formula_to_bdd.mli \
$(HERE)/formula_to_bdd.ml \
$(HERE)/store.mli \
$(HERE)/store.ml \
$(HERE)/draw.mli \
$(HERE)/draw.ml \
$(HERE)/bddd.mli \
$(HERE)/bddd.ml \
$(HERE)/fair_bddd.mli \
$(HERE)/fair_bddd.ml \
$(HERE)/solver.mli \
$(HERE)/solver.ml \
$(HERE)/show_env.mli \
$(HERE)/show_env.ml \
$(HERE)/prog.mli \
$(HERE)/prog.ml \
$(HERE)/fGen.mli \
$(HERE)/fGen.ml \
\
$(HERE)/luciole.ml \
$(HERE)/gen_stubs_common.mli \
$(HERE)/gen_stubs_common.ml \
$(HERE)/parse_poc.mli \
$(HERE)/parse_poc.ml \
$(HERE)/env_state.mli $(HERE)/env_state.ml \
$(HERE)/luc2luciole.ml
SOURCES = $(SOURCES_OCAML)
ifdef MLONLY
SOURCES_OCAML =$(filter %.ml, $(SOURCES_OCAML))
endif
SOURCES = $(SOURCES_C) $(SOURCES_OCAML)
RESULT = luc2luciole
......
......@@ -90,6 +90,8 @@ SOURCES = $(SOURCES_C) \
$(HERE)/lexer.mll \
$(HERE)/gne.mli \
$(HERE)/gne.ml \
$(HERE)/lucParse.mli \
$(HERE)/lucParse.ml \
$(HERE)/lucProg.mli \
$(HERE)/lucProg.ml \
$(HERE)/polyhedron.mli \
......@@ -100,8 +102,6 @@ SOURCES = $(SOURCES_C) \
$(HERE)/store.ml \
$(HERE)/draw.mli \
$(HERE)/draw.ml \
$(HERE)/env_state.mli \
$(HERE)/env_state.ml \
$(HERE)/bddd.mli \
$(HERE)/bddd.ml \
$(HERE)/fair_bddd.mli \
......@@ -110,6 +110,8 @@ SOURCES = $(SOURCES_C) \
$(HERE)/solver.ml \
$(HERE)/show_env.mli \
$(HERE)/show_env.ml \
$(HERE)/prog.mli \
$(HERE)/prog.ml \
$(HERE)/fGen.mli \
$(HERE)/fGen.ml \
$(HERE)/print.mli \
......
......@@ -80,12 +80,12 @@ SOURCES_OCAML = \
$(HERE)/lexer.mll \
$(HERE)/gne.mli \
$(HERE)/gne.ml \
$(HERE)/lucParse.mli \
$(HERE)/lucParse.ml \
$(HERE)/lucProg.mli \
$(HERE)/lucProg.ml \
$(HERE)/polyhedron.mli \
$(HERE)/polyhedron.ml \
$(HERE)/env_state.mli \
$(HERE)/env_state.ml \
$(HERE)/formula_to_bdd.mli \
$(HERE)/formula_to_bdd.ml \
$(HERE)/store.mli \
......@@ -100,6 +100,8 @@ SOURCES_OCAML = \
$(HERE)/solver.ml \
$(HERE)/show_env.mli \
$(HERE)/show_env.ml \
$(HERE)/prog.mli \
$(HERE)/prog.ml \
$(HERE)/fGen.mli \
$(HERE)/fGen.ml \
$(HERE)/print.mli \
......@@ -117,49 +119,9 @@ SOURCES_OCAML = \
$(HERE)/luc4ocaml_nolbl.mli \
$(HERE)/luc4ocaml_nolbl.ml
ifdef MLONLY
SOURCES_OCAML := \
$(HERE)/liblutin_c.c \
$(HERE)/liblutin.idl \
$(HERE)/Ezdl_c.c \