Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alphaLib
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
POTTIER Francois
alphaLib
Commits
f1d7e3a4
Commit
f1d7e3a4
authored
Feb 01, 2017
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Name the functor input signature.
parent
2f81fc68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
57 deletions
+59
-57
src/Toolbox.cppo.ml
src/Toolbox.cppo.ml
+1
-57
src/ToolboxInput.ml
src/ToolboxInput.ml
+57
-0
src/alphaLib.mlpack
src/alphaLib.mlpack
+1
-0
No files found.
src/Toolbox.cppo.ml
View file @
f1d7e3a4
(* This functor is applied to a type of terms, equipped with visitor classes.
It produces a toolbox of useful functions that operate on terms. *)
module
Make
(
Term
:
sig
(* Suppose there is a type of terms, which is parameterized over the
representations of free name occurrences and binding name occurrences. *)
type
(
'
fn
,
'
bn
)
term
(* Suppose the type of terms is equipped with the following visitors. *)
(* The private virtual method [visit_'fn] is used to specify what should
be done at free name occurrences. The private virtual method [extend]
is used to indicate how the environment should be extended when an
abstraction is entered. In the [reduce] visitor, the private methods
[zero] and [plus] are used to specify how summaries should be computed,
while the private method [restrict] is used to specify how a summary
should be restricted when an abstraction is exited. *)
(* Suppose the data constructor for variables is named [TVar], so that
the method [visit_TVar] is used to specify what behavior at variables
is desired. *)
class
virtual
[
'
self
]
iter
:
object
(
'
self
)
method
private
virtual
extend
:
'
bn
->
'
env
->
'
env
method
private
virtual
visit_'fn
:
'
env
->
'
fn
->
_
method
visit_term
:
'
env
->
(
'
fn
,
'
bn
)
term
->
unit
end
class
virtual
[
'
self
]
map
:
object
(
'
self
)
method
private
virtual
extend
:
'
bn1
->
'
env
->
'
bn2
*
'
env
method
private
virtual
visit_'fn
:
'
env
->
'
fn1
->
'
fn2
method
visit_term
:
'
env
->
(
'
fn1
,
'
bn1
)
term
->
(
'
fn2
,
'
bn2
)
term
method
private
visit_TVar
:
'
env
->
'
fn1
->
(
'
fn2
,
'
bn2
)
term
end
class
virtual
[
'
self
]
endo
:
object
(
'
self
)
method
private
virtual
extend
:
'
bn
->
'
env
->
'
bn
*
'
env
method
private
virtual
visit_'fn
:
'
env
->
'
fn
->
'
fn
method
visit_term
:
'
env
->
(
'
fn
,
'
bn
)
term
->
(
'
fn
,
'
bn
)
term
method
private
visit_TVar
:
'
env
->
(
'
fn
,
'
bn
)
term
->
'
fn
->
(
'
fn
,
'
bn
)
term
end
class
virtual
[
'
self
]
reduce
:
object
(
'
self
)
method
private
virtual
extend
:
'
bn
->
'
env
->
'
env
method
private
virtual
visit_'fn
:
'
env
->
'
fn
->
'
z
method
private
virtual
zero
:
'
z
method
private
virtual
plus
:
'
z
->
'
z
->
'
z
method
private
virtual
restrict
:
'
bn
->
'
z
->
'
z
method
visit_term
:
'
env
->
(
'
fn
,
'
bn
)
term
->
'
z
end
class
virtual
[
'
self
]
iter2
:
object
(
'
self
)
method
private
virtual
extend
:
'
bn1
->
'
bn2
->
'
env
->
'
env
method
private
virtual
visit_'fn
:
'
env
->
'
fn1
->
'
fn2
->
_
method
visit_term
:
'
env
->
(
'
fn1
,
'
bn1
)
term
->
(
'
fn2
,
'
bn2
)
term
->
unit
end
end
)
=
struct
module
Make
(
Term
:
ToolboxInput
.
INPUT
)
=
struct
open
Term
...
...
src/ToolboxInput.ml
0 → 100644
View file @
f1d7e3a4
module
type
INPUT
=
sig
(* Suppose there is a type of terms, which is parameterized over the
representations of free name occurrences and binding name occurrences. *)
type
(
'
fn
,
'
bn
)
term
(* Suppose the type of terms is equipped with the following visitors. *)
(* The private virtual method [visit_'fn] is used to specify what should
be done at free name occurrences. The private virtual method [extend]
is used to indicate how the environment should be extended when an
abstraction is entered. In the [reduce] visitor, the private methods
[zero] and [plus] are used to specify how summaries should be computed,
while the private method [restrict] is used to specify how a summary
should be restricted when an abstraction is exited. *)
(* Suppose the data constructor for variables is named [TVar], so that
the method [visit_TVar] is used to specify what behavior at variables
is desired. *)
class
virtual
[
'
self
]
iter
:
object
(
'
self
)
method
private
virtual
extend
:
'
bn
->
'
env
->
'
env
method
private
virtual
visit_'fn
:
'
env
->
'
fn
->
_
method
visit_term
:
'
env
->
(
'
fn
,
'
bn
)
term
->
unit
end
class
virtual
[
'
self
]
map
:
object
(
'
self
)
method
private
virtual
extend
:
'
bn1
->
'
env
->
'
bn2
*
'
env
method
private
virtual
visit_'fn
:
'
env
->
'
fn1
->
'
fn2
method
visit_term
:
'
env
->
(
'
fn1
,
'
bn1
)
term
->
(
'
fn2
,
'
bn2
)
term
method
private
visit_TVar
:
'
env
->
'
fn1
->
(
'
fn2
,
'
bn2
)
term
end
class
virtual
[
'
self
]
endo
:
object
(
'
self
)
method
private
virtual
extend
:
'
bn
->
'
env
->
'
bn
*
'
env
method
private
virtual
visit_'fn
:
'
env
->
'
fn
->
'
fn
method
visit_term
:
'
env
->
(
'
fn
,
'
bn
)
term
->
(
'
fn
,
'
bn
)
term
method
private
visit_TVar
:
'
env
->
(
'
fn
,
'
bn
)
term
->
'
fn
->
(
'
fn
,
'
bn
)
term
end
class
virtual
[
'
self
]
reduce
:
object
(
'
self
)
method
private
virtual
extend
:
'
bn
->
'
env
->
'
env
method
private
virtual
visit_'fn
:
'
env
->
'
fn
->
'
z
method
private
virtual
zero
:
'
z
method
private
virtual
plus
:
'
z
->
'
z
->
'
z
method
private
virtual
restrict
:
'
bn
->
'
z
->
'
z
method
visit_term
:
'
env
->
(
'
fn
,
'
bn
)
term
->
'
z
end
class
virtual
[
'
self
]
iter2
:
object
(
'
self
)
method
private
virtual
extend
:
'
bn1
->
'
bn2
->
'
env
->
'
env
method
private
virtual
visit_'fn
:
'
env
->
'
fn1
->
'
fn2
->
_
method
visit_term
:
'
env
->
(
'
fn1
,
'
bn1
)
term
->
(
'
fn2
,
'
bn2
)
term
->
unit
end
end
src/alphaLib.mlpack
View file @
f1d7e3a4
...
...
@@ -11,4 +11,5 @@ KitShow
KitSubst
KitToDeBruijn
KitTrivial
ToolboxInput
Toolbox
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