v_name -> v_ident for idents....
This commit is contained in:
parent
eca36de94b
commit
7c0c2e0415
8 changed files with 12 additions and 12 deletions
|
@ -90,7 +90,7 @@ let clear env c =
|
|||
clearec c
|
||||
|
||||
let build dec =
|
||||
let add acc { v_name = n; } = IdentSet.add n acc in
|
||||
let add acc { v_ident = n; } = IdentSet.add n acc in
|
||||
List.fold_left add IdentSet.empty dec
|
||||
|
||||
(** Main typing function *)
|
||||
|
|
|
@ -327,11 +327,11 @@ and build h dec =
|
|||
| Heptagon.Last(Some _) -> { i_kind = Last(izero); i_typ = izero }
|
||||
| Heptagon.Last(None) -> { i_kind = Last(ione); i_typ = new_var () } in
|
||||
List.fold_left
|
||||
(fun h { v_name = n; v_last = last } -> Env.add n (kind last) h) h dec
|
||||
(fun h { v_ident = n; v_last = last } -> Env.add n (kind last) h) h dec
|
||||
|
||||
let sbuild h dec =
|
||||
List.fold_left
|
||||
(fun h { v_name = n } -> Env.add n { i_kind = Var; i_typ = izero } h) h dec
|
||||
(fun h { v_ident = n } -> Env.add n { i_kind = Var; i_typ = izero } h) h dec
|
||||
|
||||
let typing_contract h contract =
|
||||
match contract with
|
||||
|
|
|
@ -842,7 +842,7 @@ and typing_block statefull h
|
|||
and build h h0 dec =
|
||||
List.fold_left
|
||||
(fun (acc_dec, acc_defined, h)
|
||||
({ v_name = n; v_type = btype; v_last = l; v_loc = loc } as v) ->
|
||||
({ v_ident = n; v_type = btype; v_last = l; v_loc = loc } as v) ->
|
||||
try
|
||||
let ty = check_type btype in
|
||||
(* update type longname with module name from check_type *)
|
||||
|
@ -897,7 +897,7 @@ let typing_contract statefull h contract =
|
|||
|
||||
let signature const_env inputs returns params constraints =
|
||||
let arg_dec_of_var_dec vd =
|
||||
mk_arg (Some (name vd.v_name)) (check_type vd.v_type)
|
||||
mk_arg (Some (name vd.v_ident)) (check_type vd.v_type)
|
||||
in
|
||||
{ node_inputs = List.map arg_dec_of_var_dec inputs;
|
||||
node_outputs = List.map arg_dec_of_var_dec returns;
|
||||
|
|
|
@ -43,7 +43,7 @@ and print_c ff = function
|
|||
fprintf ff "^";
|
||||
print_size_exp ff n
|
||||
|
||||
and print_vd ff { v_name = n; v_type = ty; v_last = last } =
|
||||
and print_vd ff { v_ident = n; v_type = ty; v_last = last } =
|
||||
fprintf ff "@[<v>";
|
||||
begin match last with Last _ -> fprintf ff "last " | _ -> () end;
|
||||
print_ident ff n;
|
||||
|
|
|
@ -102,7 +102,7 @@ and present_handler = {
|
|||
}
|
||||
|
||||
and var_dec = {
|
||||
v_name : ident; mutable v_type : ty; v_last : last; v_loc : location
|
||||
v_ident : ident; mutable v_type : ty; v_last : last; v_loc : location
|
||||
}
|
||||
|
||||
and last =
|
||||
|
@ -168,7 +168,7 @@ let mk_equation ?(statefull = true) desc =
|
|||
{ eq_desc = desc; eq_statefull = statefull; eq_loc = no_location; }
|
||||
|
||||
let mk_var_dec ?(last = Var) name ty =
|
||||
{ v_name = name; v_type = ty;
|
||||
{ v_ident = name; v_type = ty;
|
||||
v_last = last; v_loc = no_location }
|
||||
|
||||
let mk_block ?(statefull = true) defnames eqs =
|
||||
|
|
|
@ -256,7 +256,7 @@ and translate_switch_handler loc const_env env sh =
|
|||
Heptagon.w_block = fst (translate_block const_env env sh.w_block) }
|
||||
|
||||
and translate_var_dec const_env env vd =
|
||||
{ Heptagon.v_name = Rename.name vd.v_loc env vd.v_name;
|
||||
{ Heptagon.v_ident = Rename.name vd.v_loc env vd.v_name;
|
||||
Heptagon.v_type = translate_type const_env vd.v_type;
|
||||
Heptagon.v_last = translate_last env vd.v_last;
|
||||
Heptagon.v_loc = vd.v_loc }
|
||||
|
|
|
@ -14,7 +14,7 @@ open Ident
|
|||
|
||||
(* introduce a fresh equation [last_x = pre(x)] for every *)
|
||||
(* variable declared with a last *)
|
||||
let last (eq_list, env, v) { v_name = n; v_type = t; v_last = last } =
|
||||
let last (eq_list, env, v) { v_ident = n; v_type = t; v_last = last } =
|
||||
match last with
|
||||
| Var -> (eq_list, env, v)
|
||||
| Last(default) ->
|
||||
|
|
|
@ -57,7 +57,7 @@ struct
|
|||
let add l env =
|
||||
Ecomp(env,
|
||||
List.fold_left
|
||||
(fun acc { Heptagon.v_name = n } ->
|
||||
(fun acc { Heptagon.v_ident = n } ->
|
||||
IdentSet.add n acc) IdentSet.empty l)
|
||||
|
||||
(* sample e according to the clock [base on C1(x1) on ... on Cn(xn)] *)
|
||||
|
@ -113,7 +113,7 @@ let add_locals ni l_eqs s_eqs s_handlers =
|
|||
s_eqs s_handlers in
|
||||
addrec l_eqs s_eqs s_handlers
|
||||
|
||||
let translate_var { Heptagon.v_name = n; Heptagon.v_type = ty; } =
|
||||
let translate_var { Heptagon.v_ident = n; Heptagon.v_type = ty; } =
|
||||
mk_var_dec n ty
|
||||
|
||||
let translate_locals locals l =
|
||||
|
|
Loading…
Reference in a new issue