From cae8d39f3d4bbc47dd07d5aff86fd840e38c5799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Tue, 14 Sep 2010 17:14:27 +0200 Subject: [PATCH] Renamed exp_ty label to ty for consistency --- compiler/main/hept2mls.ml | 20 ++++++++++---------- compiler/minils/minils.ml | 4 ++-- compiler/minils/mls_utils.ml | 2 +- compiler/minils/transformations/itfusion.ml | 8 ++++---- compiler/minils/transformations/normalize.ml | 6 +++--- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/compiler/main/hept2mls.ml b/compiler/main/hept2mls.ml index 727c723..52c48a7 100644 --- a/compiler/main/hept2mls.ml +++ b/compiler/main/hept2mls.ml @@ -177,7 +177,7 @@ let switch x ci_eqs_list = | [] | (_, []) :: _ -> [] | (_, (y, { e_ty = ty; e_loc = loc }) :: _) :: _ -> let ci_e_list, ci_eqs_list = split ci_eqs_list in - (y, mk_exp ~exp_ty:ty ~loc:loc (Emerge(x, ci_e_list))) :: + (y, mk_exp ~ty:ty ~loc:loc (Emerge(x, ci_e_list))) :: distribute ci_eqs_list in check ci_eqs_list; @@ -221,25 +221,25 @@ let rec translate env Heptagon.e_loc = loc } = match desc with | Heptagon.Econst c -> - Env.const env (mk_exp ~loc:loc ~exp_ty:ty (Econst c)) + Env.const env (mk_exp ~loc:loc ~ty:ty (Econst c)) | Heptagon.Evar x -> - Env.con env x (mk_exp ~loc:loc ~exp_ty:ty (Evar x)) + Env.con env x (mk_exp ~loc:loc ~ty:ty (Evar x)) | Heptagon.Epre(None, e) -> - mk_exp ~loc:loc ~exp_ty:ty (Efby(None, translate env e)) + mk_exp ~loc:loc ~ty:ty (Efby(None, translate env e)) | Heptagon.Epre(Some c, e) -> - mk_exp ~loc:loc ~exp_ty:ty (Efby(Some c, translate env e)) + mk_exp ~loc:loc ~ty:ty (Efby(Some c, translate env e)) | Heptagon.Efby ({ Heptagon.e_desc = Heptagon.Econst c }, e) -> - mk_exp ~loc:loc ~exp_ty:ty (Efby(Some c, translate env e)) + mk_exp ~loc:loc ~ty:ty (Efby(Some c, translate env e)) | Heptagon.Estruct f_e_list -> let f_e_list = List.map (fun (f, e) -> (f, translate env e)) f_e_list in - mk_exp ~loc:loc ~exp_ty:ty (Estruct f_e_list) + mk_exp ~loc:loc ~ty:ty (Estruct f_e_list) | Heptagon.Eapp(app, e_list, reset) -> - mk_exp ~loc:loc ~exp_ty:ty (Eapp (translate_app app, + mk_exp ~loc:loc ~ty:ty (Eapp (translate_app app, List.map (translate env) e_list, translate_reset reset)) | Heptagon.Eiterator(it, app, n, e_list, reset) -> - mk_exp ~loc:loc ~exp_ty:ty + mk_exp ~loc:loc ~ty:ty (Eiterator (translate_iterator_type it, translate_app app, n, List.map (translate env) e_list, @@ -258,7 +258,7 @@ let rec rename_pat ni locals s_eqs = function let n_copy = Idents.fresh (sourcename n) in Evarpat n_copy, (mk_var_dec n_copy ty) :: locals, - add n (mk_exp ~exp_ty:ty (Evar n_copy)) s_eqs + add n (mk_exp ~ty:ty (Evar n_copy)) s_eqs ) else Evarpat n, locals, s_eqs | Heptagon.Etuplepat(l), Tprod l_ty -> diff --git a/compiler/minils/minils.ml b/compiler/minils/minils.ml index 2e9931e..db7a314 100644 --- a/compiler/minils/minils.ml +++ b/compiler/minils/minils.ml @@ -129,8 +129,8 @@ type program = { (*Helper functions to build the AST*) -let mk_exp ?(exp_ty = invalid_type) ?(clock = Cbase) ?(loc = no_location) desc = - { e_desc = desc; e_ty = exp_ty; e_ck = clock; e_loc = loc } +let mk_exp ?(ty = invalid_type) ?(clock = Cbase) ?(loc = no_location) desc = + { e_desc = desc; e_ty = ty; e_ck = clock; e_loc = loc } let mk_var_dec ?(loc = no_location) ?(clock = Cbase) ident ty = { v_ident = ident; v_type = ty; v_clock = clock; v_loc = loc } diff --git a/compiler/minils/mls_utils.ml b/compiler/minils/mls_utils.ml index c9c6859..4375260 100644 --- a/compiler/minils/mls_utils.ml +++ b/compiler/minils/mls_utils.ml @@ -58,7 +58,7 @@ let is_op = function let exp_list_of_static_exp_list se_list = let mk_one_const se = - Minils.mk_exp ~exp_ty:se.se_ty (Minils.Econst se) + Minils.mk_exp ~ty:se.se_ty (Minils.Econst se) in List.map mk_one_const se_list diff --git a/compiler/minils/transformations/itfusion.ml b/compiler/minils/transformations/itfusion.ml index 31b6e38..2646ea8 100644 --- a/compiler/minils/transformations/itfusion.ml +++ b/compiler/minils/transformations/itfusion.ml @@ -39,9 +39,9 @@ match l with | _ -> Etuplepat (List.map (fun vd -> Evarpat vd.v_ident) l) let tuple_of_vd_list l = - let el = List.map (fun vd -> mk_exp ~exp_ty:vd.v_type (Evar vd.v_ident)) l in + let el = List.map (fun vd -> mk_exp ~ty:vd.v_type (Evar vd.v_ident)) l in let ty = Types.prod (List.map (fun vd -> vd.v_type) l) in - mk_exp ~exp_ty:ty (Eapp (mk_app Etuple, el, None)) + mk_exp ~ty:ty (Eapp (mk_app Etuple, el, None)) let vd_of_arg ad = let n = match ad.a_name with None -> "_v" | Some n -> n in @@ -68,10 +68,10 @@ let get_node_inp_outp app = match app.a_op with added equations. *) let mk_call app acc_eq_list = let new_inp, new_outp = get_node_inp_outp app in - let args = List.map (fun vd -> mk_exp ~exp_ty:vd.v_type + let args = List.map (fun vd -> mk_exp ~ty:vd.v_type (Evar vd.v_ident)) new_inp in let out_ty = Types.prod (List.map (fun vd -> vd.v_type) new_outp) in - let e = mk_exp ~exp_ty:out_ty (Eapp (app, args, None)) in + let e = mk_exp ~ty:out_ty (Eapp (app, args, None)) in match List.length new_outp with | 1 -> new_inp, e, acc_eq_list | _ -> diff --git a/compiler/minils/transformations/normalize.ml b/compiler/minils/transformations/normalize.ml index 3c28ec8..cbd4f53 100644 --- a/compiler/minils/transformations/normalize.ml +++ b/compiler/minils/transformations/normalize.ml @@ -36,7 +36,7 @@ let equation (d_list, eq_list) e = let pat_list = List.map (fun n -> Evarpat n) var_list in let eq_list = (mk_equation (Etuplepat pat_list) e) :: eq_list in let e_list = List.map2 - (fun n ty -> mk_exp ~exp_ty:ty (Evar n)) var_list ty_list in + (fun n ty -> mk_exp ~ty:ty (Evar n)) var_list ty_list in let e = Eapp(mk_app Etuple, e_list, None) in (d_list, eq_list), e | _ -> @@ -287,9 +287,9 @@ and translate_list kind context e_list = and fby kind context e v e1 = let mk_fby c e = - mk_exp ~exp_ty:e.e_ty ~loc:e.e_loc (Efby(Some c, e)) in + mk_exp ~ty:e.e_ty ~loc:e.e_loc (Efby(Some c, e)) in let mk_pre e = - mk_exp ~exp_ty:e.e_ty ~loc:e.e_loc (Efby(None, e)) in + mk_exp ~ty:e.e_ty ~loc:e.e_loc (Efby(None, e)) in match e1.e_desc, v with | Eapp({ a_op = Etuple } as app, e_list, r), Some { se_desc = Stuple se_list } ->