Commit 5e274bbc authored by Erwan Jahier's avatar Erwan Jahier

Enhance the gnuplot-rif visualiser

parent b8d06ba6
...@@ -200,3 +200,4 @@ ...@@ -200,3 +200,4 @@
#step 50 #step 50
1.1005 1.1065 1.0838 1.0901 1.0854 1.0888 1.0854 1.0790 F F F F F F F F F F #outs 1.0854 F F F F F F F F F F F F 1 1 1 1 1.1005 1.1065 1.0838 1.0901 1.0854 1.0888 1.0854 1.0790 F F F F F F F F F F #outs 1.0854 F F F F F F F F F F F F 1 1 1 1
#locs -0.0017 0.0066 0.0062 0.0078 0.0142 0.0036 -0.0117 -0.0062 1.0859 -0.1186 #locs -0.0017 0.0066 0.0062 0.0078 0.0142 0.0036 -0.0117 -0.0062 1.0859 -0.1186
#
...@@ -2015,3 +2015,9 @@ ...@@ -2015,3 +2015,9 @@
#step 500 #step 500
6.42 6.45 7.41 7.97 #outs F 6.42 6.45 7.41 7.97 #outs F
#locs 63 0.01 0.02 -0.06 -0.06 #locs 63 0.01 0.02 -0.06 -0.06
#
# ==> The test completed; no property has been violated.
#
##
# Coverage:
#
...@@ -32,8 +32,8 @@ test2: ...@@ -32,8 +32,8 @@ test2:
grep -v "lurette chronogram" test2.rif0 | \ grep -v "lurette chronogram" test2.rif0 | \
grep -v "The execution lasted"| sed -e "s/^M//"\ grep -v "The execution lasted"| sed -e "s/^M//"\
> test2.rif &&\ > test2.rif &&\
$(RM) test3.res && diff -u -i test2.rif.exp test2.rif \ $(RM) test2.res && diff -u -i test2.rif.exp test2.rif \
> test3.res > test2.res
[ ! -s test2.res ] && make clean [ ! -s test2.res ] && make clean
test3 : test3 :
...@@ -41,8 +41,8 @@ test3 : ...@@ -41,8 +41,8 @@ test3 :
$(LURETTETOP) -l 100 -go -seed 1 \ $(LURETTETOP) -l 100 -go -seed 1 \
--do-not-show-step -ns2c -sut heater_ctrl2.lus -msn heater_ctrl2 -o test3.rif0 window.luc &&\ --do-not-show-step -ns2c -sut heater_ctrl2.lus -msn heater_ctrl2 -o test3.rif0 window.luc &&\
grep -v "lurette chronogram" test3.rif0 | \ grep -v "lurette chronogram" test3.rif0 | \
grep -v "The execution lasted"| sed -e "s/^M//" > test3.rif grep -v "The execution lasted"| sed -e "s/^M//" > test3.rif && \
$(RM) test3.res && diff -u -i test3.rif.exp test3.rif > test3.res $(RM) test3.res && diff -u -i test3.rif.exp test3.rif > test3.res
[ ! -s test3.res ] && make clean [ ! -s test3.res ] && make clean
......
...@@ -99,3 +99,4 @@ ...@@ -99,3 +99,4 @@
#step 30 #step 30
10 #outs T 10 #outs T
#locs -1 F #locs -1 F
#
...@@ -98,3 +98,4 @@ ...@@ -98,3 +98,4 @@
#step 30 #step 30
17.8512 #outs F 17.8512 #outs F
#locs -0.8882 #locs -0.8882
#
...@@ -310,3 +310,4 @@ ...@@ -310,3 +310,4 @@
#step 100 #step 100
16.04 #outs 10.00 T 16.04 #outs 10.00 T
#locs 0.18 0 #locs 0.18 0
#
This diff is collapsed.
...@@ -416,3 +416,9 @@ T F T F T T #outs F F F T F ...@@ -416,3 +416,9 @@ T F T F T T #outs F F F T F
#step 100 #step 100
T F T T T F #outs F F F T F T F T T T F #outs F F F T F
#locs #locs
#
# ==> The test completed; no property has been violated.
#
##
# Coverage:
#
...@@ -416,3 +416,9 @@ F T F F F F #outs F F F F F ...@@ -416,3 +416,9 @@ F T F F F F #outs F F F F F
#step 100 #step 100
F F F F T F #outs T F F F F F F F F T F #outs T F F F F
#locs #locs
#
# ==> The test completed; no property has been violated.
#
##
# Coverage:
#
...@@ -344,6 +344,7 @@ lib_prof:liblurette_prof.a ...@@ -344,6 +344,7 @@ lib_prof:liblurette_prof.a
##############################################################################" ##############################################################################"
.PHONY: gnuplot-rif
gnuplot-rif: gnuplot-rif:
make -k nc -f Makefile.gnuplot-rif make -k nc -f Makefile.gnuplot-rif
......
...@@ -47,7 +47,7 @@ SOURCES_C = \ ...@@ -47,7 +47,7 @@ SOURCES_C = \
$(HERE)/liblutin.idl \ $(HERE)/liblutin.idl \
$(HERE)/Ezdl_c.c \ $(HERE)/Ezdl_c.c \
SOURCES_OCAML := \ SOURCES_OCAML0:= \
$(HERE)/Ezdl.ml \ $(HERE)/Ezdl.ml \
$(HERE)/Ezdl.mli \ $(HERE)/Ezdl.mli \
$(HERE)/error.ml \ $(HERE)/error.ml \
...@@ -89,8 +89,6 @@ SOURCES_OCAML := \ ...@@ -89,8 +89,6 @@ SOURCES_OCAML := \
$(HERE)/lucParse.mli \ $(HERE)/lucParse.mli \
$(HERE)/lucParse.ml \ $(HERE)/lucParse.ml \
$(HERE)/lucParse.mli \ $(HERE)/lucParse.mli \
$(HERE)/lucProg.mli \
$(HERE)/lucProg.ml \
$(HERE)/polyhedron.mli \ $(HERE)/polyhedron.mli \
$(HERE)/polyhedron.ml \ $(HERE)/polyhedron.ml \
$(HERE)/formula_to_bdd.mli \ $(HERE)/formula_to_bdd.mli \
...@@ -107,6 +105,8 @@ SOURCES_OCAML := \ ...@@ -107,6 +105,8 @@ SOURCES_OCAML := \
$(HERE)/solver.ml \ $(HERE)/solver.ml \
$(HERE)/show_env.mli \ $(HERE)/show_env.mli \
$(HERE)/show_env.ml \ $(HERE)/show_env.ml \
$(HERE)/lucProg.mli \
$(HERE)/lucProg.ml \
$(HERE)/prog.mli \ $(HERE)/prog.mli \
$(HERE)/prog.ml \ $(HERE)/prog.ml \
$(HERE)/fGen.mli \ $(HERE)/fGen.mli \
...@@ -129,8 +129,9 @@ SOURCES_OCAML := \ ...@@ -129,8 +129,9 @@ SOURCES_OCAML := \
./luc4ocaml_nolbl.ml ./luc4ocaml_nolbl.ml
ifdef MLONLY ifdef MLONLY
SOURCES_OCAML =$(filter %.ml, $(SOURCES_OCAML)) SOURCES_OCAML =$(filter %.ml, $(SOURCES_OCAML0))
endif endif
SOURCES_OCAML=$(SOURCES_OCAML0)
SOURCES = $(SOURCES_C) $(SOURCES_OCAML) SOURCES = $(SOURCES_C) $(SOURCES_OCAML)
......
...@@ -16,7 +16,7 @@ open Var ...@@ -16,7 +16,7 @@ open Var
open Type open Type
open List open List
open Util open Util
open Prog open Prog
(****************************************************************************) (****************************************************************************)
...@@ -31,20 +31,20 @@ open Prog ...@@ -31,20 +31,20 @@ open Prog
type t = type t =
| Cont of (unit -> t * Exp.formula * LucParse.node list) | Cont of (unit -> t * Exp.formula * LucParse.node list)
| Finish (* no more solutions *) | Finish (* no more solutions *)
| RStop of string (* Normal Termination (for Lutin) *)
(** wt is traversed using continuations *) (** wt is traversed using continuations *)
type wt_cont = type wt_cont =
| WCont of (unit -> wt_cont * Exp.formula * LucParse.node) | WCont of (unit -> wt_cont * Exp.formula * LucParse.node)
| WFinish (* no more solutions *) | WFinish (* no more solutions *)
| WStop of string (* ditto, but stop at once raising an exception *)
(****************************************************************************) (****************************************************************************)
(* Exported *) (* Exported *)
exception NoMoreFormula exception NoMoreFormula
exception NormalStop of string
let (call_cont : t -> t * formula * LucParse.node list) = let (call_cont : t -> t * formula * LucParse.node list) =
fun cont -> fun cont ->
...@@ -52,13 +52,16 @@ let (call_cont : t -> t * formula * LucParse.node list) = ...@@ -52,13 +52,16 @@ let (call_cont : t -> t * formula * LucParse.node list) =
match cont with match cont with
| Cont f -> f () | Cont f -> f ()
| Finish -> raise NoMoreFormula | Finish -> raise NoMoreFormula
| RStop str -> raise (NormalStop str)
let (call_wt_cont : wt_cont -> wt_cont * formula * LucParse.node) = let (call_wt_cont : wt_cont -> wt_cont * formula * LucParse.node) =
fun cont -> fun cont ->
let _ = if debug then (print_string "XXX call_wt_cont\n"; flush stdout) in let _ = if debug then (print_string "XXX call_wt_cont\n"; flush stdout) in
match cont with match cont with
| WCont f -> f () | WCont f -> f ()
| WFinish -> WFinish, False, "" | WFinish -> WFinish, False, "" (* dummy *)
| WStop msg -> cont, True (* dummy *), "" (* dummy *)
(* exported *) (* exported *)
let (choose_one_formula: t -> t * Exp.formula * Prog.ctrl_state) = let (choose_one_formula: t -> t * Exp.formula * Prog.ctrl_state) =
...@@ -81,8 +84,7 @@ let (get_all_formula: t -> formula list) = ...@@ -81,8 +84,7 @@ let (get_all_formula: t -> formula list) =
(****************************************************************************) (****************************************************************************)
let rec (wt_list_to_cont : Var.env_in -> Prog.state -> wt_cont list ->
let rec (wt_list_to_cont : Var.env_in -> Prog.state -> wt_cont list ->
formula -> LucParse.node list -> t -> t) = formula -> LucParse.node list -> t -> t) =
fun input state wtl facc nl fgen -> fun input state wtl facc nl fgen ->
(* [nl] is the list of nodes that correspond to [facc] *) (* [nl] is the list of nodes that correspond to [facc] *)
...@@ -90,12 +92,14 @@ let rec (wt_list_to_cont : Var.env_in -> Prog.state -> wt_cont list -> ...@@ -90,12 +92,14 @@ let rec (wt_list_to_cont : Var.env_in -> Prog.state -> wt_cont list ->
match wtl with match wtl with
| [] -> Cont (fun () -> (fgen, facc, nl)) | [] -> Cont (fun () -> (fgen, facc, nl))
| wt::wtl' -> | wt::wtl' ->
if wt = WFinish then if wt = WFinish then
fgen fgen
else else
match choose_one_formula_atomic input state facc wt with match choose_one_formula_atomic input state facc wt with
| WFinish, False, "" -> | WFinish, False, "" ->
fgen fgen
| WStop str, _, "" ->
RStop str
| wt2, f2, n -> | wt2, f2, n ->
let fgen' = let fgen' =
Cont (fun () -> Cont (fun () ->
...@@ -109,6 +113,9 @@ and ...@@ -109,6 +113,9 @@ and
let _ = if debug then (print_string "XXX choose_one_formula_atomic\n"; flush stdout) in let _ = if debug then (print_string "XXX choose_one_formula_atomic\n"; flush stdout) in
if cont = WFinish then if cont = WFinish then
WFinish, False, "" WFinish, False, ""
else
if cont = WStop str then
WStop str, True, ""
else else
let (cont', f, n) = call_wt_cont cont in let (cont', f, n) = call_wt_cont cont in
let _ = if debug then (print_string ("XXX "^ n ^ "\n"); flush stdout) in let _ = if debug then (print_string ("XXX "^ n ^ "\n"); flush stdout) in
...@@ -133,7 +140,8 @@ and (wt_to_cont : Var.env_in -> Prog.state -> wt -> wt_cont -> wt_cont) = ...@@ -133,7 +140,8 @@ and (wt_to_cont : Var.env_in -> Prog.state -> wt -> wt_cont -> wt_cont) =
let _ = if debug then (print_string ("XXX wt_to_cont "^ n ^"\n"); flush stdout) in let _ = if debug then (print_string ("XXX wt_to_cont "^ n ^"\n"); flush stdout) in
let children = Util.StringMap.find n tbl in let children = Util.StringMap.find n tbl in
match children with match children with
| Leave f -> WCont(fun () -> (cont, f, LucProg.get_original_name n)) | Prog.Stop str -> WStop str
| Leave (f,nstate) -> WCont(fun () -> (cont, f, nstate))
| Children l -> | Children l ->
if l = [] then if l = [] then
cont cont
......
...@@ -68,6 +68,9 @@ val get : Var.env_in -> Prog.state -> t list ...@@ -68,6 +68,9 @@ val get : Var.env_in -> Prog.state -> t list
(** Raised by choose_one_formula no more transitions can be taken *) (** Raised by choose_one_formula no more transitions can be taken *)
exception NoMoreFormula exception NoMoreFormula
(** Raised by choose_one_formula when a Prog.Stop is chosen (For Lutin) *)
exception NormalStop of string
val choose_one_formula : t -> t * Exp.formula * Prog.ctrl_state val choose_one_formula : t -> t * Exp.formula * Prog.ctrl_state
(** [choose_one_formula run_aut] draws a formula accessible from (** [choose_one_formula run_aut] draws a formula accessible from
......
This diff is collapsed.
...@@ -184,6 +184,12 @@ let (print_debug_no_ic : string -> unit) = ...@@ -184,6 +184,12 @@ let (print_debug_no_ic : string -> unit) =
else else
() ()
(*******************************************************************************)
let set_min v x = match x with None -> v | Some x -> Var.set_min v x
let set_max v x = match x with None -> v | Some x -> Var.set_max v x
let set_init v x = match x with None -> v | Some x -> Var.set_init v x
let set_alias v x = match x with None -> v | Some x -> Var.set_alias v x
let set_default v x = match x with None -> v | Some x -> Var.set_default v x
(*******************************************************************************) (*******************************************************************************)
(** Parsing pragmas *) (** Parsing pragmas *)
...@@ -590,11 +596,11 @@ and (flatten_user_type : Exp.var -> Exp.var_tbl * LustreExp.vut) = ...@@ -590,11 +596,11 @@ and (flatten_user_type : Exp.var -> Exp.var_tbl * LustreExp.vut) =
| UT(EnumT(el)) -> | UT(EnumT(el)) ->
let var1 = Var.make !loc_var_prefix (Var.name var) (UT(EnumT(el))) (Var.mode var) in let var1 = Var.make !loc_var_prefix (Var.name var) (UT(EnumT(el))) (Var.mode var) in
let var2 = Var.set_min var1 (Some (Numer(Ival 0))) in let var2 = Var.set_min var1 ((Numer(Ival 0))) in
let var3 = Var.set_max var2 (Some (Numer(Ival((List.length el) - 1)))) in let var3 = Var.set_max var2 ((Numer(Ival((List.length el) - 1)))) in
let var4 = Var.set_alias var3 (Var.alias var) in let var4 = set_alias var3 ((Var.alias var)) in
let var5 = Var.set_default var4 (Var.default var) in let var5 = set_default var4 ( (Var.default var)) in
let var6 = Var.set_init var5 (Var.init var) in let var6 = set_init var5 ( (Var.init var)) in
let var6_tbl = Exp.add_var (Var.name var6) var6 empty_var_tbl in let var6_tbl = Exp.add_var (Var.name var6) var6 empty_var_tbl in
( (
var6_tbl, var6_tbl,
...@@ -677,11 +683,11 @@ and (fill_var_options : Exp.var -> Exp.var_tbl -> Exp.var_tbl) = ...@@ -677,11 +683,11 @@ and (fill_var_options : Exp.var -> Exp.var_tbl -> Exp.var_tbl) =
and default = StringMap.find vn default_tbl and default = StringMap.find vn default_tbl
and init = StringMap.find vn init_tbl and init = StringMap.find vn init_tbl
in in
let var1 = if min = None then var else Var.set_min var min in let var1 = set_min var min in
let var2 = if max = None then var1 else Var.set_max var1 max in let var2 = set_max var1 max in
let var3 = if alias = None then var2 else Var.set_alias var2 alias in let var3 = set_alias var2 alias in
let var4 = if default = None then var3 else Var.set_default var3 default in let var4 = set_default var3 default in
if init = None then var4 else Var.set_init var4 init if init = None then var4 else set_init var4 init
with with
_ -> _ ->
let print_tbl tbl = let print_tbl tbl =
...@@ -1163,11 +1169,11 @@ and (var_options_to_var : Lexing.lexbuf -> typedef list -> string -> Type.t -> ...@@ -1163,11 +1169,11 @@ and (var_options_to_var : Lexing.lexbuf -> typedef list -> string -> Type.t ->
Not_found -> None (* no init value *) Not_found -> None (* no init value *)
in in
let var0 = (Var.make !loc_var_prefix vn vt vm) in let var0 = (Var.make !loc_var_prefix vn vt vm) in
let var1 = Var.set_min var0 min in let var1 = set_min var0 min in
let var2 = Var.set_max var1 max in let var2 = set_max var1 max in
let var3 = Var.set_alias var2 alias in let var3 = set_alias var2 alias in
let var4 = Var.set_default var3 default in let var4 = set_default var3 default in
let var5 = Var.set_init var4 init in let var5 = set_init var4 init in
var5 var5
and (parse_options_list : Exp.var_tbl -> LustreExp.vut -> typedef list -> and (parse_options_list : Exp.var_tbl -> LustreExp.vut -> typedef list ->
......
...@@ -56,6 +56,13 @@ let empty = { ...@@ -56,6 +56,13 @@ let empty = {
graph = Graph.create () graph = Graph.create ()
} }
let set_min v x = match x with None -> v | Some x -> Var.set_min v x
let set_max v x = match x with None -> v | Some x -> Var.set_max v x
let set_init v x = match x with None -> v | Some x -> Var.set_init v x
let set_alias v x = match x with None -> v | Some x -> Var.set_alias v x
let set_default v x = match x with None -> v | Some x -> Var.set_default v x
(****************************************************************************) (****************************************************************************)
let (merge_var : Exp.var list -> Exp.var list -> Exp.var list) = let (merge_var : Exp.var list -> Exp.var list -> Exp.var list) =
(* (*
...@@ -165,11 +172,11 @@ let (merge_var : Exp.var list -> Exp.var list -> Exp.var list) = ...@@ -165,11 +172,11 @@ let (merge_var : Exp.var list -> Exp.var list -> Exp.var list) =
Some v Some v
in in
let var1' = let var1' =
(Var.set_min (set_min
(Var.set_max (set_max
(Var.set_alias (set_alias
(Var.set_default (set_default
(Var.set_init (set_init
var1 var1
init) init)
default) default)
...@@ -287,7 +294,7 @@ let (make_one : t -> LucParse.t -> t) = ...@@ -287,7 +294,7 @@ let (make_one : t -> LucParse.t -> t) =
let var' = let var' =
try try
let init_var = (Var.init (StringMap.find vn all_vars)) in let init_var = (Var.init (StringMap.find vn all_vars)) in
Var.set_init var init_var set_init var init_var
with _ -> with _ ->
(* The1 var corresponding to "pre var" should exists in that table *) (* The1 var corresponding to "pre var" should exists in that table *)
assert false assert false
...@@ -379,10 +386,10 @@ let (make_one : t -> LucParse.t -> t) = ...@@ -379,10 +386,10 @@ let (make_one : t -> LucParse.t -> t) =
| Some (Numer e) -> set var (Some (Numer (cnc vars e))) | Some (Numer e) -> set var (Some (Numer (cnc vars e)))
| Some (Liste _) -> assert false | Some (Liste _) -> assert false
in in
let nvar = aux Var.min Var.set_min let nvar = aux Var.min set_min
(aux Var.max Var.set_max (aux Var.max set_max
(aux Var.init Var.set_init (aux Var.init set_init
(aux Var.alias Var.set_alias var))) (aux Var.alias set_alias var)))
in in
(StringMap.add (Var.name nvar) nvar vars), nvar (StringMap.add (Var.name nvar) nvar vars), nvar
...@@ -623,14 +630,4 @@ let (is_node_final : LucParse.node -> t -> bool) = ...@@ -623,14 +630,4 @@ let (is_node_final : LucParse.node -> t -> bool) =
assert false assert false
(* exported *)
let (get_original_name : LucParse.node -> LucParse.node) =
fun n ->
let res =
if String.sub n 0 1 <> "_" then n else
try
let idx = 2 + Str.search_forward (Str.regexp "__") n 0 in
String.sub n idx ((String.length n) - idx)
with _ -> assert false
in
res
...@@ -35,5 +35,3 @@ val make : string option -> string list -> t ...@@ -35,5 +35,3 @@ val make : string option -> string list -> t
val is_node_transient : LucParse.node -> t -> bool val is_node_transient : LucParse.node -> t -> bool
val is_node_final : LucParse.node -> t -> bool val is_node_final : LucParse.node -> t -> bool
(** exploit the internal naming convention to get the original name (XXX beurk). *)
val get_original_name : LucParse.node -> LucParse.node
...@@ -134,12 +134,12 @@ let (make_bool_expr : (var_name * var_type) list -> string -> bool_expr) = ...@@ -134,12 +134,12 @@ let (make_bool_expr : (var_name * var_type) list -> string -> bool_expr) =
match t with match t with
Int -> Int ->
let v = Var.make "" x (var_type_to_type t) Var.Output in let v = Var.make "" x (var_type_to_type t) Var.Output in
let v1 = Var.set_max v (Some (Numer(Ival !default_max_int))) in let v1 = Var.set_max v ((Numer(Ival !default_max_int))) in
Var.set_min v1 (Some (Numer(Ival !default_min_int))) Var.set_min v1 ((Numer(Ival !default_min_int)))
| Float -> | Float ->
let v = Var.make "" x (var_type_to_type t) Var.Output in let v = Var.make "" x (var_type_to_type t) Var.Output in
let v1 = Var.set_max v (Some (Numer(Fval (!default_max_float)))) in let v1 = Var.set_max v ((Numer(Fval (!default_max_float)))) in
Var.set_min v1 (Some (Numer(Fval (-.(!default_max_float))))) Var.set_min v1 ((Numer(Fval (-.(!default_max_float)))))
| Bool -> | Bool ->
Var.make "" x (var_type_to_type t) Var.Output Var.make "" x (var_type_to_type t) Var.Output
) )
......
...@@ -53,6 +53,14 @@ let output_msg msg = ...@@ -53,6 +53,14 @@ let output_msg msg =
output_string stdout msg; output_string stdout msg;
flush stdout flush stdout
let output_msg2 rif msg =
let rif_msg = "#" ^ (Str.global_replace (Str.regexp "\n") "\n#") msg in
output_string stdout msg;
output_string rif (rif_msg);
flush stdout
let debug_msg msg = if options.verb > 1 then output_msg msg else () let debug_msg msg = if options.verb > 1 then output_msg msg else ()
let (print_vn_str : (string * string) list -> unit) = let (print_vn_str : (string * string) list -> unit) =
...@@ -152,7 +160,10 @@ let print_failure i o oo l t rif = ...@@ -152,7 +160,10 @@ let print_failure i o oo l t rif =
l l
options.display_local_var options.display_local_var
sut_o_vntl sut_o_vntl
sut_i_vntl sut_i_vntl;
output_string rif "\n# oracle output variables:\n" ;
output_string rif (Var.subst_list_to_string "#" oo)
let soi = string_of_int let soi = string_of_int
...@@ -177,7 +188,7 @@ let check_oracle inputs sut_outputs locals memory t rif state = ...@@ -177,7 +188,7 @@ let check_oracle inputs sut_outputs locals memory t rif state =
then then
( (
(* print inputs and outputs of all wrong tuple *) (* print inputs and outputs of all wrong tuple *)
output_msg ( output_msg2 rif (
"\n*** An assertion of the oracle has been violated at step "^(soi t)^ "\n*** An assertion of the oracle has been violated at step "^(soi t)^
" with the following values:\n "); " with the following values:\n ");
...@@ -635,19 +646,19 @@ and ...@@ -635,19 +646,19 @@ and
match Var.typ var with match Var.typ var with
| Type.BoolT -> | Type.BoolT ->
if str = "t" then Value.B(true) else if str = "f" then Value.B(false) else ( if str = "t" then Value.B(true) else if str = "f" then Value.B(false) else (
output_msg ("Can not convert into a bool:'"^str^"'\n"); output_msg2 rif ("Can not convert into a bool:'"^str^"'\n");
lurette_exit 2 lurette_exit 2
) )
| Type.IntT -> ( | Type.IntT -> (
try Value.N(Value.I(int_of_string str)) try Value.N(Value.I(int_of_string str))
with _ -> with _ ->
output_msg ("Can not convert into an int:'"^str^"'\n"); output_msg2 rif ("Can not convert into an int:'"^str^"'\n");
lurette_exit 2 lurette_exit 2
) )
| Type.FloatT -> ( | Type.FloatT -> (
try Value.N(Value.F(float_of_string str)) try Value.N(Value.F(float_of_string str))
with _ -> with _ ->
output_msg ("Can not convert into a float:'"^str^"'\n"); output_msg2 rif ("Can not convert into a float:'"^str^"'\n");
lurette_exit 2) lurette_exit 2)
| Type.UT _ -> assert false | Type.UT _ -> assert false
in in
...@@ -662,7 +673,7 @@ and ...@@ -662,7 +673,7 @@ and
List.iter List.iter
(fun var -> (fun var ->
let value = try List.assoc (Var.name var) sl with Not_found -> let value = try List.assoc (Var.name var) sl with Not_found ->
output_msg ("Reading luciole inputs: the value of " ^ (Var.name var) ^ " is unknown.\n"); output_msg2 rif ("Reading luciole inputs: the value of " ^ (Var.name var) ^ " is unknown.\n");
lurette_exit 2 lurette_exit 2