Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
POTTIER Francois
alphaLib
Commits
1a06e572
Commit
1a06e572
authored
Feb 16, 2017
by
POTTIER Francois
Browse files
Moved the old implementation of [fa] to attic/.
parent
c5f91537
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/AlphaLibMacros.cppo.ml
View file @
1a06e572
...
...
@@ -7,29 +7,9 @@
(* -------------------------------------------------------------------------- *)
(* [fa] could be defined in terms of [reduce], as follows. *)
#
define
FA_CLASS
__fa
#
define
FA_FUN
(
term
)
CONCAT
(
fa_
,
term
)
#
define
__FA
\
class
FA_CLASS
=
object
\
inherit
[
_
]
reduce
\
inherit
[
_
]
KitFa
.
reduce
\
end
\
#
define
FA
(
term
)
\
let
FA_FUN
(
term
)
t
=
\
new
FA_CLASS
#
VISIT
(
term
)
()
t
\
#
undef
__FA
#
undef
FA
(* -------------------------------------------------------------------------- *)
(* We prefer to define [fa] in terms of [iter] because we wish to eliminate
our dependency on [reduce] visitors. *)
#
define
__FA
\
class
FA_CLASS
=
object
\
inherit
[
_
]
iter
\
...
...
src/KitFa.ml
View file @
1a06e572
...
...
@@ -62,29 +62,6 @@ end
(* -------------------------------------------------------------------------- *)
(* Computing the free atoms of a term, via [reduce]. *)
(* In this style, no environment is required. *)
(* type env = unit *)
class
[
'
self
]
reduce
=
object
(
_
:
'
self
)
(* The monoid of sets of atoms is used. *)
inherit
[
_
]
Atom
.
Set
.
union_monoid
method
private
extend
_x
()
=
()
(* The atom [x] is removed from the set of free atoms when the scope of [x]
is exited. *)
method
private
restrict
=
Atom
.
Set
.
remove
method
private
visit_'fn
()
x
=
Atom
.
Set
.
singleton
x
end
(* -------------------------------------------------------------------------- *)
(* Testing whether a term has a free atom that satisfies a predicate [p]. *)
exception
Found
of
Atom
.
t
...
...
src/attic/KitFa.ml
0 → 100644
View file @
1a06e572
(* -------------------------------------------------------------------------- *)
(* Computing the free atoms of a term, via [reduce]. *)
(* In this style, no environment is required. *)
(* type env = unit *)
class
[
'
self
]
reduce
=
object
(
_
:
'
self
)
(* The monoid of sets of atoms is used. *)
inherit
[
_
]
Atom
.
Set
.
union_monoid
method
private
extend
_x
()
=
()
(* The atom [x] is removed from the set of free atoms when the scope of [x]
is exited. *)
method
private
restrict
=
Atom
.
Set
.
remove
method
private
visit_'fn
()
x
=
Atom
.
Set
.
singleton
x
end
(* -------------------------------------------------------------------------- *)
#
define
__FA
\
class
FA_CLASS
=
object
\
inherit
[
_
]
reduce
\
inherit
[
_
]
KitFa
.
reduce
\
end
\
#
define
FA
(
term
)
\
let
FA_FUN
(
term
)
t
=
\
new
FA_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