Project

General

Profile

Revision 9b0432bc lib/lustre_types.ml

View differences:

lib/lustre_types.ml
11 11

  
12 12

  
13 13
type ident = Utils.ident
14
[@@deriving show]
14 15
type rat = Utils.rat
16
[@@deriving show]
15 17
type tag = Utils.tag
18
[@@deriving show]
16 19
type label = Utils.ident
20
[@@deriving show]
17 21

  
18 22
type type_dec =
19 23
    {ty_dec_desc: type_dec_desc;
......
30 34
  | Tydec_enum of ident list
31 35
  | Tydec_struct of (ident * type_dec_desc) list
32 36
  | Tydec_array of Dimension.dim_expr * type_dec_desc
37
[@@deriving show]
33 38

  
34 39
type typedec_desc =
35 40
    {tydec_id: ident}
41
 [@@deriving show]
36 42

  
37 43
type typedef_desc =
38 44
    {tydef_id: ident;
39 45
     tydef_desc: type_dec_desc}
46
 [@@deriving show]
40 47

  
41 48
type clock_dec =
42 49
    {ck_dec_desc: clock_dec_desc;
......
45 52
and clock_dec_desc =
46 53
  | Ckdec_any
47 54
  | Ckdec_bool of (ident * ident) list
48

  
55
 [@@deriving show]
49 56

  
50 57
type constant =
51 58
  | Const_int of int
......
55 62
  | Const_string of string (* used only for annotations *)
56 63
  | Const_modeid of string (* used only for annotations *)
57 64
  | Const_struct of (label * constant) list
65
 [@@deriving show]
58 66

  
59 67
type quantifier_type = Exists | Forall
68
[@@deriving show]
60 69

  
61 70
type var_decl =
62 71
    {var_id: ident;
......
126 135
and expr_annot =
127 136
 {annots: (string list * eexpr) list;
128 137
  annot_loc: Location.t}
138
[@@deriving show]
129 139

  
130 140
type contract_mode =
131 141
  {
......
134 144
    ensure: eexpr list;
135 145
    mode_loc: Location.t
136 146
  }
147
 [@@deriving show]
137 148

  
138 149
type contract_import =
139 150
  { import_nodeid: ident;
140 151
    inputs: expr;
141 152
    outputs: expr;
142 153
    import_loc: Location.t }
143
    
154
  [@@deriving show]  
144 155

  
145 156

  
146 157
type offset =
147 158
| Index of Dimension.dim_expr
148 159
| Field of label
160
 [@@deriving show]
149 161

  
150 162
type assert_t =
151 163
    {
152 164
      assert_expr: expr;
153 165
      assert_loc: Location.t;
154 166
    }
167
[@@deriving show]
155 168

  
156 169
type statement =
157 170
| Eq of eq
......
171 184
   hand_asserts: assert_t list;
172 185
   hand_annots: expr_annot list;
173 186
   hand_loc: Location.t}
187
[@@deriving show]
174 188

  
175 189
type contract_desc = 
176 190
  {
......
183 197
    imports: contract_import list; 
184 198
    spec_loc: Location.t;
185 199
  }
200
[@@deriving show]
186 201

  
187 202
type node_spec_t = Contract of contract_desc
188 203
                 | NodeSpec of ident
204
[@@deriving show]
189 205

  
190 206
type node_desc =
191 207
    {node_id: ident;
......
204 220
     node_annot: expr_annot list;
205 221
     node_iscontract: bool;
206 222
    }
223
[@@deriving show]
207 224

  
208 225
type imported_node_desc =
209 226
    {nodei_id: ident;
......
217 234
     nodei_prototype: string option;
218 235
     nodei_in_lib: string list;
219 236
    }
237
[@@deriving show]
220 238

  
221 239
type const_desc =
222 240
    {const_id: ident;
......
224 242
     const_value: constant;
225 243
     mutable const_type: Types.type_expr;
226 244
    }
245
[@@deriving show]
227 246

  
228 247
  
229 248
type top_decl_desc =
......
235 254
  | Include of string (* the boolean set to true denotes a local
236 255
			   lus vs a lus installed at system level *)
237 256
  | TypeDef of typedef_desc
238
    
257
[@@deriving show]   
258

  
239 259
type top_decl =
240 260
    {top_decl_desc: top_decl_desc;      (* description of the symbol *)
241 261
     top_decl_owner: Location.filename; (* the module where it is defined *)
242 262
     top_decl_itf: bool;                (* header or source file ? *)
243 263
     top_decl_loc: Location.t}          (* the location where it is defined *)
264
[@@deriving show]
244 265

  
245 266
type program_t = top_decl list
267
[@@deriving show]
246 268

  
247 269
type dep_t = {
248 270
    local: bool;
......
250 272
    content: program_t;
251 273
    is_stateful: bool
252 274
  }
275
[@@deriving show]
253 276

  
254 277
type spec_types =
255 278
  | LocalContract of contract_desc
256 279
  | TopContract of top_decl list
280
[@@deriving show]
257 281

  
258 282
let tag_true = "true"
259 283
let tag_false = "false"

Also available in: Unified diff