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
Software
CoPaR
Commits
e38e705e
Commit
e38e705e
authored
Nov 16, 2020
by
Hans-Peter Deifel
🐢
Browse files
Merge branch 'mini-tests-cleanup'
parents
e00fce23
8c07590f
Changes
10
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
examples/dfa
View file @
e38e705e
...
...
@@ -11,10 +11,13 @@
# \ |
# -----------'
# b
#
# where q1 is the initial state and q3 the only final state.
{f,n}xX^{a,b}
@init q1
q1: (n, {a: q2, b: q3})
q2: (n, {a: q1, b: q3})
q3: (f, {a: q1, b: q2})
examples/dfa.mini
View file @
e38e705e
{f, n}xX^{a, b}
@init s0_q1_q2
s0_q1_q2: (n, {a: s0_q1_q2, b: s1_q3})
s1_q3: (f, {a: s0_q1_q2, b: s0_q1_q2})
\ No newline at end of file
s1_q3: (f, {a: s0_q1_q2, b: s0_q1_q2})
examples/p-tree.mini
View file @
e38e705e
...
...
@@ -13,4 +13,4 @@ s09_d5: {(s10_d6, s02_b2_b3_bot)}
s10_d6: {(s11_d7, s02_b2_b3_bot)}
s11_d7: {(s12_d8, s02_b2_b3_bot)}
s12_d8: {(s13_d9, s02_b2_b3_bot)}
s13_d9: {(s05_d10, s02_b2_b3_bot)}
\ No newline at end of file
s13_d9: {(s05_d10, s02_b2_b3_bot)}
examples/ui-tests/dfa-with-init
deleted
100644 → 0
View file @
e00fce23
# A deterministic finite automaton:
#
# b
# -----------.
# / |
# .>q1 <------- |
# / | a \ v
# b| |a q3
# \ v b / ^
# `-q2 <------- |
# \ |
# -----------'
# b
{f,n}xX^{a,b}
@init q1
q1: (n, {a: q2, b: q3})
q2: (n, {a: q1, b: q3})
q3: (f, {a: q1, b: q2})
examples/ui-tests/dfa-with-init.mini
deleted
100644 → 0
View file @
e00fce23
{f, n}xX^{a, b}
@init s0_q1_q2
s0_q1_q2: (n, {a: s0_q1_q2, b: s1_q3})
s1_q3: (f, {a: s0_q1_q2, b: s0_q1_q2})
\ No newline at end of file
examples/ui-tests/init-simple.mini
View file @
e38e705e
...
...
@@ -2,4 +2,4 @@ R^X
@init s1_zero
s1_zero: {}
\ No newline at end of file
s1_zero: {}
examples/ui-tests/p-tree-init.mini
View file @
e38e705e
...
...
@@ -12,4 +12,4 @@ s09_d5: {(s10_d6, s02_b2_b3_bot)}
s10_d6: {(s11_d7, s02_b2_b3_bot)}
s11_d7: {(s12_d8, s02_b2_b3_bot)}
s12_d8: {(s13_d9, s02_b2_b3_bot)}
s13_d9: {(s05_d10, s02_b2_b3_bot)}
\ No newline at end of file
s13_d9: {(s05_d10, s02_b2_b3_bot)}
examples/ui-tests/pp-non-zippable-minimized
View file @
e38e705e
{circled, normal} x Ƥ(ƤX)
a1: (normal, {{a1}})
\ No newline at end of file
a1: (normal, {{a1}})
examples/ui-tests/tbeg-dist-paper-mvce.mini
View file @
e38e705e
R^(X)^{a, b}
s0_s1: {a: {s0_s1: 0.3}, b: {s0_s1: 0.8}}
\ No newline at end of file
s0_s1: {a: {s0_s1: 0.3}, b: {s0_s1: 0.8}}
tests/Examples.hs
View file @
e38e705e
...
...
@@ -86,34 +86,35 @@ testFileMinimize mini =
process
file
`
shouldReturn
`
minimized
where
process
::
FilePath
->
IO
String
process
file
=
P
.
readFile
P
.
defaultConfig
file
>>=
process
file
=
P
.
readFile
P
.
defaultConfig
file
>>=
\
case
Left
err
->
return
err
Right
(
f
,
(
symTab
,
enc
))
->
do
part
<-
stToIO
(
refine
(
Proxy
::
Proxy
(
Desorted
SomeFunctor
))
enc
True
)
let
let
(
enc'
,
symTab'
)
=
minimize
f
enc
symTab
part
return
(
LT
.
unpack
.
Build
.
toLazyText
$
Build
.
fromText
(
printParseableFunctor
f
)
<>
"
\n\n
"
<>
printEncoding
enc'
symTab'
(
sortTable
f
))
return
(
LT
.
unpack
.
Build
.
toLazyText
$
Build
.
fromText
(
printParseableFunctor
f
)
<>
"
\n\n
"
<>
printEncoding
enc'
symTab'
(
sortTable
f
)
<>
"
\n
"
)
testFileMinimizeIdentity
::
FilePath
->
Spec
testFileMinimizeIdentity
file
=
specify
(
"minimizeIdentity "
<>
file
)
$
do
P
.
readFile
P
.
defaultConfig
file
>>=
P
.
readFile
P
.
defaultConfig
file
>>=
\
case
Left
err
->
expectationFailure
$
"initialParse: "
<>
err
Right
(
f
,
(
symTab
,
enc
))
->
do
part
<-
stToIO
(
refine
(
Proxy
::
Proxy
(
Desorted
SomeFunctor
))
enc
True
)
let
let
(
enc'
,
symTab'
)
=
minimize
f
enc
symTab
part
coalgebra
=
Build
.
fromText
(
printParseableFunctor
f
)
coalgebra
=
Build
.
fromText
(
printParseableFunctor
f
)
<>
"
\n\n
"
<>
printEncoding
enc'
(
anonymizeSymbols
symTab'
)
(
sortTable
f
)
reparsed
=
P
.
parseCoalgebra
P
.
defaultConfig
"(minimized)"
$
LT
.
toStrict
(
Build
.
toLazyText
coalgebra
)
case
reparsed
of
Left
err
->
expectationFailure
$
"parseMinimized: "
<>
err
...
...
@@ -122,7 +123,7 @@ testFileMinimizeIdentity file =
let
(
enc'''
,
symTab'''
)
=
minimize
f'
enc''
symTab''
part'
Build
.
fromText
(
printParseableFunctor
f
)
Build
.
fromText
(
printParseableFunctor
f
)
<>
"
\n\n
"
<>
(
printEncoding
enc'''
(
anonymizeSymbols
symTab'''
)
(
sortTable
f'
))
`
shouldBe
`
<>
(
printEncoding
enc'''
(
anonymizeSymbols
symTab'''
)
(
sortTable
f'
))
`
shouldBe
`
coalgebra
Write
Preview
Supports
Markdown
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