Skip to content
Snippets Groups Projects
Commit 28d2185f authored by THIRIOUX Xavier's avatar THIRIOUX Xavier
Browse files

bug removed: with dummy automata, lustrec would generate parameterless nodes,...

 bug removed: with dummy automata, lustrec would generate parameterless nodes, which is forbidden in Lustre (and would raise an exception)
parent a406ac67
No related branches found
No related tags found
No related merge requests found
......@@ -139,9 +139,11 @@ let vars_of_aut_state aut_state =
let node_of_unless nused used node aut_id aut_state handler =
(*Format.eprintf "node_of_unless %s@." node.node_id;*)
let inputs = unless_read ISet.empty handler in
let var_inputs = aut_state.incoming_r :: aut_state.incoming_s :: (node_vars_of_idents node inputs) in
let var_inputs = aut_state.incoming_r (*:: aut_state.incoming_s*) :: (node_vars_of_idents node inputs) in
let var_outputs = aut_state.actual_r :: aut_state.actual_s :: [] in
let expr_outputs = List.fold_right add_branch handler.hand_unless (mkidentpair handler.hand_loc aut_state.incoming_r.var_id aut_state.incoming_s.var_id) in
let init_expr = mkpair handler.hand_loc (mkident handler.hand_loc aut_state.incoming_r.var_id) (mkconst handler.hand_loc handler.hand_state) in
(* let init_expr = mkidentpair handler.hand_loc aut_state.incoming_r.var_id aut_state.incoming_s.var_id in *)
let expr_outputs = List.fold_right add_branch handler.hand_unless init_expr in
let eq_outputs = Eq (mkeq handler.hand_loc ([aut_state.actual_r.var_id; aut_state.actual_s.var_id], expr_outputs)) in
let node_id = mk_new_name nused (Format.sprintf "%s__%s_unless" aut_id handler.hand_state) in
let args = List.map (fun v -> mkexpr handler.hand_loc (Expr_when (mkident handler.hand_loc v.var_id, aut_state.incoming_s.var_id, handler.hand_state))) var_inputs in
......@@ -185,7 +187,7 @@ let node_of_assign_until nused used node aut_id aut_state handler =
let writes = handler_write ISet.empty handler in
let inputs = ISet.diff (handler_read (until_read ISet.empty handler) handler) writes in
let frename = mk_frename used writes in
let var_inputs = node_vars_of_idents node inputs in
let var_inputs = aut_state.actual_r (*:: aut_state.actual_s*) :: node_vars_of_idents node inputs in
let new_var_locals = node_vars_of_idents node writes in
let var_outputs = List.sort IdentModule.compare (node_vars_of_idents node writes) in
let new_var_outputs = List.map (fun vdecl -> { vdecl with var_id = frename vdecl.var_id }) var_outputs in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment