Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit fe9964e4 authored by POTTIER Francois's avatar POTTIER Francois

Added [disjoint_union_monoid].

parent 3efe72c3
...@@ -154,11 +154,18 @@ module Set = struct ...@@ -154,11 +154,18 @@ module Set = struct
(* Sets of atoms form a monoid under union. *) (* Sets of atoms form a monoid under union. *)
class ['z] monoid = object class ['z] union_monoid = object
method zero: 'z = empty method zero: 'z = empty
method plus: 'z -> 'z -> 'z = union method plus: 'z -> 'z -> 'z = union
end 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. *) (* These printing functions should be used for debugging purposes only. *)
let print_to_scratch xs = let print_to_scratch xs =
......
...@@ -33,9 +33,15 @@ module Set : sig ...@@ -33,9 +33,15 @@ module Set : sig
exception NonDisjointUnion of atom exception NonDisjointUnion of atom
val disjoint_union: t -> t -> t 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 constraint 'z = t
method zero: 'z method zero: 'z
method plus: 'z -> 'z -> '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