Commit fe9964e4 authored by POTTIER Francois's avatar POTTIER Francois

Added [disjoint_union_monoid].

parent 3efe72c3
......@@ -154,11 +154,18 @@ module Set = struct
(* Sets of atoms form a monoid under union. *)
class ['z] monoid = object
class ['z] union_monoid = object
method zero: 'z = empty
method plus: 'z -> 'z -> 'z = union
end
(* Sets of atoms form a monoid under disjoint union. *)
class ['z] disjoint_union_monoid = object
method zero: 'z = empty
method plus: 'z -> 'z -> 'z = disjoint_union
end
(* These printing functions should be used for debugging purposes only. *)
let print_to_scratch xs =
......
......@@ -33,9 +33,15 @@ module Set : sig
exception NonDisjointUnion of atom
val disjoint_union: t -> t -> t
(* Sets of atoms form a monoid under union. *)
(* Sets of atoms form monoids under union and disjoint union. *)
class ['z] monoid : object
class ['z] union_monoid : object
constraint 'z = t
method zero: 'z
method plus: 'z -> 'z -> 'z
end
class ['z] disjoint_union_monoid : object
constraint 'z = t
method zero: 'z
method plus: 'z -> 'z -> 'z
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment