Project

General

Profile

« Previous | Next » 

Revision a406ac67

Added by Xavier Thirioux over 6 years ago

removed a bug in automata code generation

View differences:

src/automata.ml
190 190
  let var_outputs = List.sort IdentModule.compare (node_vars_of_idents node writes) in
191 191
  let new_var_outputs = List.map (fun vdecl -> { vdecl with var_id = frename vdecl.var_id }) var_outputs in
192 192
  let new_output_eqs = List.map2 (fun o o' -> Eq (mkeq handler.hand_loc ([o'.var_id], mkident handler.hand_loc o.var_id))) var_outputs new_var_outputs in
193
  let until_expr = List.fold_right add_branch handler.hand_until (mkidentpair handler.hand_loc aut_state.actual_r.var_id aut_state.actual_s.var_id) in
193
  let init_until = mkpair handler.hand_loc (mkconst handler.hand_loc tag_false) (mkconst handler.hand_loc handler.hand_state) in
194
  let until_expr = List.fold_right add_branch handler.hand_until init_until in
194 195
  let until_eq = Eq (mkeq handler.hand_loc ([aut_state.incoming_r.var_id; aut_state.incoming_s.var_id], until_expr)) in
195 196
  let node_id = mk_new_name nused (Format.sprintf "%s__%s_handler_until" aut_id handler.hand_state) in
196
  let var_inputs = aut_state.actual_r :: aut_state.actual_s :: var_inputs in
197 197
  let args = List.map (fun v -> mkexpr handler.hand_loc (Expr_when (mkident handler.hand_loc v.var_id, aut_state.actual_s.var_id, handler.hand_state))) var_inputs in
198 198
  let reset = Some (mkident handler.hand_loc aut_state.actual_r.var_id) in
199 199
  List.fold_left (fun res v -> ISet.add v.var_id res) ISet.empty var_outputs,

Also available in: Unified diff