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
f2afe36f
Commit
f2afe36f
authored
Feb 03, 2017
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A better [Main].
parent
84ccbc74
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
demos/system-F-type/Main.ml
demos/system-F-type/Main.ml
+17
-11
No files found.
demos/system-F-type/Main.ml
View file @
f2afe36f
...
...
@@ -3,17 +3,23 @@ open AlphaLib
open
F
open
FTypeChecker
let
identity
:
raw_term
=
TeTyAbs
(
"A"
,
TeAbs
(
"x"
,
TyVar
"A"
,
TeVar
"x"
))
let
check
(
t
:
raw_term
)
=
printf
"Raw term:
\n
%a
\n
"
Print
.
term
t
;
let
t
:
nominal_term
=
import_term
KitImport
.
empty
t
in
printf
"Imported (and reexported) term:
\n
%a
\n
"
Print
.
term
(
export_term
KitExport
.
empty
t
);
let
ty
:
nominal_typ
=
typeof
t
in
printf
"Inferred type:
\n
%a
\n
"
Print
.
typ
(
export_typ
KitExport
.
empty
ty
)
let
identity
:
nominal_term
=
import_term
KitImport
.
empty
identity
let
ty
:
nominal_typ
=
typeof
identity
let
ty
:
raw_typ
=
export_typ
KitExport
.
empty
ty
let
terms
:
raw_term
list
=
[
TeTyAbs
(
"A"
,
TeAbs
(
"x"
,
TyVar
"A"
,
TeVar
"x"
));
]
let
()
=
printf
"Success.
\n
This term has type %a.
\n
%!"
(
PPrintAux
.
adapt
Print
.
typ
)
ty
List
.
iter
check
terms
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