Project

General

Profile

« Previous | Next » 

Revision 28d2185f

Added by Xavier Thirioux over 7 years ago

bug removed: with dummy automata, lustrec would generate parameterless nodes, which is forbidden in Lustre (and would raise an exception)

View differences:

src/automata.ml
139 139
let node_of_unless nused used node aut_id aut_state handler =
140 140
(*Format.eprintf "node_of_unless %s@." node.node_id;*)
141 141
  let inputs = unless_read ISet.empty handler in
142
  let var_inputs = aut_state.incoming_r :: aut_state.incoming_s :: (node_vars_of_idents node inputs) in
142
  let var_inputs = aut_state.incoming_r (*:: aut_state.incoming_s*) :: (node_vars_of_idents node inputs) in
143 143
  let var_outputs = aut_state.actual_r :: aut_state.actual_s :: [] in
144
  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
144
  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
145
(*  let init_expr = mkidentpair handler.hand_loc aut_state.incoming_r.var_id aut_state.incoming_s.var_id in *)
146
  let expr_outputs = List.fold_right add_branch handler.hand_unless init_expr in
145 147
  let eq_outputs = Eq (mkeq handler.hand_loc ([aut_state.actual_r.var_id; aut_state.actual_s.var_id], expr_outputs)) in
146 148
  let node_id = mk_new_name nused (Format.sprintf "%s__%s_unless" aut_id handler.hand_state) in
147 149
  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 187
  let writes = handler_write ISet.empty handler in
186 188
  let inputs = ISet.diff (handler_read (until_read ISet.empty handler) handler) writes in
187 189
  let frename = mk_frename used writes in
188
  let var_inputs = node_vars_of_idents node inputs in
190
  let var_inputs = aut_state.actual_r (*:: aut_state.actual_s*) :: node_vars_of_idents node inputs in
189 191
  let new_var_locals = node_vars_of_idents node writes in
190 192
  let var_outputs = List.sort IdentModule.compare (node_vars_of_idents node writes) in
191 193
  let new_var_outputs = List.map (fun vdecl -> { vdecl with var_id = frename vdecl.var_id }) var_outputs in

Also available in: Unified diff