Use new minterm enumeration in split_2step
Also remove self-loop for sink and make it work for any acceptance condition. * spot/twaalgos/synthesis.cc: Here * tests/core/ltlsynt.test: Adjust tests * tests/python/split.py: Adjust tests
This commit is contained in:
parent
98ab826255
commit
a5185c2123
3 changed files with 70 additions and 66 deletions
|
|
@ -25,23 +25,23 @@ set -e
|
|||
cat >exp <<EOF
|
||||
parity 17;
|
||||
0 1 0 7,8 "INIT";
|
||||
8 3 1 1,2;
|
||||
8 3 1 2;
|
||||
2 1 0 11,12;
|
||||
12 5 1 1,4;
|
||||
4 1 0 7,15;
|
||||
15 3 1 5,6;
|
||||
6 1 0 7,15;
|
||||
7 3 1 2;
|
||||
5 1 0 16,17;
|
||||
17 4 1 5,6;
|
||||
16 4 1 2;
|
||||
1 1 0 9,10;
|
||||
10 3 1 1,5;
|
||||
9 3 1 2,3;
|
||||
12 5 1 2,3;
|
||||
3 1 0 13,14;
|
||||
14 4 1 1,4;
|
||||
13 4 1 2,3;
|
||||
11 5 1 2,3;
|
||||
14 4 1 2,3;
|
||||
13 4 1 1,4;
|
||||
4 1 0 8,15;
|
||||
15 3 1 5,6;
|
||||
6 1 0 8,15;
|
||||
5 1 0 16,17;
|
||||
17 4 1 2;
|
||||
16 4 1 5,6;
|
||||
1 1 0 9,10;
|
||||
10 3 1 2,3;
|
||||
9 3 1 1,5;
|
||||
11 5 1 1,4;
|
||||
7 3 1 1,2;
|
||||
parity 13;
|
||||
0 1 0 1,2 "INIT";
|
||||
2 1 1 3;
|
||||
|
|
@ -59,11 +59,11 @@ parity 13;
|
|||
1 1 1 6,3;
|
||||
parity 5;
|
||||
1 1 0 4,5 "INIT";
|
||||
5 5 1 0,1;
|
||||
5 4 1 1,1;
|
||||
4 5 1 0,1;
|
||||
0 1 0 2,3;
|
||||
3 3 1 0,0;
|
||||
2 5 1 1;
|
||||
4 4 1 1,1;
|
||||
3 5 1 1;
|
||||
2 3 1 0,0;
|
||||
EOF
|
||||
|
||||
: > out
|
||||
|
|
@ -221,7 +221,7 @@ cat >exp <<EOF
|
|||
translating formula done in X seconds
|
||||
automaton has 3 states and 2 colors
|
||||
split inputs and outputs done in X seconds
|
||||
automaton has 9 states
|
||||
automaton has 10 states
|
||||
determinization done
|
||||
DPA has 12 states, 4 colors
|
||||
simplification done
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ def equiv(a, b):
|
|||
return incl(a, b) and incl(b, a)
|
||||
|
||||
|
||||
def do_split(f, in_list, out_list):
|
||||
def do_split(f, out_list):
|
||||
aut = spot.translate(f)
|
||||
outputs = spot.buddy.bddtrue
|
||||
for a in out_list:
|
||||
|
|
@ -49,50 +49,42 @@ def do_split(f, in_list, out_list):
|
|||
s = spot.split_2step(aut, outputs, False, False)
|
||||
return aut, s
|
||||
|
||||
def str_diff(expect, obtained):
|
||||
res = expect == obtained
|
||||
if not res:
|
||||
print("Expected:\n", expect, "\nbut obtained:\n", obtained)
|
||||
return res
|
||||
|
||||
|
||||
|
||||
aut, s = do_split('(FG !a) <-> (GF b)', ['a'], ['b'])
|
||||
aut, s = do_split('(FG !a) <-> (GF b)', ['b'])
|
||||
assert equiv(aut, spot.unsplit_2step(s))
|
||||
|
||||
del aut
|
||||
del s
|
||||
gcollect()
|
||||
|
||||
aut, s = do_split('GFa && GFb', ['a'], ['b'])
|
||||
aut, s = do_split('GFa && GFb', ['b'])
|
||||
assert equiv(aut, spot.unsplit_2step(s))
|
||||
assert str_diff("""HOA: v1
|
||||
States: 3
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: generalized-Buchi 2
|
||||
Acceptance: 2 Inf(0)&Inf(1)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic
|
||||
spot-state-player: 0 1 1
|
||||
--BODY--
|
||||
State: 0
|
||||
[0] 1
|
||||
[!0] 2
|
||||
State: 1
|
||||
[!1] 0 {0}
|
||||
[1] 0 {0 1}
|
||||
State: 2
|
||||
[!1] 0
|
||||
[1] 0 {1}
|
||||
--END--""", s.to_str() )
|
||||
# FIXME see below
|
||||
# assert str_diff("""HOA: v1
|
||||
# States: 3
|
||||
# Start: 0
|
||||
# AP: 2 "a" "b"
|
||||
# acc-name: generalized-Buchi 2
|
||||
# Acceptance: 2 Inf(0)&Inf(1)
|
||||
# properties: trans-labels explicit-labels trans-acc complete
|
||||
# properties: deterministic
|
||||
# spot-state-player: 0 1 1
|
||||
# --BODY--
|
||||
# State: 0
|
||||
# [0] 1
|
||||
# [!0] 2
|
||||
# State: 1
|
||||
# [!1] 0 {0}
|
||||
# [1] 0 {0 1}
|
||||
# State: 2
|
||||
# [!1] 0
|
||||
# [1] 0 {1}
|
||||
# --END--""", s.to_str() )
|
||||
|
||||
del aut
|
||||
del s
|
||||
gcollect()
|
||||
|
||||
aut, s = do_split('! ((G (req -> (F ack))) && (G (go -> (F grant))))',
|
||||
['go', 'req'], ['ack'])
|
||||
aut, s = do_split('! ((G (req -> (F ack))) && (G (go -> (F grant))))', ['ack'])
|
||||
assert equiv(aut, spot.unsplit_2step(s))
|
||||
# FIXME s.to_str() is NOT the same on Debian stable and on Debian unstable
|
||||
# we should investigate this
|
||||
|
|
@ -137,5 +129,5 @@ gcollect()
|
|||
|
||||
aut, s = do_split('((G (((! g_0) || (! g_1)) && ((r_0 && (X r_1)) -> (F (g_0 \
|
||||
&& g_1))))) && (G (r_0 -> F g_0))) && (G (r_1 -> F g_1))',
|
||||
['r_0', 'r_1'], ['g_0', 'g_1'])
|
||||
['g_0', 'g_1'])
|
||||
assert equiv(aut, spot.unsplit_2step(s))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue