Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
cfa80ed8
Commit
cfa80ed8
authored
Sep 25, 2017
by
Alexandre Duret-Lutz
Browse files
tests: avoid some superfluous calls to remove_alternation()
* tests/python/toweak.py: Here.
parent
f45112a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/python/toweak.py
View file @
cfa80ed8
...
...
@@ -30,30 +30,20 @@ GF!b
(b & GF!b) | (!b & FGb)
b | (a & XF(b R a)) | (!a & XG(!b U !a))"""
phi1
=
phi1
.
split
(
'
\n
'
)
bdddict
=
spot
.
make_bdd_dict
()
def
equivalent
(
a
,
phi
):
negphi
=
spot
.
formula
.
Not
(
phi
)
nega
=
spot
.
dualize
(
a
)
a2
=
spot
.
translate
(
phi
,
'TGBA'
,
'SBAcc'
)
nega2
=
spot
.
translate
(
negphi
,
'TGBA'
,
'SBAcc'
)
ra
=
spot
.
remove_alternation
(
a
)
ran
=
spot
.
remove_alternation
(
nega
)
return
spot
.
product
(
spot
.
remove_alternation
(
a
),
nega2
).
is_empty
()
\
and
spot
.
product
(
spot
.
remove_alternation
(
nega
),
a2
).
is_empty
()
negphi
=
spot
.
formula
.
Not
(
phi
)
nega
=
spot
.
dualize
(
a
)
return
not
(
spot
.
translate
(
negphi
).
intersects
(
a
)
or
spot
.
translate
(
phi
).
intersects
(
nega
))
def
test_phi
(
phi
):
a
=
spot
.
translate
(
phi
,
'TGBA'
,
'SBAcc'
)
a0
=
spot
.
dualize
(
a
)
res
=
spot
.
to_weak_alternating
(
a0
)
assert
equivalent
(
res
,
spot
.
formula
.
Not
(
spot
.
formula
(
phi
)))
for
p
in
phi1
:
test_phi
(
p
)
a
=
spot
.
translate
(
phi
,
'TGBA'
,
'SBAcc'
)
res
=
spot
.
to_weak_alternating
(
spot
.
dualize
(
a
))
assert
equivalent
(
res
,
spot
.
formula
.
Not
(
spot
.
formula
(
phi
)))
for
p
in
phi1
.
split
(
'
\n
'
):
print
(
p
)
test_phi
(
p
)
phi2
=
spot
.
formula
(
"(G((F a) U b)) W a"
)
a2
=
spot
.
automaton
(
"""
...
...
@@ -99,5 +89,3 @@ State: 6
"""
)
a2
=
spot
.
to_weak_alternating
(
a2
)
assert
equivalent
(
a2
,
phi2
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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