Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 50ccf63a authored by Erwan Jahier's avatar Erwan Jahier
Browse files

lurette 0.86 Wed, 18 Sep 2002 15:27:17 +0200 by jahier

Parent-Version:      0.85
Version-Log:

Finish to implement xlurette.

Project-Description: Lurette
parent 87afe5b2
......@@ -3,17 +3,17 @@
(Created-By-Prcs-Version 1 3 3)
(source/command_line_ima_exe.mli 1082 1021651153 b/34_command_li 1.3)
(doc/ocamldoc.sty 1380 1008328137 b/12_ocamldoc.s 1.1)
(source/env_state.ml 20128 1031053030 51_env_state. 1.26)
(source/env_state.ml 20317 1032355637 51_env_state. 1.27)
(source/graph.ml 2563 1027066799 14_graph.ml 1.7)
(bin/Makefile.ima_exe 2013 1027066799 b/41_Makefile.i 1.3)
(test/giro/onlyroll.lus 18298 1031732392 c/7_onlyroll.l 1.1)
(source/util.ml 14262 1030614411 35_util.ml 1.24)
(test/time.exp 5577 1030614411 b/48_time.exp 1.3)
(source/solver.ml 24432 1031053030 39_solver.ml 1.26)
(myrules 9937 1031732392 c/14_myrules 1.1)
(myrules 10363 1032355637 c/14_myrules 1.2)
(test/test_gen_stubs.h 1818 1020068208 b/45_test_gen_s 1.1)
(source/command_line.ml 4625 1031053030 b/20_command_li 1.8)
(source/lurette.ml 12417 1031736584 12_lurette.ml 1.50)
(source/lurette.ml 12476 1032355637 12_lurette.ml 1.51)
(source/solver.mli 1003 1027092697 38_solver.mli 1.13)
(source/env.mli 2028 1027349504 15_env.mli 1.15)
(test/heater_float.rif.exp 1456 1031732392 b/30_heater_flo 1.6)
......@@ -28,16 +28,17 @@
(ID_EN_VRAC 2184 1002196285 0_ID_EN_VRAC 1.1)
(source/parse_env.mli 1025 1027066799 40_parse_env. 1.9)
(source/sim2chro.mli 1455 1027943375 b/23_sim2chro.m 1.5)
(ihm/xlurette/xlurette_glade_interface.ml 27644 1032355637 c/15_xlurette_g 1.1)
(test/passerelle.ima 972 1027066799 b/17_passerelle 1.7)
(source/ima_exe.ml 12067 1030978777 b/32_ima_exe.ml 1.17)
(source/ima_exe.ml 12101 1032355637 b/32_ima_exe.ml 1.18)
(doc/automata_format 0 1007379917 b/3_automata_f 1.1)
(source/control.ml 4416 1030975996 c/4_control.ml 1.3)
(source/eval.ml 7755 1027066799 49_eval.ml 1.13)
(source/gen_stubs.ml 34183 1031736584 24_generate_l 1.33)
(source/gen_stubs.ml 34392 1032355637 24_generate_l 1.34)
(source/parse_env.ml 22510 1031732392 41_parse_env. 1.23)
(doc/ocamldoc.hva 313 1008328137 b/13_ocamldoc.h 1.1)
(source/automata.mli 3397 1027349504 b/46_automata.m 1.2)
(source/sim2chro.ml 2719 1031732392 b/24_sim2chro.m 1.11)
(source/sim2chro.ml 2716 1032355637 b/24_sim2chro.m 1.12)
(doc/Interface_draft 5232 1003928781 19_Interface_ 1.1)
(source/formula.mli 3638 1027066799 44_formula.ml 1.14)
(demo/chaudiere/chaudiere.ima 442 1031732392 c/11_chaudiere. 1.1)
......@@ -46,7 +47,7 @@
(test/time.res 5577 1030614411 b/49_time.res 1.6)
(TAGS 9825 1007379917 21_TAGS 1.6)
(source/command_line.mli 1442 1031053030 b/21_command_li 1.7)
(source/env_state.mli 6722 1031053030 50_env_state. 1.22)
(source/env_state.mli 6729 1032355637 50_env_state. 1.23)
(source/rnumsolver.mli 1736 1031053030 b/26_rnumsolver 1.4)
(source/ima_exe.mli 447 1016127950 b/31_ima_exe.ml 1.1)
(source/eval.mli 1395 1027066799 48_eval.mli 1.10)
......@@ -61,14 +62,15 @@
(Makefile.lurette 678 1031736584 b/38_Makefile.l 1.10)
(source/show_env.ml 3603 1030532285 43_show_env.m 1.12)
(source/gne.mli 1079 1027066799 b/36_gne.mli 1.2)
(source/automata.ml 15814 1030975671 b/47_automata.m 1.3)
(ihm/xlurette/xlurette_glade_main.ml 5077 1031736584 c/12_xlurette_g 1.2)
(source/automata.ml 15818 1032355637 b/47_automata.m 1.4)
(ihm/xlurette/xlurette_glade_main.ml 16104 1032355637 c/12_xlurette_g 1.3)
(doc/synthese 2556 1007379917 b/2_synthese 1.1)
(bin/Makefile.lurette_lib 1768 1031732392 c/2_Makefile.l 1.2)
(bin/Makefile.gen_stubs 472 1030532285 b/42_Makefile.g 1.2)
(test/ControleurPorte.h 2306 1012914629 b/18_Controleur 1.1)
(source/show_env.mli 1091 1027066799 42_show_env.m 1.7)
(test/Makefile 105 1031732392 c/0_Makefile 1.4)
(ihm/xlurette/makefile 783 1032355637 c/16_makefile 1.1)
(test/temp_int.ima 647 1027066799 b/50_temp_int.e 1.1)
(source/gne.ml 8173 1027066799 b/37_gne.ml 1.2)
(test/tram_simple.h 1746 1013519411 b/25_tram_simpl 1.1)
......@@ -78,8 +80,8 @@
(test/heater_float.lus 175 1020068208 b/44_heater_flo 1.1)
(test/vrai_tram.c 3060 1027066799 b/8_vrai_tram. 1.3)
(source/print.mli 773 1027066799 46_print.mli 1.10)
(source/lurettetop.ml 21120 1031732392 c/1_lurettetop 1.7)
(ihm/xlurette/xlurette.glade 24095 1031732392 c/13_xlurette.g 1.1)
(source/lurettetop.ml 24417 1032355637 c/1_lurettetop 1.8)
(ihm/xlurette/xlurette.glade 43069 1032355637 c/13_xlurette.g 1.2)
(test/heater_int.lus 170 1020068208 b/43_heater_int 1.1)
(source/graph.mli 2218 1027066799 13_graph.mli 1.9)
(test/heater_int.rif.exp 860 1028297733 b/28_heater_int 1.6)
......
xlurette: dummy
ocamlc -c -I +lablgtk -labels -c xlurette_glade_interface.ml
ocamlc -c -i -I +lablgtk -labels -c xlurette_glade_callbacks.ml
ocamlc -c -I +lablgtk -c xlurette_glade_main.ml
ocamlc -I +lablgtk -o xlurette unix.cma lablgtk.cma gtkInit.cmo \
xlurette_glade_callbacks.cmo xlurette_glade_interface.cmo xlurette_glade_main.cmo
xlurette.opt: dummy
ocamlopt -c -I +lablgtk -labels -c xlurette_glade_interface.ml
ocamlopt -c -I +lablgtk -labels -c xlurette_glade_callbacks.ml
ocamlopt -c -I +lablgtk -c xlurette_glade_main.ml
ocamlopt -I +lablgtk -labels -o xlurette.opt unix.cmxa lablgtk.cmxa gtkInit.cmx \
xlurette_glade_callbacks.cmx xlurette_glade_interface.cmx xlurette_glade_main.cmx
clean:
rm -f *.cm* *.o a.out xlurette xlurette.opt
dummy:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 3)
(Project-Description "Lurette")
(Project-Version lurette 0 85)
(Parent-Version lurette 0 84)
(Project-Version lurette 0 86)
(Parent-Version lurette 0 85)
(Version-Log "
source/gen_stubs.ml:
Add a lurette_stub__ prefix to most function names to make sure
that there is no name clashes. In particular, oracle can now be
called oracle.lus ... (but not lurette_stub__oracle.lus, which is not
so bad...).
Finish to implement xlurette.
")
(New-Version-Log ""
)
(Checkin-Time "Wed, 11 Sep 2002 11:29:44 +0200")
(Checkin-Time "Wed, 18 Sep 2002 15:27:17 +0200")
(Checkin-Login jahier)
(Populate-Ignore ())
(Project-Keywords)
......@@ -27,14 +21,14 @@ source/gen_stubs.ml:
;; Sources files for ima_exe
(source/ima_exe.mli (lurette/b/31_ima_exe.ml 1.1 644))
(source/ima_exe.ml (lurette/b/32_ima_exe.ml 1.17 644))
(source/ima_exe.ml (lurette/b/32_ima_exe.ml 1.18 644))
(source/command_line_ima_exe.ml (lurette/b/33_command_li 1.5 644))
(source/command_line_ima_exe.mli (lurette/b/34_command_li 1.3 644))
;; Sources files for lurette only
(source/lurette.mli (lurette/11_lurette.ml 1.12 644))
(source/lurette.ml (lurette/12_lurette.ml 1.50 644))
(source/lurette.ml (lurette/12_lurette.ml 1.51 644))
(source/command_line.ml (lurette/b/20_command_li 1.8 644))
(source/command_line.mli (lurette/b/21_command_li 1.7 644))
......@@ -69,20 +63,20 @@ source/gen_stubs.ml:
(source/eval.mli (lurette/48_eval.mli 1.10 644))
(source/eval.ml (lurette/49_eval.ml 1.13 644))
(source/env_state.mli (lurette/50_env_state. 1.22 644))
(source/env_state.ml (lurette/51_env_state. 1.26 644))
(source/env_state.mli (lurette/50_env_state. 1.23 644))
(source/env_state.ml (lurette/51_env_state. 1.27 644))
(source/automata.mli (lurette/b/46_automata.m 1.2 644))
(source/automata.ml (lurette/b/47_automata.m 1.3 644))
(source/automata.ml (lurette/b/47_automata.m 1.4 644))
(source/sim2chro.mli (lurette/b/23_sim2chro.m 1.5 644))
(source/sim2chro.ml (lurette/b/24_sim2chro.m 1.11 644))
(source/sim2chro.ml (lurette/b/24_sim2chro.m 1.12 644))
(source/gne.mli (lurette/b/36_gne.mli 1.2 644))
(source/gne.ml (lurette/b/37_gne.ml 1.2 644))
(source/lurettetop.ml (lurette/c/1_lurettetop 1.7 644))
(source/gen_stubs.ml (lurette/24_generate_l 1.33 644))
(source/lurettetop.ml (lurette/c/1_lurettetop 1.8 644))
(source/gen_stubs.ml (lurette/24_generate_l 1.34 644))
(source/control.mli (lurette/c/3_control.ml 1.2 644))
(source/control.ml (lurette/c/4_control.ml 1.3 644))
......@@ -142,6 +136,12 @@ source/gen_stubs.ml:
(test/Makefile (lurette/c/0_Makefile 1.4 644))
;; xlurette
(ihm/xlurette/xlurette_glade_main.ml (lurette/c/12_xlurette_g 1.3 644))
(ihm/xlurette/xlurette.glade (lurette/c/13_xlurette.g 1.2 644))
(ihm/xlurette/xlurette_glade_interface.ml (lurette/c/15_xlurette_g 1.1 644))
(ihm/xlurette/makefile (lurette/c/16_makefile 1.1 644))
;; Files added by populate at Wed, 04 Sep 2002 09:46:46 +0200,
;; to version 0.83(w), by jahier:
......@@ -158,16 +158,13 @@ source/gen_stubs.ml:
(demo/chaudiere/buggy_chaudiere_ctrl.lus (lurette/c/10_buggy_chau 1.1 644))
(demo/chaudiere/chaudiere.ima (lurette/c/11_chaudiere. 1.1 644))
;; Files added by populate at Wed, 04 Sep 2002 09:48:05 +0200,
;; to version 0.83(w), by jahier:
(ihm/xlurette/xlurette_glade_main.ml (lurette/c/12_xlurette_g 1.2 644))
(ihm/xlurette/xlurette.glade (lurette/c/13_xlurette.g 1.1 644))
;; Files added by populate at Wed, 04 Sep 2002 17:24:47 +0200,
;; to version 0.83(w), by jahier:
(myrules (lurette/c/14_myrules 1.1 644))
(myrules (lurette/c/14_myrules 1.2 644))
)
(Merge-Parents)
(New-Merge-Parents)
......@@ -124,7 +124,8 @@ heaterf:
# In order to time profile lurette
gprof:
$(LURETTE_PATH)/make_lurette ControleurPorte -oracle vrai_tram pnc; \
./lurette 10000 1 1 tram.env usager.env porte.env passerelle.env -seed 1014422484 -ns2c ;\
./lurette 10000 1 1 tram.env usager.env porte.env passerelle.env \
-seed 1014422484 -ns2c ;\
gprof ./lurette > lurette.gprof ; \
echo " ---> The result of the profiling is in the lurette.gprof file"
gprof2:
......@@ -183,7 +184,8 @@ install:
release:
rm -rf lurette-release ; \
mkdir lurette-release/ ; mkdir lurette-release/bin ; \
mkdir lurette-release/ ; mkdir lurette-release/bin ;\
mkdir lurette-release/ihm ;mkdir lurette-release/ihm/xlurette \
mkdir lurette-release/source ; mkdir lurette-release/test ; \
cp $(LURETTE_PATH)/source/util.ml $(LURETTE_PATH)/source/gen_stubs.ml \
$(LURETTE_PATH)/source/show_ima.ml \
......@@ -207,6 +209,13 @@ release:
$(LURETTE_PATH)/source/make_lurette.ml \
$(LURETTE_PATH)/lurette.prj \
lurette-release/source/ ;\
cp $(LURETTE_PATH)/ihm/xlurette/makefile \
$(LURETTE_PATH)/ihm/xlurette/xlurette.glade \
$(LURETTE_PATH)/ihm/xlurette/xlurette_glade_main.ml \
$(LURETTE_PATH)/ihm/xlurette/xlurette_glade_interface.ml \
$(LURETTE_PATH)/ihm/xlurette/xlurette_glade_callbacks.ml \
lurette-release/ihm/xlurette; \
cp $(LURETTE_PATH)/myrukes lurette-release/ ;\
cp $(LURETTE_PATH)/OcamlMakefile lurette-release/ ;\
cp $(LURETTE_PATH)/Makefile lurette-release/ ;\
cp $(LURETTE_PATH)/test/usager.env lurette-release/test/;\
......
......@@ -490,7 +490,7 @@ let rec (choose_n_formula_acc: int -> t -> accT -> accT) =
choose_n_formula_acc (n-1) a ((ntl, f, st)::nt_f_st_l0)
with Not_found ->
let nodes_str = intset_to_string (fst a) in
Env_state.dump_env_state_stat ();
Env_state.dump_env_state_stat stderr;
if (IntSet.cardinal (fst a)) = 1
then failwith ("*** No (more) transition(s) can be made from node "
^ nodes_str ^ ". \n")
......
......@@ -464,10 +464,20 @@ let _ = assert ( (add_missing_pre ["_pre3toto"; "_pre2titi"; "_pre2toto"])
content of [file]. *)
let (read_env_state_one_file : string -> node) =
fun file ->
let ic = try open_in file with
_ ->
(
print_string ("*** File " ^ file
^ " does not exist. Please check its name.\n");
flush stdout;
exit 2
)
in
let
(* Parses the content of [file]. *)
Parse_env.Automata(init_node, list_in, list_out, list_loc,
list_pre, list_ce, list_arcs) =
try
Parse_env.parse_automata(
Parse_env.lexer(Stream.of_channel (open_in file)))
......@@ -565,9 +575,9 @@ let (clear_all : unit -> unit) =
(****************************************************************************)
(* Exported *)
let (dump_env_state_stat : unit -> unit) =
fun _ ->
let dump x = output_string stderr x in
let (dump_env_state_stat : out_channel -> unit) =
fun res ->
let dump x = output_string res x in
dump "***************************************************************\n";
dump "******************* A few statistics ... **********************\n";
dump ("*** pre var names: " ^
......
......@@ -194,5 +194,5 @@ val set_draw_mode: draw_mode -> unit
(** outputs various statistic about the size of env_state tables *)
val dump_env_state_stat : unit -> unit
val dump_env_state_stat : out_channel -> unit
......@@ -227,7 +227,7 @@ let (check_var_type: vn_ct list -> vn_ct list -> vn_ct list -> res) =
let print_var_list vl =
List.iter
(fun (v, t) ->
print_string (v ^ " of type " ^ t ^ "; "))
output_string stderr (v ^ " of type " ^ t ^ "; "))
vl
in
if (not (sut_vars = or_vi)) then
......@@ -475,7 +475,7 @@ let c_type_to_lustre_type ct =
(
output_string stderr ("*** I don't know that type, sorry. It should work if "
^ "you provide your own oracle however.\n");
flush stdout;
flush stderr;
assert false
)
......@@ -941,30 +941,39 @@ let compile_lustre_program_if_needed lustre_prog =
)
then
(
output_string stderr (" ... No " ^ lustre_prog ^ ".c or no " ^ lustre_prog ^
output_string stdout ("*** No " ^ lustre_prog ^ ".c or no " ^ lustre_prog ^
".h exist(s), so I try to compile " ^ lustre_prog ^
".lus with the lus2ec and ec2c...\n");
let lustre_node = Filename.basename lustre_prog in
let cmd = ("lus2ec " ^ lustre_prog ^ ".lus " ^ lustre_node)
and cmd2 = ("ec2c " ^ lustre_prog ^ ".ec")
in
print_string (cmd ^ "\n");
output_string stderr (cmd ^ "\n");
if
((Sys.command cmd) <> 0)
then
failwith ("*** lustre compilation failed. You have to generate " ^
lustre_prog ^ ".h and " ^ lustre_prog ^ ".c on your own...\n")
(
output_string stdout
("*** lustre compilation failed. You have to generate " ^
lustre_prog ^ ".h and " ^ lustre_prog ^ ".c on your own...\n");
flush stdout;
exit 2
)
else
(
print_string " ... ok\n";
print_string (cmd2 ^ "\n");
output_string stderr " ... ok\n";
output_string stderr (cmd2 ^ "\n");
if
((Sys.command cmd2) <> 0)
then
failwith "*** ec2c failed. Is it in your path?\n"
(
output_string stdout "*** ec2c failed. Is it in your path?\n" ;
flush stdout;
exit 2
)
else
print_string " ... ok\n";
flush stdout
output_string stderr " ... ok\n";
flush stderr
)
)
......@@ -985,7 +994,7 @@ let (main : unit -> 'a) =
with _ -> ""
in
if sut = "lurette_stub__sut" then
prerr ("You can call your file lurette_stub__sut.lus, sorry ;" ^
output_string stderr ("You can call your file lurette_stub__sut.lus, sorry ;" ^
"please rename it.\n");
compile_lustre_program_if_needed sut;
gen_a_fake_oracle sut;
......@@ -1012,10 +1021,10 @@ let (main : unit -> 'a) =
let oracle = Sys.argv.(2) in
let _ =
if sut = "lurette_stub__sut" then
prerr ("You can call your file lurette_stub__sut.lus, sorry ;" ^
output_string stdout ("*** You cannot call your file lurette_stub__sut.lus, sorry ;" ^
"please rename it.\n");
if oracle = "lurette_stub__oracle" then
prerr ("You can call your file lurette_stub__oracle.lus, sorry ;" ^
output_string stdout ("You cannot call your file lurette_stub__oracle.lus, sorry ;" ^
"please rename it.\n");
compile_lustre_program_if_needed sut;
compile_lustre_program_if_needed oracle
......
......@@ -106,14 +106,14 @@ and (parse_rif_stream : vnt list -> rif_stream -> env_in -> env_in) =
then tbl
else
let tok_list = Stream.npeek 2 stream in
match tok_list with
match tok_list with
| [Genlex.Kwd "#"; Genlex.Ident id] ->
if List.mem id rif_pragmas
then
(
Stream.junk stream ;
Stream.junk stream ;
parse_rif_stream vntl stream tbl
parse_rif_stream vntl (lexer (Stream.of_string (read_line ()))) tbl
)
else
(* We skip everything that occurs after a [#] not followed by a
......
......@@ -103,7 +103,7 @@ let rec (main : unit -> 'a) =
with
Failure(errmsg) -> output_string stderr errmsg
| e ->
if options.verbose then Env_state.dump_env_state_stat ();
if options.verbose then Env_state.dump_env_state_stat stderr;
raise e
and
......@@ -198,9 +198,9 @@ and
else options.user_seed
in
Random.init seed ;
print_string "The random engine was initialized with the seed ";
print_int seed;
print_string "\n ";
output_string stdout
("The random engine was initialized with the seed " ^
(string_of_int seed) ^ "\n ");
flush stdout ;
(* Initialisation of the sut and the oracle *)
......@@ -224,8 +224,8 @@ and
Lurette_stub.sut_input_var_name_and_type_list
Lurette_stub.sut_output_var_name_and_type_list
local_var_name_and_type_list
stdout options.display_local_var;
flush stdout;
stderr options.display_local_var;
flush stderr;
)
else
(
......@@ -261,12 +261,12 @@ and
let _ =
if options.verbose then
(
output_string stderr ("\n--- step " ^ (string_of_int t) ^ ":\n");
output_string stdout ("\n--- step " ^ (string_of_int t) ^ ":\n");
List.iter
(fun n ->
output_string stderr ("current nodes:" ^ (string_of_int n) ^ "\n "))
output_string stdout ("current nodes:" ^ (string_of_int n) ^ "\n "))
(List.flatten (Env_state.current_nodes ()));
flush stderr
flush stdout
);
in
......@@ -308,7 +308,7 @@ and
if (List.mem false results)
then (
(* print inputs and outputs of all wrong tuple *)
output_string stderr ("\n*** An assertion of the oracle has been violated" ^
output_string stdout ("\n*** An assertion of the oracle has been violated" ^
" at step " ^ (string_of_int t) ^
" with the following values:\n ");
......@@ -316,12 +316,12 @@ and
(fun i o r ->
if (not r) then
(
output_string stderr "\n********************************";
output_string stderr "\n*** sut inputs:\n\t" ;
print_subst_list i stderr;
output_string stderr "\n*** sut outputs:\n\t" ;
print_env_in o stderr;
flush stderr
output_string stdout "\n********************************";
output_string stdout "\n*** sut inputs:\n\t" ;
print_subst_list i stdout;
output_string stdout "\n*** sut outputs:\n\t" ;
print_env_in o stdout;
flush stdout
)
else
()
......@@ -329,15 +329,16 @@ and
inputs
sut_outputs
results ;
output_string stderr "\n*** pre:\n\t" ;
print_subst_list (Env_state.pre ()) stderr;
flush stderr;
output_string stdout "\n*** pre:\n\t" ;
print_subst_list (Env_state.pre ()) stdout;
flush stdout;
flush rif;
if options.display_sim2chro
then Sim2chro.call_sim2chro options.output
else () ;
failwith ("\n*** Lurette stops because the oracle has been "
^ "violated at step " ^ (string_of_int t) ^ ".\n")
output_string stdout ("\n*** Lurette stops because the oracle has been "
^ "violated at step " ^ (string_of_int t) ^ ".\n");
exit 2
)
else ()
in
......@@ -373,10 +374,8 @@ and
Sim2chro.put_current_step_values
stdout t input new_sut_output (Env_state.local ()) options.display_local_var
Lurette_stub.sut_output_var_name_and_type_list ;
output_string stderr
output_string stdout
"\nOne more loop ? [type any char to stop, `CR' to continue]\n";
flush stderr;
flush stdout;
read_line ()
)
else (
......@@ -394,11 +393,14 @@ and
Env_state.clear_step ();
(* Decides whether to loop once more *)
if ((str = "") && (s > t))
if ((str = "" || str = " ") && (s > t))
then main_loop (t+1) s n p rif new_sut_output
else
if options.verbose then
Env_state.dump_env_state_stat ();
(
output_string stdout
"\n ==> The test completed; no property has been violated.\n";
flush stdout;
)
;;
......
......@@ -9,6 +9,7 @@
** Main author: jahier@imag.fr
*)
(** lurette toplevel loop. *)
let usage = "
......@@ -36,6 +37,7 @@ type flagT = {
mutable verbose : bool ref ;
mutable output : string ;
mutable make_opt : string ;
mutable prompt : string option ;
mutable go : bool ref ;
mutable restore : string option;
(* a flag to know whether lurette_exe needs to be (re-)build *)
......@@ -58,6 +60,7 @@ let (flag : flagT) = {
seed = None ;
verbose = ref false ;
output = "lurette.rif" ;
prompt = None ;
go = ref false ;
restore = None ;
to_build = ref true
......@@ -89,10 +92,13 @@ let rec speclist =
("<int>\t\tat each step (default=" ^
(string_of_int flag.draw_nb) ^ ").\n");
"--draw-edges", Arg.Int (fun _ -> flag.draw_mode <- Edges),
"--draw-inside", Arg.Unit (fun _ -> flag.draw_mode <- Inside),
"\t\tDraw on the edges of the convex hull of solutions.\n .";
"--draw-edges", Arg.Unit (fun _ -> flag.draw_mode <- Edges),
"\t\tDraw on the edges of the convex hull of solutions.\n .";
"--draw-verteces", Arg.Int (fun _ -> flag.draw_mode <- Verteces),
"--draw-verteces", Arg.Unit (fun _ -> flag.draw_mode <- Verteces),
"\t\tDraw among the verteces of the convex hull of solutions.\n .";
......@@ -102,7 +108,7 @@ let rec speclist =
"--make-opt", Arg.String (fun s -> flag.make_opt <- s),
("<string>\tOptions to call make with when building \n" ^
"\t\t\tlurette_exe (default=\"" ^ flag.make_opt ^ "\").\n");
"\t\t\tlurette (default=\"" ^ flag.make_opt ^ "\").\n");
"--output", Arg.String (fun s -> flag.output <- s),
("<string>\tSet the output file name (default is \"" ^
......@@ -114,7 +120,7 @@ let rec speclist =
"-go", Arg.Set flag.go, "\n";
"--restore", Arg.String (fun s -> flag.restore <- Some s),
"<string>\tFile name (without extension) of the package containing"
"<string>\tFile name of the package containing"
^ "\n\t\t\tthe temporarily files to be restored (cf the pack command).\n";
"--step", Arg.Set flag.step_by_step, "\t\tRun lurette step by step." ;
......@@ -124,11 +130,15 @@ let rec speclist =
"\t\tSet on the verbose mode.";
"-v", Arg.Set flag.verbose,"\n";
"--prompt", Arg.String (fun s -> flag.prompt <- Some s),
"\t\tReplace the default prompt.\n";
"--sim2chro", Arg.Set flag.display_sim2chro,
"\t\tCall sim2chro when lurette_exe resumes.\n";
"\t\tCall sim2chro when lurette resumes.\n";
"--no-sim2chro", Arg.Clear flag.display_sim2chro,
"\tDo not call sim2chro when lurette_exe resumes.";
"\tDo not call sim2chro when lurette resumes.";
"-ns2c", Arg.Clear flag.display_sim2chro, "\n";
"--local-var", Arg.Set flag.display_local_var,
......@@ -149,44 +159,82 @@ let rec speclist =
let (build : string -> string -> string -> bool) =
fun user_dir lurette_tmp_dir lurette_dir ->
print_string " buiding lurette_exe ...\n";
if (flag.sut = "" or flag.env = "")
then
(
print_string "
let sut =
if Filename.is_relative flag.sut
then (user_dir ^ flag.sut)
else flag.sut
in
if not (Sys.file_exists (sut ^ ".lus"))
then
(
output_string stdout ("*** File " ^ sut ^
".lus does not exist.\n");
flush stdout;
false
)
else
(
output_string stderr " building lurette ...\n";
flush stderr;
if (flag.sut = "" or flag.env = "")
then
(
print_string "***
Both the sut and the env fields should be filled
with set_sut and set_env commands respectiv