Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / src / corelang.mli @ 66359a5e

History | View | Annotate | Download (6.33 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.error_kind
16
module VSet: Set.S
17
  
18
val dummy_type_dec: type_dec
19
val dummy_clock_dec: clock_dec
20

    
21
val mktyp: Location.t -> type_dec_desc -> type_dec
22
val mkclock: Location.t -> clock_dec_desc -> clock_dec
23
val mkvar_decl: Location.t -> ?orig:bool ->
24
  ident *
25
    type_dec *
26
    clock_dec *
27
    bool (* is const *) *
28
    expr option (* value *) *
29
    string option (* parent id *)
30
  -> var_decl
31

    
32
val var_decl_of_const: ?parentid:LustreSpec.ident option -> const_desc -> var_decl
33
val mkexpr: Location.t ->  expr_desc -> expr
34
val mkeq: Location.t -> ident list * expr -> eq
35
val mkassert: Location.t -> expr -> assert_t
36
val mktop_decl: Location.t -> ident -> bool -> top_decl_desc -> top_decl
37
val mkpredef_call: Location.t -> ident -> expr list -> expr
38
val mk_new_name: (ident -> bool) -> ident -> ident
39
val mk_new_node_name: node_desc -> ident -> ident
40
val mktop: top_decl_desc -> top_decl
41

    
42
(* constructor for machine types *)
43
val mkinstr: ?lustre_expr:expr -> ?lustre_eq: eq -> instr_t_desc -> instr_t
44
val get_instr_desc: instr_t -> instr_t_desc
45
val update_instr_desc: instr_t -> instr_t_desc -> instr_t
46
  
47
val node_table : (ident, top_decl) Hashtbl.t
48
val print_node_table:  Format.formatter -> unit -> unit
49
val node_name: top_decl -> ident
50
val node_inputs: top_decl -> var_decl list
51
val node_from_name: ident -> top_decl
52
val is_generic_node: top_decl -> bool
53
val is_imported_node: top_decl -> bool
54

    
55
val consts_table: (ident, top_decl) Hashtbl.t
56
val print_consts_table:  Format.formatter -> unit -> unit
57
val type_table: (type_dec_desc, top_decl) Hashtbl.t
58
val print_type_table:  Format.formatter -> unit -> unit
59
val is_clock_dec_type: type_dec_desc -> bool
60
val get_repr_type: type_dec_desc -> type_dec_desc
61
val is_user_type: type_dec_desc -> bool
62
val coretype_equal: type_dec_desc -> type_dec_desc -> bool
63
val tag_true: label
64
val tag_false: label
65
val tag_default: label
66
val tag_table: (label, top_decl) Hashtbl.t
67
val field_table: (label, top_decl) Hashtbl.t
68

    
69
val get_enum_type_tags: type_dec_desc -> label list
70

    
71
val get_struct_type_fields: type_dec_desc -> (label * type_dec_desc) list
72

    
73
val consts_of_enum_type: top_decl -> top_decl list
74

    
75
val const_of_bool: bool -> constant
76
val const_is_bool: constant -> bool
77
val const_negation: constant -> constant
78
val const_or: constant -> constant -> constant
79
val const_and: constant -> constant -> constant
80
val const_xor: constant -> constant -> constant
81
val const_impl: constant -> constant -> constant
82

    
83
val get_node_vars: node_desc -> var_decl list
84
val get_node_var: ident -> node_desc -> var_decl
85
val get_node_eqs: node_desc -> eq list * automata_desc list
86
val get_node_eq: ident -> node_desc -> eq
87
val get_node_interface: node_desc -> imported_node_desc
88

    
89
(* val get_const: ident -> constant *)
90

    
91
val sort_handlers : (label * 'a) list -> (label * 'a) list
92

    
93
val is_eq_expr: expr -> expr -> bool
94

    
95
(* val pp_error :  Format.formatter -> error -> unit *)
96

    
97
(* Caution, returns an untyped, unclocked, etc, expression *)
98
val is_tuple_expr : expr -> bool
99
val ident_of_expr : expr -> ident
100
val expr_of_vdecl : var_decl -> expr
101
val expr_of_ident : ident -> Location.t -> expr
102
val expr_list_of_expr : expr -> expr list
103
val expr_of_expr_list : Location.t -> expr list -> expr
104
val call_of_expr: expr -> (ident * expr list * expr option)
105
val expr_of_dimension: Dimension.dim_expr -> expr
106
val dimension_of_expr: expr -> Dimension.dim_expr
107
val dimension_of_const: Location.t -> constant -> Dimension.dim_expr
108
val expr_to_eexpr: expr -> eexpr
109
(* REMOVED, pushed in utils.ml   val new_tag : unit -> tag *)
110

    
111
val add_internal_funs: unit -> unit
112

    
113
val pp_prog_type : Format.formatter -> program -> unit
114

    
115
val pp_prog_clock : Format.formatter -> program -> unit
116

    
117
val const_of_top: top_decl -> const_desc
118
val node_of_top: top_decl -> node_desc
119
val imported_node_of_top: top_decl -> imported_node_desc
120
val typedef_of_top: top_decl -> typedef_desc
121
val dependency_of_top: top_decl -> (bool * ident)
122

    
123
val get_nodes : program -> top_decl list
124
val get_imported_nodes : program -> top_decl list
125
val get_consts : program -> top_decl list
126
val get_typedefs: program -> top_decl list
127
val get_dependencies : program -> top_decl list
128
(* val prog_unfold_consts: program -> program *)
129

    
130
val rename_static: (ident -> Dimension.dim_expr) -> type_dec_desc -> type_dec_desc
131
val rename_carrier: (ident -> ident) -> clock_dec_desc -> clock_dec_desc
132

    
133
val get_expr_vars: expr -> Utils.ISet.t
134
(*val expr_replace_var: (ident -> ident) -> expr -> expr*)
135

    
136
val eq_replace_rhs_var: (ident -> bool) -> (ident -> ident) -> eq -> eq
137

    
138
(** val rename_expr f_node f_var expr *)
139
val rename_expr : (ident -> ident) -> (ident -> ident) -> expr -> expr
140
(** val rename_eq f_node f_var eq *)
141
val rename_eq : (ident -> ident) -> (ident -> ident) -> eq -> eq
142
(** val rename_aut f_node f_var aut *)
143
val rename_aut : (ident -> ident) -> (ident -> ident) -> automata_desc -> automata_desc
144
(** rename_prog f_node f_var prog *)
145
val rename_prog: (ident -> ident) -> (ident -> ident) -> (ident -> ident) -> program -> program
146

    
147
val substitute_expr: var_decl list -> eq list -> expr -> expr
148

    
149
val copy_var_decl: var_decl -> var_decl
150
val copy_const: const_desc -> const_desc
151
val copy_node: node_desc -> node_desc
152
val copy_top: top_decl -> top_decl
153
val copy_prog: top_decl list -> top_decl list
154

    
155
(** Annotation expression related functions *)
156
val mkeexpr: Location.t ->  expr -> eexpr
157
val merge_node_annot: node_annot -> node_annot -> node_annot 
158
val extend_eexpr: (quantifier_type * var_decl list) list -> eexpr -> eexpr
159
val update_expr_annot: ident -> expr -> expr_annot -> expr
160
(* val mkpredef_call: Location.t -> ident -> eexpr list -> eexpr*)
161

    
162
val expr_contains_expr: tag -> expr -> bool
163
(* Local Variables: *)
164
(* compile-command:"make -C .." *)
165
(* End: *)