Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / src / corelang.mli @ b38ffff3

History | View | Annotate | Download (4.28 KB)

1
(********************************************************************)
2
(*                                                                  *)
3
(*  The LustreC compiler toolset   /  The LustreC Development Team  *)
4
(*  Copyright 2012 -    --   ONERA - CNRS - INPT                    *)
5
(*                                                                  *)
6
(*  LustreC is free software, distributed WITHOUT ANY WARRANTY      *)
7
(*  under the terms of the GNU Lesser General Public License        *)
8
(*  version 2.1.                                                    *)
9
(*                                                                  *)
10
(********************************************************************)
11

    
12

    
13
open LustreSpec
14

    
15
exception Error of Location.t * error
16

    
17
val dummy_type_dec: type_dec
18
val dummy_clock_dec: clock_dec
19

    
20
val mktyp: Location.t -> type_dec_desc -> type_dec
21
val mkclock: Location.t -> clock_dec_desc -> clock_dec
22
val mkvar_decl: Location.t -> ident * type_dec * clock_dec * bool (* is const *) -> var_decl
23
val var_decl_of_const: const_desc -> var_decl
24
val mkexpr: Location.t ->  expr_desc -> expr
25
val mkeq: Location.t -> ident list * expr -> eq
26
val mkassert: Location.t -> expr -> assert_t
27
val mktop_decl: Location.t -> top_decl_desc -> top_decl
28
val mkpredef_call: Location.t -> ident -> expr list -> expr
29
val mk_new_name: var_decl list -> ident -> ident
30

    
31

    
32
val node_table : (ident, top_decl) Hashtbl.t
33
val node_name: top_decl -> ident
34
val node_inputs: top_decl -> var_decl list
35
val node_from_name: ident -> top_decl
36
val is_generic_node: top_decl -> bool
37
val is_imported_node: top_decl -> bool
38

    
39
val consts_table: (ident, const_desc) Hashtbl.t
40
val type_table: (type_dec_desc, type_dec_desc) Hashtbl.t
41
val get_repr_type: type_dec_desc -> type_dec_desc
42
val is_user_type: type_dec_desc -> bool
43
val tag_true: label
44
val tag_false: label
45
val tag_table: (label, type_dec_desc) Hashtbl.t
46
val field_table: (label, type_dec_desc) Hashtbl.t
47

    
48
val get_enum_type_tags: type_dec_desc -> label list
49

    
50
val get_struct_type_fields: type_dec_desc -> (label * type_dec_desc) list
51

    
52
val const_of_bool: bool -> constant
53
val const_is_bool: constant -> bool
54
val const_negation: constant -> constant
55
val const_or: constant -> constant -> constant
56
val const_and: constant -> constant -> constant
57
val const_xor: constant -> constant -> constant
58
val const_impl: constant -> constant -> constant
59

    
60
val get_node_vars: node_desc -> var_decl list
61
val get_node_var: ident -> node_desc -> var_decl
62
val get_node_eq: ident -> node_desc -> eq
63

    
64
(* val get_const: ident -> constant *)
65

    
66
val sort_handlers : (label * 'a) list -> (label * 'a) list
67

    
68
val is_eq_expr: expr -> expr -> bool
69

    
70
val pp_error :  Format.formatter -> error -> unit
71

    
72
(* Caution, returns an untyped, unclocked, etc, expression *)
73
val is_tuple_expr : expr -> bool
74
val ident_of_expr : expr -> ident
75
val expr_of_ident : ident -> Location.t -> expr
76
val expr_list_of_expr : expr -> expr list
77
val expr_of_expr_list : Location.t -> expr list -> expr
78
val call_of_expr: expr -> (ident * expr list * (ident * label) option)
79
val expr_of_dimension: Dimension.dim_expr -> expr
80
val dimension_of_expr: expr -> Dimension.dim_expr
81
val dimension_of_const: Location.t -> constant -> Dimension.dim_expr
82

    
83
(* REMOVED, pushed in utils.ml   val new_tag : unit -> tag *)
84

    
85
val add_internal_funs: unit -> unit
86

    
87
val pp_prog_type : Format.formatter -> program -> unit
88

    
89
val pp_prog_clock : Format.formatter -> program -> unit
90

    
91
val get_nodes : program -> node_desc list
92
 val get_consts : program -> const_desc list 
93
(* val prog_unfold_consts: program -> program *)
94

    
95
val expr_replace_var: (ident -> ident) -> expr -> expr
96
val eq_replace_rhs_var: (ident -> bool) -> (ident -> ident) -> eq -> eq
97

    
98
(** rename_prog f_node f_var f_const prog *)
99
val rename_prog: (ident -> ident) -> (ident -> ident) -> (ident -> ident) -> program -> program
100

    
101
val update_expr_annot: expr -> LustreSpec.expr_annot -> expr
102

    
103
val substitute_expr: var_decl list -> eq list -> expr -> expr
104

    
105
(** Annotation expression related functions *)
106
val mkeexpr: Location.t ->  expr -> eexpr
107
val merge_node_annot: node_annot -> node_annot -> node_annot 
108
val extend_eexpr: (quantifier_type * var_decl list) list -> eexpr -> eexpr
109
val update_expr_annot: expr -> expr_annot -> expr
110
(* val mkpredef_call: Location.t -> ident -> eexpr list -> eexpr*)
111

    
112
(* Local Variables: *)
113
(* compile-command:"make -C .." *)
114
(* End: *)