Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / src / corelang.mli @ 5fccce23

History | View | Annotate | Download (7.29 KB)

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
13 8446bf03 ploc
open Lustre_types
14 22fe1c93 ploc
15 e7cc5186 ploc
exception Error of Location.t * Error.error_kind
16 c35de73b ploc
module VSet: sig
17
  include Set.S
18
  val pp: Format.formatter -> t -> unit 
19
end with type elt = Lustre_types.var_decl 
20 e7cc5186 ploc
  
21 01c7d5e1 ploc
val dummy_type_dec: type_dec
22
val dummy_clock_dec: clock_dec
23
24 22fe1c93 ploc
val mktyp: Location.t -> type_dec_desc -> type_dec
25
val mkclock: Location.t -> clock_dec_desc -> clock_dec
26 66359a5e ploc
val mkvar_decl: Location.t -> ?orig:bool ->
27
  ident *
28
    type_dec *
29
    clock_dec *
30
    bool (* is const *) *
31
    expr option (* value *) *
32
    string option (* parent id *)
33
  -> var_decl
34 ec433d69 xthirioux
35 2863281f ploc
val dummy_var_decl: ident -> Types.type_expr -> var_decl
36
37 8446bf03 ploc
val var_decl_of_const: ?parentid:ident option -> const_desc -> var_decl
38 22fe1c93 ploc
val mkexpr: Location.t ->  expr_desc -> expr
39
val mkeq: Location.t -> ident list * expr -> eq
40
val mkassert: Location.t -> expr -> assert_t
41 ef34b4ae xthirioux
val mktop_decl: Location.t -> ident -> bool -> top_decl_desc -> top_decl
42 22fe1c93 ploc
val mkpredef_call: Location.t -> ident -> expr list -> expr
43 b08ffca7 xthirioux
val mk_new_name: (ident -> bool) -> ident -> ident
44 fc886259 xthirioux
val mk_new_node_name: node_desc -> ident -> ident
45 04a63d25 xthirioux
val mktop: top_decl_desc -> top_decl
46
47 3ca27bc7 ploc
(* constructor for machine types *)
48 8446bf03 ploc
val mkinstr: ?lustre_expr:expr -> ?lustre_eq: eq -> Machine_code_types.instr_t_desc -> Machine_code_types.instr_t
49
val get_instr_desc: Machine_code_types.instr_t -> Machine_code_types.instr_t_desc
50
val update_instr_desc: Machine_code_types.instr_t -> Machine_code_types.instr_t_desc -> Machine_code_types.instr_t
51 3ca27bc7 ploc
  
52 22fe1c93 ploc
val node_table : (ident, top_decl) Hashtbl.t
53 ef34b4ae xthirioux
val print_node_table:  Format.formatter -> unit -> unit
54 22fe1c93 ploc
val node_name: top_decl -> ident
55
val node_inputs: top_decl -> var_decl list
56
val node_from_name: ident -> top_decl
57
val is_generic_node: top_decl -> bool
58
val is_imported_node: top_decl -> bool
59
60 ef34b4ae xthirioux
val consts_table: (ident, top_decl) Hashtbl.t
61
val print_consts_table:  Format.formatter -> unit -> unit
62
val type_table: (type_dec_desc, top_decl) Hashtbl.t
63
val print_type_table:  Format.formatter -> unit -> unit
64 ec433d69 xthirioux
val is_clock_dec_type: type_dec_desc -> bool
65 22fe1c93 ploc
val get_repr_type: type_dec_desc -> type_dec_desc
66
val is_user_type: type_dec_desc -> bool
67 b1655a21 xthirioux
val coretype_equal: type_dec_desc -> type_dec_desc -> bool
68 22fe1c93 ploc
val tag_true: label
69
val tag_false: label
70 77a61575 xthirioux
val tag_default: label
71 ef34b4ae xthirioux
val tag_table: (label, top_decl) Hashtbl.t
72
val field_table: (label, top_decl) Hashtbl.t
73 22fe1c93 ploc
74
val get_enum_type_tags: type_dec_desc -> label list
75
76 6a6abd76 xthirioux
val get_struct_type_fields: type_dec_desc -> (label * type_dec_desc) list
77
78 ef34b4ae xthirioux
val consts_of_enum_type: top_decl -> top_decl list
79
80 22fe1c93 ploc
val const_of_bool: bool -> constant
81
val const_is_bool: constant -> bool
82
val const_negation: constant -> constant
83
val const_or: constant -> constant -> constant
84
val const_and: constant -> constant -> constant
85
val const_xor: constant -> constant -> constant
86
val const_impl: constant -> constant -> constant
87
88 01c7d5e1 ploc
val get_node_vars: node_desc -> var_decl list
89
val get_node_var: ident -> node_desc -> var_decl
90 333e3a25 ploc
val get_node_eqs: node_desc -> eq list * automata_desc list
91 01c7d5e1 ploc
val get_node_eq: ident -> node_desc -> eq
92 ed81df06 xthirioux
val get_node_interface: node_desc -> imported_node_desc
93 22fe1c93 ploc
94
(* val get_const: ident -> constant *)
95
96
val sort_handlers : (label * 'a) list -> (label * 'a) list
97
98
val is_eq_expr: expr -> expr -> bool
99
100 e7cc5186 ploc
(* val pp_error :  Format.formatter -> error -> unit *)
101 22fe1c93 ploc
102
(* Caution, returns an untyped, unclocked, etc, expression *)
103 b616fe7a xthirioux
val is_tuple_expr : expr -> bool
104 add75bcb xthirioux
val ident_of_expr : expr -> ident
105 fc886259 xthirioux
val expr_of_vdecl : var_decl -> expr
106 22fe1c93 ploc
val expr_of_ident : ident -> Location.t -> expr
107
val expr_list_of_expr : expr -> expr list
108
val expr_of_expr_list : Location.t -> expr list -> expr
109 54d032f5 xthirioux
val call_of_expr: expr -> (ident * expr list * expr option)
110 22fe1c93 ploc
val expr_of_dimension: Dimension.dim_expr -> expr
111
val dimension_of_expr: expr -> Dimension.dim_expr
112
val dimension_of_const: Location.t -> constant -> Dimension.dim_expr
113 3e1d20e0 ploc
val expr_to_eexpr: expr -> eexpr
114 22fe1c93 ploc
(* REMOVED, pushed in utils.ml   val new_tag : unit -> tag *)
115
116
val add_internal_funs: unit -> unit
117
118 ad4774b0 ploc
val pp_prog_type : Format.formatter -> program_t -> unit
119 22fe1c93 ploc
120 ad4774b0 ploc
val pp_prog_clock : Format.formatter -> program_t -> unit
121 22fe1c93 ploc
122 ef34b4ae xthirioux
val const_of_top: top_decl -> const_desc
123
val node_of_top: top_decl -> node_desc
124
val imported_node_of_top: top_decl -> imported_node_desc
125
val typedef_of_top: top_decl -> typedef_desc
126
val dependency_of_top: top_decl -> (bool * ident)
127
128 ad4774b0 ploc
val get_nodes : program_t -> top_decl list
129
val get_imported_nodes : program_t -> top_decl list
130
val get_consts : program_t -> top_decl list
131
val get_typedefs: program_t -> top_decl list
132
val get_dependencies : program_t -> top_decl list
133
(* val prog_unfold_consts: program_t -> program_t *)
134 c1adf235 ploc
135 ec433d69 xthirioux
val rename_static: (ident -> Dimension.dim_expr) -> type_dec_desc -> type_dec_desc
136
val rename_carrier: (ident -> ident) -> clock_dec_desc -> clock_dec_desc
137
138 a6df3992 Ploc
val get_expr_vars: expr -> Utils.ISet.t
139 333e3a25 ploc
(*val expr_replace_var: (ident -> ident) -> expr -> expr*)
140
141 22fe1c93 ploc
val eq_replace_rhs_var: (ident -> bool) -> (ident -> ident) -> eq -> eq
142
143 333e3a25 ploc
(** val rename_expr f_node f_var expr *)
144
val rename_expr : (ident -> ident) -> (ident -> ident) -> expr -> expr
145
(** val rename_eq f_node f_var eq *)
146
val rename_eq : (ident -> ident) -> (ident -> ident) -> eq -> eq
147
(** val rename_aut f_node f_var aut *)
148
val rename_aut : (ident -> ident) -> (ident -> ident) -> automata_desc -> automata_desc
149
(** rename_prog f_node f_var prog *)
150 ad4774b0 ploc
val rename_prog: (ident -> ident) -> (ident -> ident) -> (ident -> ident) -> program_t -> program_t
151 53206908 xthirioux
152 af5af1e8 ploc
val substitute_expr: var_decl list -> eq list -> expr -> expr
153 22fe1c93 ploc
154 ec433d69 xthirioux
val copy_var_decl: var_decl -> var_decl
155
val copy_const: const_desc -> const_desc
156
val copy_node: node_desc -> node_desc
157
val copy_top: top_decl -> top_decl
158
val copy_prog: top_decl list -> top_decl list
159
160 01c7d5e1 ploc
(** Annotation expression related functions *)
161
val mkeexpr: Location.t ->  expr -> eexpr
162 778c80fd ploc
val empty_contract: contract_desc
163
val mk_contract_var: ident -> bool -> type_dec option -> expr -> Location.t -> contract_desc
164
val mk_contract_guarantees: eexpr -> contract_desc
165
val mk_contract_assume: eexpr -> contract_desc
166
val mk_contract_mode: ident -> eexpr list -> eexpr list -> Location.t -> contract_desc
167
val mk_contract_import: ident -> expr list -> expr list -> Location.t -> contract_desc
168 4f26dcf5 ploc
val merge_contracts:  contract_desc -> contract_desc -> contract_desc 
169 01c7d5e1 ploc
val extend_eexpr: (quantifier_type * var_decl list) list -> eexpr -> eexpr
170 04a63d25 xthirioux
val update_expr_annot: ident -> expr -> expr_annot -> expr
171 01c7d5e1 ploc
(* val mkpredef_call: Location.t -> ident -> eexpr list -> eexpr*)
172
173 e7cc5186 ploc
val expr_contains_expr: tag -> expr -> bool
174 7065d912 ploc
175
val reset_cpt_fresh: unit -> unit
176
val mk_fresh_var: node_desc -> Location.t -> Types.type_expr ->  Clocks.clock_expr -> var_decl
177 eb9a8c3c ploc
178
val find_eq: ident list -> eq list -> eq * eq list
179 949b2e1e ploc
val get_expr_calls: top_decl list -> expr -> Utils.ISet.t
180
181
val eq_has_arrows: eq -> bool
182 778c80fd ploc
183
184 22fe1c93 ploc
(* Local Variables: *)
185
(* compile-command:"make -C .." *)
186
(* End: *)