Revision c02d255e
Added by Pierre-Loïc Garoche almost 9 years ago
src/typing.ml | ||
---|---|---|
287 | 287 |
ty_res |
288 | 288 |
|
289 | 289 |
(* emulates a subtyping relation between types t and (d : t), |
290 |
used during node application only *)
|
|
290 |
used during node applications and assignments *)
|
|
291 | 291 |
and type_subtyping_arg env in_main ?(sub=true) const real_arg formal_type = |
292 | 292 |
let loc = real_arg.expr_loc in |
293 | 293 |
let const = const || (Types.get_static_value formal_type <> None) in |
... | ... | |
486 | 486 |
List.fold_left (fun uvars v -> define_var v uvars) undefined_vars eq.eq_lhs in |
487 | 487 |
(* Type rhs wrt to lhs type with subtyping, i.e. a constant rhs value may be assigned |
488 | 488 |
to a (always non-constant) lhs variable *) |
489 |
type_subtyping_arg env in_main false eq.eq_rhs ty_lhs; |
|
489 |
let tins = type_list_of_type ty_lhs in |
|
490 |
let args = expr_list_of_expr eq.eq_rhs in |
|
491 |
List.iter2 (type_subtyping_arg env in_main false) args tins; |
|
490 | 492 |
undefined_vars |
491 | 493 |
|
492 | 494 |
|
... | ... | |
632 | 634 |
|
633 | 635 |
let type_top_decl env decl = |
634 | 636 |
match decl.top_decl_desc with |
635 |
| Node nd -> |
|
636 |
type_node env nd decl.top_decl_loc |
|
637 |
| Node nd -> ( |
|
638 |
try |
|
639 |
type_node env nd decl.top_decl_loc |
|
640 |
with Error (loc, err) as exc -> ( |
|
641 |
if !Options.global_inline then |
|
642 |
Format.eprintf "Type error: failing node@.%a@.@?" |
|
643 |
Printers.pp_node nd |
|
644 |
; |
|
645 |
raise exc) |
|
646 |
) |
|
637 | 647 |
| ImportedNode nd -> |
638 | 648 |
type_imported_node env nd decl.top_decl_loc |
639 | 649 |
| ImportedFun nd -> |
Also available in: Unified diff
Solved some bugs in the lustre printer
Generation of a witness with both the main node and hte inlined main node
Test script modified to check consistency of the inlining process