63 open Hints_declaration
83 val gather_mem_vars_addr : Csyntax.expr -> Identifiers.identifier_set
85 val gather_mem_vars_expr : Csyntax.expr -> Identifiers.identifier_set
87 val gather_mem_vars_ls :
88 Csyntax.labeled_statements -> Identifiers.identifier_set
90 val gather_mem_vars_stmt : Csyntax.statement -> Identifiers.identifier_set
93 | Global of AST.region
97 val var_type_rect_Type4 :
98 (AST.region -> 'a1) -> (Nat.nat -> 'a1) -> 'a1 -> var_type -> 'a1
100 val var_type_rect_Type5 :
101 (AST.region -> 'a1) -> (Nat.nat -> 'a1) -> 'a1 -> var_type -> 'a1
103 val var_type_rect_Type3 :
104 (AST.region -> 'a1) -> (Nat.nat -> 'a1) -> 'a1 -> var_type -> 'a1
106 val var_type_rect_Type2 :
107 (AST.region -> 'a1) -> (Nat.nat -> 'a1) -> 'a1 -> var_type -> 'a1
109 val var_type_rect_Type1 :
110 (AST.region -> 'a1) -> (Nat.nat -> 'a1) -> 'a1 -> var_type -> 'a1
112 val var_type_rect_Type0 :
113 (AST.region -> 'a1) -> (Nat.nat -> 'a1) -> 'a1 -> var_type -> 'a1
115 val var_type_inv_rect_Type4 :
116 var_type -> (AST.region -> __ -> 'a1) -> (Nat.nat -> __ -> 'a1) -> (__ ->
119 val var_type_inv_rect_Type3 :
120 var_type -> (AST.region -> __ -> 'a1) -> (Nat.nat -> __ -> 'a1) -> (__ ->
123 val var_type_inv_rect_Type2 :
124 var_type -> (AST.region -> __ -> 'a1) -> (Nat.nat -> __ -> 'a1) -> (__ ->
127 val var_type_inv_rect_Type1 :
128 var_type -> (AST.region -> __ -> 'a1) -> (Nat.nat -> __ -> 'a1) -> (__ ->
131 val var_type_inv_rect_Type0 :
132 var_type -> (AST.region -> __ -> 'a1) -> (Nat.nat -> __ -> 'a1) -> (__ ->
135 val var_type_discr : var_type -> var_type -> __
137 val var_type_jmdiscr : var_type -> var_type -> __
140 (var_type, Csyntax.type0) Types.prod Identifiers.identifier_map
143 var_types -> PreIdentifiers.identifier -> (var_type, Csyntax.type0)
144 Types.prod Errors.res
146 val always_alloc : Csyntax.type0 -> Bool.bool
148 val characterise_vars :
149 ((AST.ident, AST.region) Types.prod, Csyntax.type0) Types.prod List.list ->
150 Csyntax.function0 -> (var_types, Nat.nat) Types.prod
176 val type_should_eq : Csyntax.type0 -> Csyntax.type0 -> 'a1 -> 'a1 Errors.res
178 val region_should_eq : AST.region -> AST.region -> 'a1 -> 'a1 Errors.res
180 val typ_should_eq : AST.typ -> AST.typ -> 'a1 -> 'a1 Errors.res
183 AST.typ -> AST.typ -> Csyntax.unary_operation ->
184 FrontEndOps.unary_operation Errors.res
187 Csyntax.type0 -> Nat.nat Types.option -> Cminor_syntax.expr ->
191 Csyntax.type0 -> Csyntax.type0 -> Csyntax.type0 -> Cminor_syntax.expr ->
192 Cminor_syntax.expr -> Cminor_syntax.expr Errors.res
195 Csyntax.type0 -> Csyntax.type0 -> Csyntax.type0 -> Cminor_syntax.expr ->
196 Cminor_syntax.expr -> Cminor_syntax.expr Errors.res
199 Csyntax.type0 -> Csyntax.type0 -> Csyntax.type0 -> Cminor_syntax.expr ->
200 Cminor_syntax.expr -> Cminor_syntax.expr Errors.res
203 Csyntax.type0 -> Csyntax.type0 -> Csyntax.type0 -> Cminor_syntax.expr ->
204 Cminor_syntax.expr -> Cminor_syntax.expr Errors.res
207 Csyntax.type0 -> Csyntax.type0 -> Csyntax.type0 -> Cminor_syntax.expr ->
208 Cminor_syntax.expr -> Cminor_syntax.expr Errors.res
211 Csyntax.type0 -> Csyntax.type0 -> Csyntax.type0 -> Cminor_syntax.expr ->
212 Cminor_syntax.expr -> Cminor_syntax.expr Errors.res
215 Csyntax.type0 -> Cminor_syntax.expr -> Cminor_syntax.expr Errors.res
218 Integers.comparison -> Csyntax.type0 -> Csyntax.type0 -> Csyntax.type0 ->
219 Cminor_syntax.expr -> Cminor_syntax.expr -> Cminor_syntax.expr Errors.res
221 val translate_misc_aop :
222 Csyntax.type0 -> Csyntax.type0 -> Csyntax.type0 -> (AST.intsize ->
223 AST.signedness -> FrontEndOps.binary_operation) -> Cminor_syntax.expr ->
224 Cminor_syntax.expr -> Cminor_syntax.expr Errors.res
226 val translate_binop :
227 Csyntax.binary_operation -> Csyntax.type0 -> Cminor_syntax.expr ->
228 Csyntax.type0 -> Cminor_syntax.expr -> Csyntax.type0 -> Cminor_syntax.expr
232 Csyntax.type0 -> Csyntax.type0 -> Cminor_syntax.expr Types.sig0 ->
233 Cminor_syntax.expr Types.sig0 Errors.res
235 val cm_zero : AST.intsize -> AST.signedness -> Cminor_syntax.expr
237 val cm_one : AST.intsize -> AST.signedness -> Cminor_syntax.expr
240 var_types -> Csyntax.expr -> Cminor_syntax.expr Types.sig0 Errors.res
243 var_types -> Csyntax.expr -> Cminor_syntax.expr Types.sig0 Errors.res
246 | IdDest of AST.ident
247 | MemDest of Cminor_syntax.expr Types.sig0
249 val destination_rect_Type4 :
250 var_types -> AST.typ -> (AST.ident -> __ -> 'a1) -> (Cminor_syntax.expr
251 Types.sig0 -> 'a1) -> destination -> 'a1
253 val destination_rect_Type5 :
254 var_types -> AST.typ -> (AST.ident -> __ -> 'a1) -> (Cminor_syntax.expr
255 Types.sig0 -> 'a1) -> destination -> 'a1
257 val destination_rect_Type3 :
258 var_types -> AST.typ -> (AST.ident -> __ -> 'a1) -> (Cminor_syntax.expr
259 Types.sig0 -> 'a1) -> destination -> 'a1
261 val destination_rect_Type2 :
262 var_types -> AST.typ -> (AST.ident -> __ -> 'a1) -> (Cminor_syntax.expr
263 Types.sig0 -> 'a1) -> destination -> 'a1
265 val destination_rect_Type1 :
266 var_types -> AST.typ -> (AST.ident -> __ -> 'a1) -> (Cminor_syntax.expr
267 Types.sig0 -> 'a1) -> destination -> 'a1
269 val destination_rect_Type0 :
270 var_types -> AST.typ -> (AST.ident -> __ -> 'a1) -> (Cminor_syntax.expr
271 Types.sig0 -> 'a1) -> destination -> 'a1
273 val destination_inv_rect_Type4 :
274 var_types -> AST.typ -> destination -> (AST.ident -> __ -> __ -> 'a1) ->
275 (Cminor_syntax.expr Types.sig0 -> __ -> 'a1) -> 'a1
277 val destination_inv_rect_Type3 :
278 var_types -> AST.typ -> destination -> (AST.ident -> __ -> __ -> 'a1) ->
279 (Cminor_syntax.expr Types.sig0 -> __ -> 'a1) -> 'a1
281 val destination_inv_rect_Type2 :
282 var_types -> AST.typ -> destination -> (AST.ident -> __ -> __ -> 'a1) ->
283 (Cminor_syntax.expr Types.sig0 -> __ -> 'a1) -> 'a1
285 val destination_inv_rect_Type1 :
286 var_types -> AST.typ -> destination -> (AST.ident -> __ -> __ -> 'a1) ->
287 (Cminor_syntax.expr Types.sig0 -> __ -> 'a1) -> 'a1
289 val destination_inv_rect_Type0 :
290 var_types -> AST.typ -> destination -> (AST.ident -> __ -> __ -> 'a1) ->
291 (Cminor_syntax.expr Types.sig0 -> __ -> 'a1) -> 'a1
293 val destination_discr :
294 var_types -> AST.typ -> destination -> destination -> __
296 val destination_jmdiscr :
297 var_types -> AST.typ -> destination -> destination -> __
299 val translate_dest : var_types -> Csyntax.expr -> destination Errors.res
301 type lenv = PreIdentifiers.identifier Identifiers.identifier_map
304 lenv -> PreIdentifiers.identifier -> PreIdentifiers.identifier Errors.res
306 type labgen = { labuniverse : Identifiers.universe;
307 label_genlist : PreIdentifiers.identifier List.list }
309 val labgen_rect_Type4 :
310 (Identifiers.universe -> PreIdentifiers.identifier List.list -> __ -> 'a1)
313 val labgen_rect_Type5 :
314 (Identifiers.universe -> PreIdentifiers.identifier List.list -> __ -> 'a1)
317 val labgen_rect_Type3 :
318 (Identifiers.universe -> PreIdentifiers.identifier List.list -> __ -> 'a1)
321 val labgen_rect_Type2 :
322 (Identifiers.universe -> PreIdentifiers.identifier List.list -> __ -> 'a1)
325 val labgen_rect_Type1 :
326 (Identifiers.universe -> PreIdentifiers.identifier List.list -> __ -> 'a1)
329 val labgen_rect_Type0 :
330 (Identifiers.universe -> PreIdentifiers.identifier List.list -> __ -> 'a1)
333 val labuniverse : labgen -> Identifiers.universe
335 val label_genlist : labgen -> PreIdentifiers.identifier List.list
337 val labgen_inv_rect_Type4 :
338 labgen -> (Identifiers.universe -> PreIdentifiers.identifier List.list ->
339 __ -> __ -> 'a1) -> 'a1
341 val labgen_inv_rect_Type3 :
342 labgen -> (Identifiers.universe -> PreIdentifiers.identifier List.list ->
343 __ -> __ -> 'a1) -> 'a1
345 val labgen_inv_rect_Type2 :
346 labgen -> (Identifiers.universe -> PreIdentifiers.identifier List.list ->
347 __ -> __ -> 'a1) -> 'a1
349 val labgen_inv_rect_Type1 :
350 labgen -> (Identifiers.universe -> PreIdentifiers.identifier List.list ->
351 __ -> __ -> 'a1) -> 'a1
353 val labgen_inv_rect_Type0 :
354 labgen -> (Identifiers.universe -> PreIdentifiers.identifier List.list ->
355 __ -> __ -> 'a1) -> 'a1
357 val labgen_discr : labgen -> labgen -> __
359 val labgen_jmdiscr : labgen -> labgen -> __
361 val generate_fresh_label :
362 labgen -> (PreIdentifiers.identifier, labgen) Types.prod Types.sig0
364 val labels_defined_switch : Csyntax.labeled_statements -> AST.ident List.list
366 val labels_defined : Csyntax.statement -> AST.ident List.list
369 ('a1 -> 'a2 Errors.res) -> 'a1 Types.option -> 'a2 Types.option Errors.res
371 val translate_expr_sigma :
372 var_types -> Csyntax.expr -> (AST.typ, Cminor_syntax.expr) Types.dPair
373 Types.sig0 Errors.res
376 var_types -> (AST.ident, Csyntax.type0) Types.prod List.list -> var_types
378 type tmpgen = { tmp_universe : Identifiers.universe;
379 tmp_env : (AST.ident, Csyntax.type0) Types.prod List.list }
381 val tmpgen_rect_Type4 :
382 var_types -> (Identifiers.universe -> (AST.ident, Csyntax.type0) Types.prod
383 List.list -> __ -> __ -> 'a1) -> tmpgen -> 'a1
385 val tmpgen_rect_Type5 :
386 var_types -> (Identifiers.universe -> (AST.ident, Csyntax.type0) Types.prod
387 List.list -> __ -> __ -> 'a1) -> tmpgen -> 'a1
389 val tmpgen_rect_Type3 :
390 var_types -> (Identifiers.universe -> (AST.ident, Csyntax.type0) Types.prod
391 List.list -> __ -> __ -> 'a1) -> tmpgen -> 'a1
393 val tmpgen_rect_Type2 :
394 var_types -> (Identifiers.universe -> (AST.ident, Csyntax.type0) Types.prod
395 List.list -> __ -> __ -> 'a1) -> tmpgen -> 'a1
397 val tmpgen_rect_Type1 :
398 var_types -> (Identifiers.universe -> (AST.ident, Csyntax.type0) Types.prod
399 List.list -> __ -> __ -> 'a1) -> tmpgen -> 'a1
401 val tmpgen_rect_Type0 :
402 var_types -> (Identifiers.universe -> (AST.ident, Csyntax.type0) Types.prod
403 List.list -> __ -> __ -> 'a1) -> tmpgen -> 'a1
405 val tmp_universe : var_types -> tmpgen -> Identifiers.universe
408 var_types -> tmpgen -> (AST.ident, Csyntax.type0) Types.prod List.list
410 val tmpgen_inv_rect_Type4 :
411 var_types -> tmpgen -> (Identifiers.universe -> (AST.ident, Csyntax.type0)
412 Types.prod List.list -> __ -> __ -> __ -> 'a1) -> 'a1
414 val tmpgen_inv_rect_Type3 :
415 var_types -> tmpgen -> (Identifiers.universe -> (AST.ident, Csyntax.type0)
416 Types.prod List.list -> __ -> __ -> __ -> 'a1) -> 'a1
418 val tmpgen_inv_rect_Type2 :
419 var_types -> tmpgen -> (Identifiers.universe -> (AST.ident, Csyntax.type0)
420 Types.prod List.list -> __ -> __ -> __ -> 'a1) -> 'a1
422 val tmpgen_inv_rect_Type1 :
423 var_types -> tmpgen -> (Identifiers.universe -> (AST.ident, Csyntax.type0)
424 Types.prod List.list -> __ -> __ -> __ -> 'a1) -> 'a1
426 val tmpgen_inv_rect_Type0 :
427 var_types -> tmpgen -> (Identifiers.universe -> (AST.ident, Csyntax.type0)
428 Types.prod List.list -> __ -> __ -> __ -> 'a1) -> 'a1
430 val tmpgen_discr : var_types -> tmpgen -> tmpgen -> __
432 val tmpgen_jmdiscr : var_types -> tmpgen -> tmpgen -> __
435 var_types -> Csyntax.type0 -> tmpgen -> (AST.ident, tmpgen) Types.prod
438 labgen -> ((PreIdentifiers.identifier, PreIdentifiers.identifier)
439 Types.prod, labgen) Types.prod
443 | ConvertTo of PreIdentifiers.identifier * PreIdentifiers.identifier
445 val convert_flag_rect_Type4 :
446 'a1 -> (PreIdentifiers.identifier -> PreIdentifiers.identifier -> 'a1) ->
449 val convert_flag_rect_Type5 :
450 'a1 -> (PreIdentifiers.identifier -> PreIdentifiers.identifier -> 'a1) ->
453 val convert_flag_rect_Type3 :
454 'a1 -> (PreIdentifiers.identifier -> PreIdentifiers.identifier -> 'a1) ->
457 val convert_flag_rect_Type2 :
458 'a1 -> (PreIdentifiers.identifier -> PreIdentifiers.identifier -> 'a1) ->
461 val convert_flag_rect_Type1 :
462 'a1 -> (PreIdentifiers.identifier -> PreIdentifiers.identifier -> 'a1) ->
465 val convert_flag_rect_Type0 :
466 'a1 -> (PreIdentifiers.identifier -> PreIdentifiers.identifier -> 'a1) ->
469 val convert_flag_inv_rect_Type4 :
470 convert_flag -> (__ -> 'a1) -> (PreIdentifiers.identifier ->
471 PreIdentifiers.identifier -> __ -> 'a1) -> 'a1
473 val convert_flag_inv_rect_Type3 :
474 convert_flag -> (__ -> 'a1) -> (PreIdentifiers.identifier ->
475 PreIdentifiers.identifier -> __ -> 'a1) -> 'a1
477 val convert_flag_inv_rect_Type2 :
478 convert_flag -> (__ -> 'a1) -> (PreIdentifiers.identifier ->
479 PreIdentifiers.identifier -> __ -> 'a1) -> 'a1
481 val convert_flag_inv_rect_Type1 :
482 convert_flag -> (__ -> 'a1) -> (PreIdentifiers.identifier ->
483 PreIdentifiers.identifier -> __ -> 'a1) -> 'a1
485 val convert_flag_inv_rect_Type0 :
486 convert_flag -> (__ -> 'a1) -> (PreIdentifiers.identifier ->
487 PreIdentifiers.identifier -> __ -> 'a1) -> 'a1
489 val convert_flag_discr : convert_flag -> convert_flag -> __
491 val convert_flag_jmdiscr : convert_flag -> convert_flag -> __
493 val labels_of_flag : convert_flag -> PreIdentifiers.identifier List.list
495 val translate_statement :
496 var_types -> tmpgen -> labgen -> lenv -> convert_flag -> AST.typ
497 Types.option -> Csyntax.statement -> ((tmpgen, labgen) Types.prod,
498 Cminor_syntax.stmt) Types.prod Types.sig0 Errors.res
500 val alloc_params_main :
501 var_types -> lenv -> Csyntax.statement -> tmpgen -> convert_flag -> AST.typ
502 Types.option -> (AST.ident, Csyntax.type0) Types.prod List.list ->
503 ((tmpgen, labgen) Types.prod, Cminor_syntax.stmt) Types.prod Types.sig0 ->
504 ((tmpgen, labgen) Types.prod, Cminor_syntax.stmt) Types.prod Types.sig0
508 var_types -> lenv -> Csyntax.statement -> tmpgen -> convert_flag -> AST.typ
509 Types.option -> (AST.ident, Csyntax.type0) Types.prod List.list ->
510 ((tmpgen, labgen) Types.prod, Cminor_syntax.stmt) Types.prod Types.sig0 ->
511 ((tmpgen, labgen) Types.prod, Cminor_syntax.stmt) Types.prod Types.sig0
515 AST.ident List.list -> labgen -> lenv -> (lenv Types.sig0, labgen)
516 Types.prod Errors.res
518 val build_label_env :
519 Csyntax.statement -> (lenv Types.sig0, labgen) Types.prod Errors.res
521 val translate_function :
522 Identifiers.universe -> ((AST.ident, AST.region) Types.prod, Csyntax.type0)
523 Types.prod List.list -> Csyntax.function0 ->
524 Cminor_syntax.internal_function Errors.res
526 val translate_fundef :
527 Identifiers.universe -> ((AST.ident, AST.region) Types.prod, Csyntax.type0)
528 Types.prod List.list -> Csyntax.clight_fundef ->
529 Cminor_syntax.internal_function AST.fundef Errors.res
531 val map_partial_All :
532 ('a1 -> __ -> 'a2 Errors.res) -> 'a1 List.list -> 'a2 List.list Errors.res
534 val clight_to_cminor :
535 Csyntax.clight_program -> Cminor_syntax.cminor_program Errors.res