Commit 7c82402d authored by POTTIER Francois's avatar POTTIER Francois

Update [KitBa] to use [disjoint_union_monoid].

parent fe9964e4
......@@ -4,7 +4,7 @@
[IllFormed x] is raised if the atom [x] occurs twice in a binding
position. *)
exception IllFormed of Atom.t
exception IllFormed = Atom.Set.NonDisjointUnion
type env = unit
......@@ -16,18 +16,8 @@ class ['self] reduce = object (_ : 'self)
method private visit_'fn () _x =
(* TEMPORARY could move this monoid to [Atom] *)
(* The monoid of sets of atoms, equipped with disjoint union, is used. *)
method zero =
method plus xs ys =
match Atom.Set.choose (Atom.Set.inter xs ys) with
| exception Not_found ->
(* The intersection of [xs] and [ys] is empty; good.
Compute their disjoint union. *)
Atom.Set.union xs ys
| x ->
raise (IllFormed x)
inherit [_] Atom.Set.disjoint_union_monoid
(* The atom [x] is added to the set of bound atoms when its scope is
exited. *)
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