Commit 5393e777 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Simplify sligthly the FGen.get interface by removing a redundant argument.

parent 93a3a0ec
......@@ -51,9 +51,6 @@ type t = {
(****************************************************************************)
open LucProg
let (label_to_node : string -> string -> LucProg.node) =
fun file label ->
(* to avoid node label clashes, prepend the name of the file *)
......
......@@ -360,9 +360,10 @@ and (wt_to_cont : Var.env_in -> Env_state.t -> wt -> wt_cont -> wt_cont) =
(****************************************************************************)
(* exported *)
let (get : Var.env_in -> Env_state.t -> LucProg.ctrl_state list -> t list) =
fun input state nll ->
let (get : Var.env_in -> Env_state.t -> t list) =
fun input state ->
let _ = if debug then (print_string "XXX get\n"; flush stdout) in
let nll = state.d.ctrl_state in
List.map
(fun nl ->
let wtl = List.map (get_wt input state) nl in
......
......@@ -57,16 +57,12 @@ type t
*)
val get : Var.env_in -> Env_state.t -> LucProg.ctrl_state list -> t list
(** [get input state ctrl_state] computes the sub-automata of the
global Lucky automaton made of the accessible nodes from nodes in
[ctrl_state]. Automata obtained from inner lists of nodes (in
[ctrl_state]) are composed (sequence). During that composition,
we check that formula conjunctions are still satisfiable.
val get : Var.env_in -> Env_state.t -> t list
(** [get input state] computes the formula generator from the
current control points.
nb: get returns the list of automata made of distinct output variables
(i;e;, independent automata)
*)
nb: get returns the list of formula generator dealing with
distinct output variables. *)
(** Raised by choose_one_formula no more transitions can be taken *)
......
......@@ -183,7 +183,7 @@ let (step: lucky_process -> step_mode -> unit) =
);
match state_of_lp lp with
| Some (st0,inp,_outp) ->
let ral = FGen.get inp st0 st0.d.ctrl_state in
let ral = FGen.get inp st0 in
let (st, (outs, _locs)) =
try
Lucky.env_step
......
......@@ -131,7 +131,7 @@ let (convert_inputs_back : Var.env_in -> subst list) =
let step ?(mode = StepInside) st0 inputs =
let inp = convert_inputs inputs in
let ral = FGen.get inp st0 st0.d.ctrl_state in
let ral = FGen.get inp st0 in
let (st, (outs, locs)) =
try
Lucky.env_step
......
......@@ -104,7 +104,8 @@ type ctrl_state = node list
type lucky_arc = Arc of node * arc_info * node
type automata = {
(* XXX rename it "raw_source" *)
type automata = {
file : string;
init_node : node;
inputs : (Exp.var_tbl * LustreExp.vut);
......@@ -117,6 +118,7 @@ type automata = {
}
(** [parse_automata preprocessor file] parses [file] and returns the
[automata] it contains *)
val parse : string option -> string -> automata
......
......@@ -273,7 +273,7 @@ and
let next_state =
if options.boot then
let htbl = (Hashtbl.create 0) in
let ral = FGen.get htbl init_state init_state.d.ctrl_state in
let ral = FGen.get htbl init_state in
let (next_state, (out, loc)) =
try
Lucky.env_step options.draw_mode htbl init_state ral
......@@ -338,7 +338,7 @@ and
in
let (input, state') = Rif.read stdin state in
let input_list = Hashtbl.fold (fun vn x acc -> (vn,x)::acc) input [] in
let ral = FGen.get input state' state.d.ctrl_state in
let ral = FGen.get input state' in
let (next_state, (out, loc)) =
try
Lucky.env_step options.draw_mode input state' ral
......
......@@ -150,7 +150,7 @@ let (env_try_do : Thickness.formula_draw_nb * Thickness.numeric -> env_in ->
let (env_try : Thickness.t -> env_in -> Env_state.t -> FGen.t list ->
FGen.t list * (env_out * env_loc) list) =
fun (bt,nt) input state ral ->
(* let ral = FGen.get input state state.d.ctrl_state in *)
(* let ral = FGen.get input state in *)
if fst bt then
(* try all formula *)
let rec f ral acc =
......
......@@ -705,7 +705,7 @@ and
and
main_loop t s p k1 k2 k3 rif input state write_luciole_inputs read_luciole_outputs luciole_outputs =
let ral = FGen.get input state state.d.ctrl_state in
let ral = FGen.get input state in
let _ =
if (k1 = 0 && k2 = 0 && k3 = 0 && not(options.draw_all_vertices)) then
()
......
Markdown is supported
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