2956002f85
Added a "Contracts" pass, after inlining, taking care of the contracts of the nodes called in the body of a node. This pass "inlines" the code and assume/guarantee parts of these subcontracts. The "Sigali" pass both generates the sigali ("z3z") code and add the call to the controller (which is a node generated further by the sigali tool). Therefore this pass has been included into the mls compiler, and removed from the targets (a "z3z" dummy target has been kept for backward compatibility reasons).
53 lines
1.8 KiB
OCaml
53 lines
1.8 KiB
OCaml
(**************************************************************************)
|
|
(* *)
|
|
(* Heptagon *)
|
|
(* *)
|
|
(* Author : Marc Pouzet *)
|
|
(* Organization : Demons, LRI, University of Paris-Sud, Orsay *)
|
|
(* *)
|
|
(**************************************************************************)
|
|
(* initialization of the typing environment *)
|
|
|
|
open Names
|
|
open Types
|
|
|
|
let tglobal = []
|
|
let cglobal = []
|
|
|
|
let pbool = { qual = Pervasives; name = "bool" }
|
|
let tbool = Types.Tid pbool
|
|
let ptrue = { qual = Pervasives; name = "true" }
|
|
let pfalse = { qual = Pervasives; name = "false" }
|
|
let por = { qual = Pervasives; name = "or" }
|
|
let pand = { qual = Pervasives; name = "&" }
|
|
let pnot = { qual = Pervasives; name = "not" }
|
|
let pint = { qual = Pervasives; name = "int" }
|
|
let tint = Types.Tid pint
|
|
let pfloat = { qual = Pervasives; name = "float" }
|
|
let tfloat = Types.Tid pfloat
|
|
let pstring = { qual = Pervasives; name = "string" }
|
|
let tstring = Types.Tid pstring
|
|
|
|
let pfile = { qual = Module "Iostream"; name = "file" }
|
|
let tfile = Types.Tid pfile
|
|
|
|
let mk_pervasives s = { qual = Pervasives; name = s }
|
|
|
|
let mk_static_int_op op args =
|
|
mk_static_exp tint (Sop (op,args))
|
|
|
|
let mk_static_int i =
|
|
mk_static_exp tint (Sint i)
|
|
|
|
let mk_static_bool b =
|
|
mk_static_exp tbool (Sbool b)
|
|
|
|
let mk_static_string s =
|
|
mk_static_exp tstring (Sstring s)
|
|
|
|
|
|
(* build the initial environment *)
|
|
let initialize modul =
|
|
Modules.initialize modul;
|
|
List.iter (fun (f, ty) -> Modules.add_type f ty) tglobal;
|
|
List.iter (fun (f, ty) -> Modules.add_constrs f ty) cglobal
|