Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
POTTIER Francois
alphaLib
Commits
7c82402d
Commit
7c82402d
authored
Feb 01, 2017
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update [KitBa] to use [disjoint_union_monoid].
parent
fe9964e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
12 deletions
+2
-12
src/KitBa.ml
src/KitBa.ml
+2
-12
No files found.
src/KitBa.ml
View file @
7c82402d
...
...
@@ -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
=
Atom
.
Set
.
empty
(* TEMPORARY could move this monoid to [Atom] *)
(* The monoid of sets of atoms, equipped with disjoint union, is used. *)
method
zero
=
Atom
.
Set
.
empty
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. *)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment