Revision c518d082
Added by Xavier Thirioux almost 9 years ago
src/typing.ml | ||
---|---|---|
678 | 678 |
i.e. replacing unifiable second_order variables with the original static parameters. |
679 | 679 |
Once restored in this formulation, dimensions may be meaningfully printed. |
680 | 680 |
*) |
681 |
(* |
|
682 |
let uneval_vdecl_generics vdecl ty = |
|
683 |
if vdecl.var_dec_const |
|
684 |
then |
|
685 |
match get_static_value ty with |
|
686 |
| None -> (Format.eprintf "internal error: %a@." Types.print_ty vdecl.var_type; assert false) |
|
687 |
| Some d -> Dimension.unify d (Dimension.mkdim_ident vdecl.var_loc vdecl.var_id) |
|
688 |
|
|
689 |
let uneval_node_generics vdecls = |
|
690 |
let inst_typ_vars = ref [] in |
|
691 |
let inst_dim_vars = ref [] in |
|
692 |
let inst_ty_list = List.map (fun v -> instantiate inst_typ_vars inst_dim_vars v.var_type) vdecls in |
|
693 |
List.iter2 (fun v ty -> uneval_vdecl_generics v ty) vdecls inst_ty_list; |
|
694 |
List.iter2 (fun v ty -> generalize ty; v.var_type <- ty) vdecls inst_ty_list |
|
695 |
*) |
|
696 | 681 |
let uneval_vdecl_generics vdecl = |
697 | 682 |
if vdecl.var_dec_const |
698 | 683 |
then |
... | ... | |
717 | 702 |
let uneval_prog_generics prog = |
718 | 703 |
List.iter uneval_top_generics prog |
719 | 704 |
|
720 |
let check_env_compat header declared computed = |
|
721 |
(try |
|
722 |
uneval_prog_generics header |
|
723 |
with e -> raise e); |
|
705 |
let check_env_compat header declared computed = |
|
706 |
uneval_prog_generics header; |
|
724 | 707 |
Env.iter declared (fun k decl_type_k -> |
725 | 708 |
let computed_t = instantiate (ref []) (ref []) (Env.lookup_value computed k) in |
726 | 709 |
(*Types.print_ty Format.std_formatter decl_type_k; |
Also available in: Unified diff
- added generation of clock information in interface (.lusi) files
- added clock checking between interface and implementation files