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
a268281b
Commit
a268281b
authored
Feb 16, 2017
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the old implementation of [ba] to attic/.
parent
1a06e572
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
40 deletions
+32
-40
src/AlphaLibMacros.cppo.ml
src/AlphaLibMacros.cppo.ml
+0
-20
src/KitBa.ml
src/KitBa.ml
+0
-20
src/attic/KitBa.ml
src/attic/KitBa.ml
+32
-0
No files found.
src/AlphaLibMacros.cppo.ml
View file @
a268281b
...
...
@@ -49,29 +49,9 @@
(* -------------------------------------------------------------------------- *)
(* [ba] could be defined in terms of [reduce], as follows. *)
#
define
BA_CLASS
__ba
#
define
BA_FUN
(
term
)
CONCAT
(
ba_
,
term
)
#
define
__BA
\
class
[
'
self
]
BA_CLASS
=
object
(
_
:
'
self
)
\
inherit
[
_
]
reduce
\
inherit
[
_
]
KitBa
.
reduce
\
end
\
#
define
BA
(
term
)
\
let
BA_FUN
(
term
)
t
=
\
new
BA_CLASS
#
VISIT
(
term
)
()
t
\
#
undef
__BA
#
undef
BA
(* -------------------------------------------------------------------------- *)
(* We prefer to define [ba] in terms of [iter] because we wish to eliminate
our dependency on [reduce] visitors. *)
#
define
__BA
\
class
[
'
self
]
BA_CLASS
=
object
(
_
:
'
self
)
\
inherit
[
_
]
iter
\
...
...
src/KitBa.ml
View file @
a268281b
(* This kit serves to compute the set of ``bound atoms'' of a term, that is,
the set of all binding name occurrences. *)
(* This computation can be performed either on top of an [iter] visitor, or
on top of a [reduce] visitor. *)
class
[
'
self
]
iter
=
object
(
_
:
'
self
)
val
mutable
accu
=
Atom
.
Set
.
empty
...
...
@@ -18,20 +15,3 @@ class ['self] iter = object (_ : 'self)
()
end
class
[
'
self
]
reduce
=
object
(
_
:
'
self
)
method
private
extend
_x
()
=
()
method
private
visit_'fn
()
_x
=
Atom
.
Set
.
empty
(* The monoid of sets of atoms is used. *)
inherit
[
_
]
Atom
.
Set
.
union_monoid
(* An atom is added to the set of bound atoms when its scope is exited. *)
method
private
restrict
x
xs
=
Atom
.
Set
.
add
x
xs
end
src/attic/KitBa.ml
0 → 100644
View file @
a268281b
(* -------------------------------------------------------------------------- *)
(* Computing the bound atoms of a term, via [reduce]. *)
class
[
'
self
]
reduce
=
object
(
_
:
'
self
)
method
private
extend
_x
()
=
()
method
private
visit_'fn
()
_x
=
Atom
.
Set
.
empty
(* The monoid of sets of atoms is used. *)
inherit
[
_
]
Atom
.
Set
.
union_monoid
(* An atom is added to the set of bound atoms when its scope is exited. *)
method
private
restrict
x
xs
=
Atom
.
Set
.
add
x
xs
end
(* -------------------------------------------------------------------------- *)
#
define
__BA
\
class
[
'
self
]
BA_CLASS
=
object
(
_
:
'
self
)
\
inherit
[
_
]
reduce
\
inherit
[
_
]
KitBa
.
reduce
\
end
\
#
define
BA
(
term
)
\
let
BA_FUN
(
term
)
t
=
\
new
BA_CLASS
#
VISIT
(
term
)
()
t
\
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