I would like to define a PROPERTY interface and at least 2 Type and Formula modules corresponding to it:
module type PROPERTY = sig type t val top : t val bot : t val to_string: t -> string val union: t -> t -> t val intersection: t -> t -> t end module Type = (struct type t = | Tbot | Tint | Tbool | Ttop ... end: PROPERTY) module Formula = (struct type t = | Fbot | Ftop | Fplus of int * Type.t ... let union = ... Type.union ... ... end: PROPERTY)
There are two requirements:
1) I would like Type constructors to be called outside (if necessary, all programs)
2) A part of some Formula values ββcontains Types values, for example Fplus (5, Type.Tint) is of type Formula ; also some Formula functions would have to call some functions from Type , for example, Formula.union must call Type.union
Can someone tell me how to amend the declaration above to fill in my requirements? If necessary, additional modules can be added ...
source share