PROPERTYインターフェイスを定義し、少なくとも 2 つのモジュールTypeを定義して、それにFormula一致させたいと思います。
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)
次の 2 つの要件があります。
1) のコンストラクターを外部で呼び出せるようにしたいType(必要に応じてすべてのプログラム)
2) の値の一部に の値がFormula含まれています。TypesたとえばFplus (5, Type.Tint)、タイプはFormulaです。また、 の一部の関数は の一部の関数Formulaを呼び出す必要がありますType。たとえば、Formula.unionを呼び出す必要があります。Type.union
私の要件を満たすために上記の宣言を修正する方法を誰か教えてもらえますか? 必要に応じてモジュールを追加できます...