Project

General

Profile

Download (8.42 KB) Statistics
| Branch: | Tag: | Revision:
1 a2d97a3e ploc
(********************************************************************)
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 22fe1c93 ploc
12 8446bf03 ploc
open Lustre_types
13 22fe1c93 ploc
14 ca7ff3f7 Lélio Brun
module VDeclModule : sig
15 6d1693b9 Lélio Brun
  type t
16
17 ca7ff3f7 Lélio Brun
  val compare : t -> t -> int
18
end
19
with type t = Lustre_types.var_decl
20
21
module VSet : sig
22 c35de73b ploc
  include Set.S
23 ca7ff3f7 Lélio Brun
24
  val pp : Format.formatter -> t -> unit
25
26
  val get : ident -> t -> elt
27
end
28
with type elt = Lustre_types.var_decl
29
30
val dummy_type_dec : type_dec
31
32
val dummy_clock_dec : clock_dec
33
34
val mktyp : Location.t -> type_dec_desc -> type_dec
35
36
val mkclock : Location.t -> clock_dec_desc -> clock_dec
37
38
val mkvar_decl :
39
  Location.t ->
40
  ?orig:bool ->
41
  ident
42
  * type_dec
43
  * clock_dec
44
  * bool (* is const *)
45
  * expr option
46
  (* value *)
47
  * string option
48
  (* parent id *) ->
49
  var_decl
50
51
val dummy_var_decl : ident -> Types.type_expr -> var_decl
52
53
val var_decl_of_const : ?parentid:ident option -> const_desc -> var_decl
54
55
val mkexpr : Location.t -> expr_desc -> expr
56
57
val mkeq : Location.t -> ident list * expr -> eq
58
59
val mkassert : Location.t -> expr -> assert_t
60
61
val mktop_decl : Location.t -> ident -> bool -> top_decl_desc -> top_decl
62
63
val mkpredef_call : Location.t -> ident -> expr list -> expr
64
65
val mk_new_name : (ident -> bool) -> ident -> ident
66
67
val mk_new_node_name : node_desc -> ident -> ident
68
69
val mktop : top_decl_desc -> top_decl
70 04a63d25 xthirioux
71 3ca27bc7 ploc
(* constructor for machine types *)
72 ca7ff3f7 Lélio Brun
val mkinstr :
73
  ?lustre_eq:(* ?lustre_expr:expr -> *)
74
             eq ->
75
  ?instr_spec:Machine_code_types.value_t Spec_types.formula_t list ->
76
  Machine_code_types.instr_t_desc ->
77
  Machine_code_types.instr_t
78
79
val get_instr_desc :
80
  Machine_code_types.instr_t -> Machine_code_types.instr_t_desc
81
82
val update_instr_desc :
83
  Machine_code_types.instr_t ->
84
  Machine_code_types.instr_t_desc ->
85
  Machine_code_types.instr_t
86
87 95944ba1 ploc
(*val node_table : (ident, top_decl) Hashtbl.t*)
88 ca7ff3f7 Lélio Brun
val print_node_table : Format.formatter -> unit -> unit
89
90
val node_name : top_decl -> ident
91
92
val node_inputs : top_decl -> var_decl list
93
94
val node_from_name : ident -> top_decl
95
96
val update_node : ident -> top_decl -> unit
97
98
val is_generic_node : top_decl -> bool
99
100
val is_imported_node : top_decl -> bool
101
102
val is_contract : top_decl -> bool
103
104
val is_node_contract : node_desc -> bool
105
106
val get_node_contract : node_desc -> contract_desc
107
108
val consts_table : (ident, top_decl) Hashtbl.t
109
110
val print_consts_table : Format.formatter -> unit -> unit
111
112
val type_table : (type_dec_desc, top_decl) Hashtbl.t
113
114
val print_type_table : Format.formatter -> unit -> unit
115
116
val is_clock_dec_type : type_dec_desc -> bool
117
118
val get_repr_type : type_dec_desc -> type_dec_desc
119
120
val is_user_type : type_dec_desc -> bool
121
122
val coretype_equal : type_dec_desc -> type_dec_desc -> bool
123
124
val tag_default : label
125
126
val tag_table : (label, top_decl) Hashtbl.t
127
128
val field_table : (label, top_decl) Hashtbl.t
129
130
val get_enum_type_tags : type_dec_desc -> label list
131
132
val get_struct_type_fields : type_dec_desc -> (label * type_dec_desc) list
133
134
val consts_of_enum_type : top_decl -> top_decl list
135
136
val const_of_bool : bool -> constant
137
138
val const_is_bool : constant -> bool
139
140
val const_negation : constant -> constant
141
142
val const_or : constant -> constant -> constant
143
144
val const_and : constant -> constant -> constant
145
146
val const_xor : constant -> constant -> constant
147
148
val const_impl : constant -> constant -> constant
149
150
val get_var : ident -> var_decl list -> var_decl
151
152
val get_node_vars : node_desc -> var_decl list
153
154
val get_node_var : ident -> node_desc -> var_decl
155
156
val get_node_eqs : node_desc -> eq list * automata_desc list
157
158
val get_node_eq : ident -> node_desc -> eq
159
160
val get_node_interface : node_desc -> imported_node_desc
161 22fe1c93 ploc
162
(* val get_const: ident -> constant *)
163
164
val sort_handlers : (label * 'a) list -> (label * 'a) list
165
166 ca7ff3f7 Lélio Brun
val is_eq_expr : expr -> expr -> bool
167 22fe1c93 ploc
168 ca7ff3f7 Lélio Brun
(* val pp_error : Format.formatter -> error -> unit *)
169 22fe1c93 ploc
170
(* Caution, returns an untyped, unclocked, etc, expression *)
171 b616fe7a xthirioux
val is_tuple_expr : expr -> bool
172 ca7ff3f7 Lélio Brun
173 add75bcb xthirioux
val ident_of_expr : expr -> ident
174 ca7ff3f7 Lélio Brun
175 fc886259 xthirioux
val expr_of_vdecl : var_decl -> expr
176 ca7ff3f7 Lélio Brun
177 22fe1c93 ploc
val expr_of_ident : ident -> Location.t -> expr
178 ca7ff3f7 Lélio Brun
179 22fe1c93 ploc
val expr_list_of_expr : expr -> expr list
180 ca7ff3f7 Lélio Brun
181 22fe1c93 ploc
val expr_of_expr_list : Location.t -> expr list -> expr
182
183 ca7ff3f7 Lélio Brun
val call_of_expr : expr -> ident * expr list * expr option
184
185
val expr_of_dimension : Dimension.dim_expr -> expr
186
187
val dimension_of_expr : expr -> Dimension.dim_expr
188
189
val dimension_of_const : Location.t -> constant -> Dimension.dim_expr
190
191
val expr_to_eexpr : expr -> eexpr
192
(* REMOVED, pushed in utils.ml val new_tag : unit -> tag *)
193
194
val add_internal_funs : unit -> unit
195 22fe1c93 ploc
196 ad4774b0 ploc
val pp_prog_type : Format.formatter -> program_t -> unit
197 22fe1c93 ploc
198 ad4774b0 ploc
val pp_prog_clock : Format.formatter -> program_t -> unit
199 22fe1c93 ploc
200 ca7ff3f7 Lélio Brun
val const_of_top : top_decl -> const_desc
201
202
val node_of_top : top_decl -> node_desc
203
204
val imported_node_of_top : top_decl -> imported_node_desc
205
206
val typedef_of_top : top_decl -> typedef_desc
207
208
val dependency_of_top : top_decl -> bool * ident
209 ef34b4ae xthirioux
210 ad4774b0 ploc
val get_nodes : program_t -> top_decl list
211 ca7ff3f7 Lélio Brun
212 ad4774b0 ploc
val get_imported_nodes : program_t -> top_decl list
213 ca7ff3f7 Lélio Brun
214 ad4774b0 ploc
val get_consts : program_t -> top_decl list
215 ca7ff3f7 Lélio Brun
216
val get_typedefs : program_t -> top_decl list
217
218 ad4774b0 ploc
val get_dependencies : program_t -> top_decl list
219
(* val prog_unfold_consts: program_t -> program_t *)
220 c1adf235 ploc
221 c3b0a8c9 ploc
val get_node : ident -> program_t -> node_desc
222 ca7ff3f7 Lélio Brun
(** Returns the node named ident in the provided program. Raise Not_found *)
223
224
val rename_static :
225
  (ident -> Dimension.dim_expr) -> type_dec_desc -> type_dec_desc
226 70be4acf ploc
227 ca7ff3f7 Lélio Brun
val rename_carrier : (ident -> ident) -> clock_dec_desc -> clock_dec_desc
228 ec433d69 xthirioux
229 ca7ff3f7 Lélio Brun
val get_expr_vars : expr -> Utils.ISet.t
230 333e3a25 ploc
(*val expr_replace_var: (ident -> ident) -> expr -> expr*)
231
232 ca7ff3f7 Lélio Brun
val eq_replace_rhs_var : (ident -> bool) -> (ident -> ident) -> eq -> eq
233 22fe1c93 ploc
234 333e3a25 ploc
val rename_expr : (ident -> ident) -> (ident -> ident) -> expr -> expr
235 ca7ff3f7 Lélio Brun
(** val rename_expr f_node f_var expr *)
236 ca7e8027 Lélio Brun
237 333e3a25 ploc
val rename_eq : (ident -> ident) -> (ident -> ident) -> eq -> eq
238 ca7ff3f7 Lélio Brun
(** val rename_eq f_node f_var eq *)
239 ca7e8027 Lélio Brun
240 ca7ff3f7 Lélio Brun
val rename_aut :
241
  (ident -> ident) -> (ident -> ident) -> automata_desc -> automata_desc
242 333e3a25 ploc
(** val rename_aut f_node f_var aut *)
243 ca7e8027 Lélio Brun
244 ca7ff3f7 Lélio Brun
val rename_prog :
245
  (ident -> ident) ->
246
  (ident -> ident) ->
247
  (ident -> ident) ->
248
  program_t ->
249
  program_t
250 1fd3d002 ploc
(** rename_prog f_node f_var f_const prog *)
251 53206908 xthirioux
252 ca7ff3f7 Lélio Brun
val rename_node : (ident -> ident) -> (ident -> ident) -> node_desc -> node_desc
253
254
val substitute_expr : var_decl list -> eq list -> expr -> expr
255
256
val copy_var_decl : var_decl -> var_decl
257
258
val copy_const : const_desc -> const_desc
259 22fe1c93 ploc
260 ca7ff3f7 Lélio Brun
val copy_node : node_desc -> node_desc
261 ec433d69 xthirioux
262 ca7ff3f7 Lélio Brun
val copy_top : top_decl -> top_decl
263
264
val copy_prog : top_decl list -> top_decl list
265
266
val mkeexpr : Location.t -> expr -> eexpr
267 01c7d5e1 ploc
(** Annotation expression related functions *)
268 ca7ff3f7 Lélio Brun
269
val empty_contract : contract_desc
270
271
val mk_contract_var :
272
  ident -> bool -> type_dec option -> expr -> Location.t -> contract_desc
273
274
val mk_contract_guarantees : string option -> eexpr -> contract_desc
275
276
val mk_contract_assume : string option -> eexpr -> contract_desc
277
278
val mk_contract_mode :
279
  ident -> eexpr list -> eexpr list -> Location.t -> contract_desc
280
281
val mk_contract_import : ident -> expr -> expr -> Location.t -> contract_desc
282
283
val merge_contracts : contract_desc -> contract_desc -> contract_desc
284
285
val extend_eexpr : (quantifier_type * var_decl list) list -> eexpr -> eexpr
286
287
val update_expr_annot : ident -> expr -> expr_annot -> expr
288 01c7d5e1 ploc
(* val mkpredef_call: Location.t -> ident -> eexpr list -> eexpr*)
289
290 ca7ff3f7 Lélio Brun
val expr_contains_expr : tag -> expr -> bool
291
292
val reset_cpt_fresh : unit -> unit
293 7065d912 ploc
294 ca7ff3f7 Lélio Brun
(* mk_fresh_var parentid to be registered as parent_nodeid, vars is the list of
295
   existing vars in that context *)
296
val mk_fresh_var :
297
  ident * var_decl list ->
298
  Location.t ->
299
  Types.type_expr ->
300
  Clocks.clock_expr ->
301
  var_decl
302 eb9a8c3c ploc
303 ca7ff3f7 Lélio Brun
val find_eq : ident list -> eq list -> eq * eq list
304 9a9058f4 ploc
305 ca7ff3f7 Lélio Brun
val get_expr_calls : top_decl list -> expr -> Utils.ISet.t
306 949b2e1e ploc
307 ca7e8027 Lélio Brun
(* val eq_has_arrows: eq -> bool *)
308 778c80fd ploc
309 ca7ff3f7 Lélio Brun
val push_negations : ?neg:bool -> expr -> expr
310 81229f63 ploc
311 ca7ff3f7 Lélio Brun
val add_pre_expr : ident list -> expr -> expr
312 ae08b9fc ploc
313 ca7ff3f7 Lélio Brun
val mk_eq : Location.t -> expr -> expr -> expr
314 e8f55c25 ploc
315
(* Simple transformations: eg computation over constants *)
316 ca7ff3f7 Lélio Brun
val partial_eval : expr -> expr
317 e8f55c25 ploc
318 ca7ff3f7 Lélio Brun
(* Local Variables: *)
319 22fe1c93 ploc
(* compile-command:"make -C .." *)
320
(* End: *)