Commit 1ecf703d authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Remove some modules that are now defined in rdbg-plugin: Event, Failure, Expr, Data, RifIO.

Note that rif_base has been renamed rifIO, and event to rdbgEvent.
parent fd7a6ee6
......@@ -269,8 +269,6 @@ LURETTE_SOURCES=\
$(OBJDIR)/lucFGen.ml \
$(OBJDIR)/lucky.mli \
$(OBJDIR)/lucky.ml \
$(OBJDIR)/rif_base.mli \
$(OBJDIR)/rif_base.ml \
$(OBJDIR)/rif.mli \
$(OBJDIR)/rif.ml \
$(OBJDIR)/coverage.mli \
......
export OCAMLOPT=ocamlopt
LTOP=../../../bin/lurettetop$(EXE)
LIB=../../../lib
LIB=../../../lib -I +rdbg-plugin
MAIN=rabbit
......@@ -14,7 +14,7 @@ $(EXPDIR):
%.cmxs: %.ml
ocamlopt -shared -o $*.cmxs -I $(LIB) graphics.cmxa ocamlRM.cmx rif_base.cmx $*.ml
ocamlopt -shared -o $*.cmxs -I $(LIB) graphics.cmxa ocamlRM.cmx $*.ml
clean:
......
LTOP=../../../bin/lurettetop
LDBG=../../../bin/ldbg
LDBG=../../../bin/ldbg -I +rdbg-plugin
EXPDIR=`$(LTOP) --ocaml-version`
$(EXPDIR):
......
......@@ -12,9 +12,9 @@ ifeq ($(HOSTTYPE),mac)
LD_ARCH=-DMAC
endif
CMXA_LIB = unix.cmxa nums.cmxa str.cmxa bdd.cmxa polka.cmxa luc4ocaml.cmxa
CMXA_LIB = unix.cmxa nums.cmxa str.cmxa bdd.cmxa polka.cmxa rdbg-plugin.cmxa luc4ocaml.cmxa
CMA_LIB=luc4ocaml.cma
LUC4OCAML_INSTALL_DIR = -I ../../../lib
LUC4OCAML_INSTALL_DIR = -I ../../../lib -I +rdbg-plugin
LUTIN=../../../bin/lutin$(EXE)
# LUC4OCAML_INSTALL_DIR = -I +lucky
......
LTOP=../../../bin/lurettetop
LDBG=../../../bin/ldbg
LDBG=../../../bin/ldbg -I +rdbg-plugin
LURETTETOP=$(LTOP) \
--test-length 100 --thick-draw 1 \
......@@ -96,7 +96,7 @@ endif
# check that lurettetop and ldbg produce the same rif
test5.rif: heater_control$(EXE)
rm -f test5.rif0 .lurette_rc
$(LDBG) -init test5.ml
$(LDBG) -init test5.ml
grep -v "This is lurette Version" test5.rif0 > test5.rif
test5:test5.rif $(EXPDIR)/
......@@ -141,7 +141,7 @@ heater_control$(EXE): heater_control.ec
%.c: %.ec
../../../bin/ec2c$(EXE) -loop $^
LIB=-I ../../../lib graphics.cmxa ocaml2c.cmx ocamlRM.cmx rif_base.cmx
LIB=-I ../../../lib graphics.cmxa ocaml2c.cmx ocamlRM.cmx -I +rdbg-plugin rdbg-plugin.cmxa
XXX=-I ../../../source/obj-linux/
# Essai pour appeler via des cmxs du code C généré par lus2c
......
......@@ -97,8 +97,6 @@ SOURCES_OCAML = \
$(OBJDIR)/show_env.ml \
$(OBJDIR)/prog.mli \
$(OBJDIR)/prog.ml \
$(OBJDIR)/data.mli \
$(OBJDIR)/data.ml \
$(LUTIN_FILES) \
$(OBJDIR)/lucProg.mli \
$(OBJDIR)/lucProg.ml \
......
......@@ -98,8 +98,6 @@ SOURCES_OCAML = \
$(OBJDIR)/show_env.ml \
$(OBJDIR)/prog.mli \
$(OBJDIR)/prog.ml \
$(OBJDIR)/data.mli \
$(OBJDIR)/data.ml \
$(LUTIN_FILES) \
$(OBJDIR)/lucProg.mli \
$(OBJDIR)/lucProg.ml \
......
......@@ -97,8 +97,6 @@ SOURCES_OCAML = \
$(OBJDIR)/show_env.ml \
$(OBJDIR)/prog.mli \
$(OBJDIR)/prog.ml \
$(OBJDIR)/data.mli \
$(OBJDIR)/data.ml \
$(LUTIN_FILES) \
$(OBJDIR)/lucProg.mli \
$(OBJDIR)/lucProg.ml \
......
......@@ -46,10 +46,12 @@ endif
OCAMLLDFLAGS = -output-obj \
-cclib -lpolkag_caml$(DEBUG) -cclib -lpolkag \
-cclib -lgmp -cclib -lm -cclib -ldl \
-cclib -lcamlidl
-cclib -lcamlidl -I +rdbg-plugin
OCAMLFLAGS += -I +rdbg-plugin
LIBS = str unix nums polka bdd
LIBS = str unix nums polka bdd rdbg-plugin
USE_CAMLP4 = yes
......@@ -58,7 +60,7 @@ SOURCES_C = \
$(FENV) $(FLEX) $(OBJDIR)/luc4c_stubs.c $(OBJDIR)/luc4c_stubs.h
SOURCES = $(EVENT) $(LUTIN_SOURCES) $(SOURCES_C) \
SOURCES = $(LUTIN_SOURCES) $(SOURCES_C) \
$(OBJDIR)/luc4c.ml
ln: $(OBJDIR) $(SOURCES)
......
......@@ -24,10 +24,12 @@ ifeq ($(HOST_TYPE),mac)
endif
LIBS = unix str nums polka bdd
LIBS = unix str nums polka bdd rdbg-plugin
CLIBS = bdd_stubs camlidl
CLIBS = bdd_stubs bdd camlidl gmp stdc++ polkag_caml polkag
OCAMLFLAGS += -I +rdbg-plugin
OCAMLLDFLAGS += -I +rdbg-plugin
USE_CAMLP4 = yes
......@@ -95,8 +97,6 @@ SOURCES_OCAML = \
$(OBJDIR)/prog.mli \
$(OBJDIR)/prog.ml \
$(OBJDIR)/lucky.mli \
$(OBJDIR)/data.mli \
$(OBJDIR)/data.ml \
$(LUTIN_FILES) \
$(OBJDIR)/lucProg.mli \
$(OBJDIR)/lucProg.ml \
......@@ -106,8 +106,6 @@ SOURCES_OCAML = \
$(OBJDIR)/lucFGen.ml \
$(OBJDIR)/print.mli \
$(OBJDIR)/print.ml \
$(OBJDIR)/rif_base.mli \
$(OBJDIR)/rif_base.ml \
$(OBJDIR)/rif.mli \
$(OBJDIR)/rif.ml \
$(OBJDIR)/sim2chro.mli \
......
......@@ -10,7 +10,7 @@ include $(LURETTE_PATH)/source/Makefile.ln
#STATIC=yes
OCAMLFLAGS += -I $(OBJDIR) -I $(OCAMLLIB) -I $(PREFIX)/$(HOSTTYPE)/lib
OCAMLFLAGS += -I $(OBJDIR) -I $(OCAMLLIB) -I $(PREFIX)/$(HOSTTYPE)/lib -I +rdbg-plugin
IDLFLAGS=-nocpp
......@@ -18,11 +18,11 @@ POLKA=polkag
ifdef STATIC
OCAMLLDFLAGS = -cclib -lstdc++ -cclib -lm -cclib -lc -ccopt -static\
-cclib -l$(POLKA)_caml -cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
-cclib -l$(POLKA)_caml -cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG) -I +rdbg-plugin
else
OCAMLLDFLAGS= -cclib -lstdc++ -cclib -I/usr/lib/w32api \
-cclib -l$(POLKA)_caml \
-cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
-cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG) -I +rdbg-plugin
endif
......@@ -30,7 +30,7 @@ endif
CC=$(GCC) $(DWIN32)
LIBS = unix str nums polka bdd
LIBS = unix str nums polka bdd rdbg-plugin
CLIBS = camlidl $(CLIBS_WIN32) bdd_stubs
......@@ -102,8 +102,6 @@ SOURCES_OCAML0:= \
$(OBJDIR)/prog.mli \
$(OBJDIR)/prog.ml \
$(OBJDIR)/lucky.mli \
$(OBJDIR)/data.mli \
$(OBJDIR)/data.ml \
$(LUTIN_FILES) \
$(OBJDIR)/lucProg.mli \
$(OBJDIR)/lucProg.ml \
......@@ -113,8 +111,6 @@ SOURCES_OCAML0:= \
$(OBJDIR)/lucFGen.ml \
$(OBJDIR)/print.mli \
$(OBJDIR)/print.ml \
$(OBJDIR)/rif_base.mli \
$(OBJDIR)/rif_base.ml \
$(OBJDIR)/rif.mli \
$(OBJDIR)/rif.ml \
$(OBJDIR)/sim2chro.mli \
......
......@@ -7,7 +7,7 @@ include $(LURETTE_PATH)/source/Makefile.ln
######################################################################
OCAMLFLAGS += -I $(OBJDIR) -I $(OCAMLLIB) -I $(PREFIX)/$(HOSTTYPE)/lib
OCAMLFLAGS += -I $(OBJDIR) -I $(OCAMLLIB) -I $(PREFIX)/$(HOSTTYPE)/lib -I +rdbg-plugin
IDLFLAGS=-nocpp
......@@ -15,11 +15,11 @@ POLKA=polkag
ifdef STATIC
OCAMLLDFLAGS = -cclib -lstdc++ -cclib -lm -cclib -lc -ccopt -static\
-cclib -l$(POLKA)_caml -cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
-cclib -l$(POLKA)_caml -cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG) -I +rdbg-plugin
else
OCAMLLDFLAGS= -cclib -lstdc++ -cclib -I/usr/lib/w32api \
-cclib -l$(POLKA)_caml \
-cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
-cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG) -I +rdbg-plugin
endif
......@@ -28,7 +28,7 @@ CC=$(GCC) $(DWIN32)
LIBS = str unix nums polka bdd
LIBS = str unix nums polka bdd rdbg-plugin
CLIBS = camlidl $(CLIBS_WIN32) bdd_stubs
USE_CAMLP4 = yes
......@@ -101,8 +101,6 @@ SOURCES_OCAML := \
$(OBJDIR)/prog.mli \
$(OBJDIR)/prog.ml \
$(OBJDIR)/lucky.mli \
$(OBJDIR)/data.mli \
$(OBJDIR)/data.ml \
$(LUTIN_FILES) \
$(OBJDIR)/lucProg.mli \
$(OBJDIR)/lucProg.ml \
......@@ -112,8 +110,6 @@ SOURCES_OCAML := \
$(OBJDIR)/lucFGen.ml \
$(OBJDIR)/print.mli \
$(OBJDIR)/print.ml \
$(OBJDIR)/rif_base.mli \
$(OBJDIR)/rif_base.ml \
$(OBJDIR)/rif.mli \
$(OBJDIR)/rif.ml \
$(OBJDIR)/sim2chro.mli \
......
......@@ -7,7 +7,7 @@ include $(LURETTE_PATH)/source/Makefile.ln
# STATIC=yes
OCAMLFLAGS += -I $(OBJDIR) -I $(OCAMLLIB) -I $(PREFIX)/$(HOSTTYPE)/lib
OCAMLFLAGS += -I $(OBJDIR) -I $(OCAMLLIB) -I $(PREFIX)/$(HOSTTYPE)/lib -I +rdbg-plugin
#-I ~/dd/ocamlnat/_build/src/toplevel/
IDLFLAGS=-nocpp
......@@ -16,17 +16,17 @@ POLKA=polkag
ifdef STATIC
OCAMLLDFLAGS = -cclib -lstdc++ -cclib -lm -cclib -lc -ccopt -static\
-cclib -l$(POLKA)_caml -cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
-cclib -l$(POLKA)_caml -cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG) -I +rdbg-plugin
else
OCAMLLDFLAGS= -cclib -lstdc++ -cclib -I/usr/lib/w32api \
-cclib -l$(POLKA)_caml -cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
-cclib -l$(POLKA)_caml -cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG) -I +rdbg-plugin
# -cclib ~/dd/ocamlnat/_build/src/libocamlnat.a
endif
CC= $(GCC) $(DWIN32)
LIBS = unix dynlink str nums polka bdd
LIBS = unix dynlink str nums polka bdd rdbg-plugin
CLIBS = camlidl $(CLIBS_WIN32) bdd_stubs
#USE_CAMLP4 = yes
......@@ -138,7 +138,6 @@ LUSTRE_SOURCES = \
LTOP_SOURCES = \
$(EVENT) \
$(LUTIN_SOURCES) \
$(LUSTRE_SOURCES) \
$(OBJDIR)/ltopArg.ml \
......
type ctx = (* inherited debug info *)
{
ctx_step :int;
ctx_name :string;
ctx_depth:int;
ctx_data: Data.subst list;
ctx_terminate: unit -> unit;
ctx_inputs : string list;
ctx_outputs : string list;
}
type src_info = {
str : string ;
file : string ;
line : int * int ;
char : int * int ;
stack : src_info option;
}
(* Source info related to the elected constraint *)
type cstr_lazy_src_info = (unit -> src_info list)
type port =
| Call
| Exit of string * Expr.t (* The elected contraint that produced the outputs *) * cstr_lazy_src_info
| Fail of string * Expr.t (* The elected contraint that failed *) * cstr_lazy_src_info *
(unit -> Failure.info)
type node_info = {
port : port;
name : string;
lang : string;
inputs : string list; (* static info *)
outputs : string list; (* static info *)
}
type kind =
| Node of node_info
| Ltop
(* when an elected constraint is unsatisfiable *)
type t = {
nb:int;
step : int;
depth : int;
kind : kind;
data : Data.subst list;
other : string;
next : unit -> t;
terminate: unit -> unit;
}
(* ou bien un MapString ?
ou bien une structure avec tout un tas d'autre info ?
devra etre abrait en tout cas
*)
exception End of int
let (next : t -> t) = fun e -> e.next ()
let (terminate : t -> unit) = fun e -> e.terminate ()
let (data : t -> Data.subst list) = fun e -> e.data
let seed = ref 42
let set_seed s = seed := s
let event_nb = ref 0
let set_nb i = event_nb := i
let get_nb () = !event_nb
let incr_nb() =
Random.init (!seed + !event_nb); (* make sure everything is reproductible *)
incr event_nb
(* Expressions *)
type t =
| Op of oper * t list
| True | False
| Ival of Num.num | Fval of float
| Var of string
and
oper =
| And | Or | Xor | Impl | Not | Eq | Ite
| Sup | SupEq | Inf | InfEq
| Sum | Diff | Prod | Quot | Mod | Div | Uminus
| Call of string
let (to_string : t -> string) =
fun t ->
let rec aux b t =
let b = " "^b in
(match t with
| Op(And,[e1;e2]) -> (aux b e1)^" and " ^(aux b e2)
| Op(Or,[e1;e2]) -> "("^(aux b e1)^" or " ^(aux b e2) ^ ")"
| Op(Xor,[e1;e2]) -> "("^(aux b e1)^" xor" ^(aux b e2) ^ ")"
| Op(Impl,[e1;e2]) -> "("^(aux b e1)^" =>" ^(aux b e2) ^ ")"
| Op(Not,[e]) -> "not(" ^(aux b e) ^")"
| Op(Eq,[e1;e2]) -> (aux b e1)^ "=" ^(aux b e2)
(* | Op(Ite,[c;e1;e2]) -> "("^(aux b e1)^"ite" ^(aux b e2) *)
| Op(Sup,[e1;e2]) -> (aux b e1)^">" ^(aux b e2)
| Op(SupEq,[e1;e2]) -> (aux b e1)^">=" ^(aux b e2)
| Op(Inf,[e1;e2]) -> (aux b e1)^"<" ^(aux b e2)
| Op(InfEq,[e1;e2]) -> (aux b e1)^"<=" ^(aux b e2)
| Op(Sum,[e1;e2]) -> "("^(aux b e1)^"+" ^(aux b e2) ^ ")"
| Op(Diff,[e1;e2]) -> "("^(aux b e1)^"-" ^(aux b e2) ^ ")"
| Op(Prod,[e1;e2]) -> (aux b e1)^"*" ^(aux b e2)
| Op(Quot,[e1;e2]) -> (aux b e1)^"/" ^(aux b e2)
| Op(Mod,[e1;e2]) -> "("^(aux b e1)^"mod" ^(aux b e2) ^ ")"
| Op(Div,[e1;e2]) -> (aux b e1)^"/" ^(aux b e2)
| Op (op,l) -> (oper_aux b op) ^ "(\n"^b ^
((String.concat (",\n"^b) (List.map (aux b) l))^"\n"^b^")")
| True -> "t"
| False -> "f"
| Ival(n) -> Num.string_of_num n
| Fval(f) -> string_of_float f
| Var(str) -> str
)
and
oper_aux b = function
| And -> "and"
| Or -> "or"
| Xor -> "xor"
| Impl -> "impl"
| Not -> "not"
| Eq -> "eq"
| Ite -> "ite"
| Sup -> "sup"
| SupEq -> "supeq"
| Inf -> "inf"
| InfEq -> "infeq"
| Sum -> "sum"
| Diff -> "diff"
| Prod -> "prod"
| Quot -> "quot"
| Mod -> "mod"
| Div -> "div"
| Uminus -> "uminus"
| Call str -> str
in
aux "" t
let dump e =
print_string ((to_string e)^ "\n")
let rec (simplify : t -> t) =
fun t ->
match t with
| Op(And, (Op(And,l)::tail)) -> simplify (Op(And, (l@tail)))
| Op(Or, (Op(Or,l)::tail)) -> simplify (Op(Or, (l@tail)))
| Op(Sum, (Op(Sum,l)::tail)) -> simplify (Op(Sum, (l@tail)))
| Op(Not,[Op(Not, [e])]) -> simplify e
| Op(Not,[Op(Sup, [e1;e2])]) -> Op(InfEq, [simplify e1;simplify e2])
| Op(Not,[Op(Inf, [e1;e2])]) -> Op(SupEq, [simplify e1;simplify e2])
| Op(Not,[Op(SupEq, [e1;e2])]) -> Op(Inf, [simplify e1;simplify e2])
| Op(Not,[Op(InfEq, [e1;e2])]) -> Op(Sup, [simplify e1;simplify e2])
| Op (op,l) -> Op (op, List.map simplify l)
| e -> e
(* exported *)
type info =
| Boolean of Expr.t
| Numeric of Expr.t
(*-----------------------------------------------------------------------
** Copyright (C) - Verimag.
** This file may only be copied under the terms of the GNU Library General
** Public License
**-----------------------------------------------------------------------
**
** File: failure.ml
** Main author: jahier@imag.fr
*)
type info =
| Boolean of Expr.t
| Numeric of Expr.t
(* Time-stamp: <modified the 24/05/2013 (at 11:25) by Erwan Jahier> *)
(* Time-stamp: <modified the 21/11/2013 (at 11:19) by Erwan Jahier> *)
(*-----------------------------------------------------------------------
** Copyright (C) - Verimag.
*)
......@@ -49,8 +49,8 @@ let make argv =
let (vntl_o:Data.vntl) = vntl_of_profile soc_outputs in
let oc = stdout in
(* Lv6util.dump_entete oc; *)
(* Rif_base.write_interface oc vntl_i vntl_o None None; *)
(* Rif_base.flush oc; *)
(* RifIO.write_interface oc vntl_i vntl_o None None; *)
(* RifIO.flush oc; *)
let (to_soc_subst : SocExecValue.ctx -> Soc.var list -> Data.subst list) =
fun ctx vl ->
......@@ -74,8 +74,8 @@ let make argv =
let ctx = SocExec.do_step soc_tbl soc ctx in
let sl_out = to_soc_subst ctx soc_outputs in
ctx_ref := ctx;
(* Rif_base.write_outputs oc Util.my_string_of_float vntl_o sl_out; *)
(* Rif_base.flush oc; *)
(* RifIO.write_outputs oc Util.my_string_of_float vntl_o sl_out; *)
(* RifIO.flush oc; *)
sl_out
in
let step_dbg sl_in ectx cont =
......
......@@ -445,11 +445,11 @@ let (start : unit -> Event.t) =
Rif.write oc ("# This is lurette Version " ^ Version.str ^ " (" ^Version.sha^")\n");
Rif.write oc ("# The random engine was initialized with the seed " ^
(string_of_int seed) ^ "\n" );
Rif_base.write_interface oc
RifIO.write_interface oc
(luciole_outputs_vars@flat_env_out) flat_sut_out loc (Some oracle_out_l);
Rif.flush oc;
Rif_base.write_interface sim2chro_oc
RifIO.write_interface sim2chro_oc
(luciole_outputs_vars@flat_env_out) flat_sut_out loc (Some oracle_out_l);
Rif.flush sim2chro_oc;
in
......
......@@ -23,8 +23,10 @@ ifeq ($(HOST_TYPE),mac)
IDLFLAGS=-nocpp
endif
OCAMLFLAGS += -I +rdbg-plugin
OCAMLLDFLAGS += -I +rdbg-plugin
LIBS = unix str nums polka bdd event
LIBS = unix str nums polka bdd rdbg-plugin
CLIBS = bdd_stubs camlidl
CLIBS = bdd_stubs bdd camlidl gmp stdc++ polkag_caml polkag
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment