Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
POTTIER Francois
alphaLib
Commits
1a06e572
Commit
1a06e572
authored
Feb 16, 2017
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the old implementation of [fa] to attic/.
parent
c5f91537
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
43 deletions
+34
-43
src/AlphaLibMacros.cppo.ml
src/AlphaLibMacros.cppo.ml
+0
-20
src/KitFa.ml
src/KitFa.ml
+0
-23
src/attic/KitFa.ml
src/attic/KitFa.ml
+34
-0
No files found.
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