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
f855392c
Commit
f855392c
authored
Apr 17, 2020
by
Gilles Coremans
Browse files
Remove unnecessary fromRight in test cases
parent
74576c98
Changes
2
Hide whitespace changes
Inline
Side-by-side
FCO/Test.hs
View file @
f855392c
...
...
@@ -17,7 +17,7 @@ args = Args{replay=Nothing, maxSuccess=1000, maxDiscardRatio=1000000, maxSize=10
-- The type of a term does not change when a reduction step is performed
coPreservation
::
Term
->
Property
coPreservation
te
=
(
isRight
ty
)
&&
(
not
$
CoI
.
isVal
te
)
==>
(
fromRight
undefined
ty
)
==
(
fromRight
undefined
tyStep
)
==>
ty
==
tyStep
where
ty
=
CoI
.
typeOf
te
CoI
.
Nil
tyStep
=
(
flip
CoI
.
typeOf
)
CoI
.
Nil
$
fromMaybe
undefined
$
CoI
.
stepEval
te
...
...
SystemF/Test.hs
View file @
f855392c
module
Main
where
import
Test.QuickCheck
import
Data.Either
import
Data.Maybe
...
...
@@ -14,7 +16,7 @@ args = Args{replay=Nothing, maxSuccess=1000, maxDiscardRatio=1000000, maxSize=10
-- The type of a term does not change when a reduction step is performed
preservation
::
Term
->
Property
preservation
te
=
(
isRight
ty
)
&&
(
not
$
isVal
te
)
==>
(
fromRight
undefined
ty
)
==
(
fromRight
undefined
tyStep
)
==>
ty
==
tyStep
where
ty
=
typeOf
te
Nil
tyStep
=
(
flip
typeOf
)
Nil
$
fromMaybe
undefined
$
stepEval
te
...
...
@@ -59,7 +61,7 @@ time :: IO a -> IO a
time
action
=
do
start
<-
getCPUTime
res
<-
action
end
<-
getCPUTime
printf
"
Average
Time: %0.9f s
\n
"
(((
fromIntegral
(
end
-
start
))
/
1000000000000.0
)
/
10.0
::
Double
)
printf
"Time: %0.9f s
\n
"
(((
fromIntegral
(
end
-
start
))
/
1000000000000.0
)
::
Double
)
return
res
main
=
do
let
sizes
=
[
4
..
11
]
...
...
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