2010-06-15 10:49:03 +02:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* Heptagon *)
|
|
|
|
(* *)
|
|
|
|
(* Author : Marc Pouzet *)
|
|
|
|
(* Organization : Demons, LRI, University of Paris-Sud, Orsay *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
(* initialization of the typing environment *)
|
|
|
|
|
|
|
|
open Names
|
2010-08-03 22:38:42 +02:00
|
|
|
open Types
|
2010-06-15 10:49:03 +02:00
|
|
|
|
|
|
|
let tglobal = []
|
|
|
|
let cglobal = []
|
|
|
|
|
2010-09-09 00:35:06 +02:00
|
|
|
let pbool = { qual = "Pervasives"; name = "bool" }
|
|
|
|
let ptrue = { qual = "Pervasives"; name = "true" }
|
|
|
|
let pfalse = { qual = "Pervasives"; name = "false" }
|
|
|
|
let por = { qual = "Pervasives"; name = "or" }
|
|
|
|
let pint = { qual = "Pervasives"; name = "int" }
|
|
|
|
let pfloat = { qual = "Pervasives"; name = "float" }
|
2010-06-15 10:49:03 +02:00
|
|
|
|
2010-09-09 00:35:06 +02:00
|
|
|
let mk_pervasives s = { qual = "Pervasives"; name = s }
|
2010-07-05 16:55:14 +02:00
|
|
|
|
2010-08-03 22:38:42 +02:00
|
|
|
let mk_static_int_op op args =
|
|
|
|
mk_static_exp ~ty:(Tid pint) (Sop (op,args))
|
|
|
|
|
|
|
|
let mk_static_int i =
|
|
|
|
mk_static_exp ~ty:(Tid pint) (Sint i)
|
|
|
|
|
|
|
|
let mk_static_bool b =
|
|
|
|
mk_static_exp ~ty:(Tid pbool) (Sbool b)
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-15 10:49:03 +02:00
|
|
|
(* build the initial environment *)
|
|
|
|
let initialize () =
|
2010-06-15 14:05:26 +02:00
|
|
|
List.iter (fun (f, ty) -> Modules.add_type f ty) tglobal;
|
2010-09-09 00:35:06 +02:00
|
|
|
List.iter (fun (f, ty) -> Modules.add_constrs f ty) cglobal
|