Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gilles Coremans
ASTTool
Commits
21b7f5ba
Commit
21b7f5ba
authored
Feb 22, 2020
by
Gilles Coremans
Browse files
Final stuff on SystemF
parent
fd759d06
Changes
2
Hide whitespace changes
Inline
Side-by-side
SystemF/Comble.hs
View file @
21b7f5ba
...
...
@@ -80,4 +80,4 @@ termsOfSize n = memoGo (n,0) where
go
(
s
+
1
,
m
)
=
asum
[
pure
(
Var
v
)
|
v
<-
[
0
..
m
-
1
]]
<|>
(
Lam
<$>
go
(
s
,
m
+
1
))
<|>
asum
[
pure
Apply
<*>
g
o
(
s1
,
m
)
<*>
g
o
(
s2
,
m
)
|
(
s1
,
s2
)
<-
split2
s
]
<|>
asum
[
pure
Apply
<*>
memoG
o
(
s1
,
m
)
<*>
memoG
o
(
s2
,
m
)
|
(
s1
,
s2
)
<-
split2
s
]
SystemF/check.hs
View file @
21b7f5ba
...
...
@@ -144,3 +144,7 @@ hackyextract (Left s) = undefined
testsubs
::
Comble
Type
->
[(
Type
,
Type
,
(
Type
,
Type
))]
testsubs
tys
=
filter
(
\
(
a
,
b
,
c
)
->
a
/=
b
)
[(
ty
,
(
uncurry
reconstruct
)
pair
,
pair
)
|
ty
<-
toList
$
tys
,
pair
<-
allsubstitutions
ty
]
-- Test whether generated terms are of the intended type
testgenterm
::
Type
->
Env
->
Int
->
Int
->
[(
Either
String
Type
,
Term
)]
testgenterm
ty
env
nte
nty
=
filter
(
\
(
t
,
_
)
->
Right
ty
/=
t
)
$
map
(
\
t
->
(
typeOf
t
env
,
t
))
$
toList
$
termoftype
ty
env
nte
nty
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