def run_bench(automata):
    for aut in automata:
        # Make sure our three implementation behave identically
        res5 = is_empty2(aut)
        res4 = is_empty1(aut)
        res3 = spot.generic_emptiness_check(aut)
        res2 = spot.remove_fin(aut).is_empty()
        res1 = generic_emptiness2(aut)
        res = (str(res1)[0] + str(res2)[0] + str(res3)[0] + str(res4)[0] +
               str(res5)[0])
        print(res)
        assert res in ('TTTTT', 'FFFFF')
        if res == 'FFFFF':
            run3 = spot.generic_accepting_run(aut)
            assert run3.replay(spot.get_cout()) is True
Beispiel #2
0
def run_bench(automata):
    for aut in automata:
        # Make sure all our implementations behave identically
        res5 = is_empty2(aut)
        res4 = is_empty1(aut)
        spot.generic_emptiness_check_select_version("spot28")
        res3a = spot.generic_emptiness_check(aut)
        spot.generic_emptiness_check_select_version("atva19")
        res3b = spot.generic_emptiness_check(aut)
        spot.generic_emptiness_check_select_version("spot29")
        res3c = spot.generic_emptiness_check(aut)
        res2 = spot.remove_fin(aut).is_empty()
        res1 = generic_emptiness2(aut)
        res = (str(res1)[0] + str(res2)[0] + str(res3a)[0] + str(res3b)[0] +
               str(res3c)[0] + str(res4)[0] + str(res5)[0])
        print(res)
        assert res in ('TTTTTTT', 'FFFFFFF')
        if res == 'FFFFFFF':
            run3 = spot.generic_accepting_run(aut)
            assert run3.replay(spot.get_cout()) is True
Beispiel #3
0
[!0&!1&2] 1
State: 2
[0&!1&2] 7
State: 3
[!0&!1&2] 1
State: 4
[0&1&!2] 2
State: 5
[0&1&!2] 3
State: 6 {0}
[!0&1&!2] 6
State: 7 {0}
[0&!1&2] 7
--END--
""");

# In Reuben's report this first block built an incorrect deterministic
# automaton, which ultimately led to an non-empty product.  The second
# was fine.
print("use_simulation=True")
b1 = spot.tgba_determinize(b, False, True, True, True)
assert b1.num_states() == 5
b1 = spot.remove_fin(spot.dtwa_complement(b1))
assert not a.intersects(b1);

print("\nuse_simulation=False")
b2 = spot.tgba_determinize(b, False, True, False, True)
assert b2.num_states() == 5
b2 = spot.remove_fin(spot.dtwa_complement(b2))
assert not a.intersects(b1);
Beispiel #4
0
[!0&!1&2] 1
State: 2
[0&!1&2] 7
State: 3
[!0&!1&2] 1
State: 4
[0&1&!2] 2
State: 5
[0&1&!2] 3
State: 6 {0}
[!0&1&!2] 6
State: 7 {0}
[0&!1&2] 7
--END--
""")

# In Reuben's report this first block built an incorrect deterministic
# automaton, which ultimately led to an non-empty product.  The second
# was fine.
print("use_simulation=True")
b1 = spot.tgba_determinize(b, False, True, True, True)
assert b1.num_states() == 5
b1 = spot.remove_fin(spot.dualize(b1))
assert not a.intersects(b1)

print("\nuse_simulation=False")
b2 = spot.tgba_determinize(b, False, True, False, True)
assert b2.num_states() == 5
b2 = spot.remove_fin(spot.dualize(b2))
assert not a.intersects(b2)
Beispiel #5
0
assert (a.prop_universal().is_maybe())
assert (a.prop_unambiguous().is_maybe())
assert (a.is_deterministic() == True)
assert (a.is_unambiguous() == True)

a = spot.automaton("""
HOA: v1
States: 3
Start: 0
AP: 2 "a" "b"
acc-name: Buchi
Acceptance: 5 Inf(0)&Fin(4) | Inf(2)&Inf(3) | Inf(1)
--BODY--
State: 0 {3}
[t] 0
[0] 1 {1}
[!0] 2 {0 4}
State: 1 {3}
[1] 0
[0&1] 1 {0}
[!0&1] 2 {2 4}
State: 2
[!1] 0
[0&!1] 1 {0}
[!0&!1] 2 {0 4}
--END--
""")
b = spot.remove_fin(a)
size = (b.num_states(), b.num_edges())
assert size == (5, 17)
Beispiel #6
0
exp = """HOA: v1
States: 2
Start: 0
AP: 2 "a" "b"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc deterministic
--BODY--
State: 0
[!0] 0 {0}
[0] 1
State: 1
[0] 1
--END--"""

res = spot.remove_fin(aut)
assert(res.to_str('hoa') == exp)

# Test 2.
aut = spot.automaton("""
HOA: v1
States: 3
Start: 0
AP: 1 "a"
Acceptance: 2 (Inf(1) & Fin(0))
--BODY--
State: 0
[!0] 0 {0}
[0] 1
State: 1
[0] 2 {}
Beispiel #7
0
exp = """HOA: v1
States: 2
Start: 0
AP: 2 "a" "b"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc deterministic
--BODY--
State: 0
[!0] 0 {0}
[0] 1
State: 1
[0] 1
--END--"""

res = spot.remove_fin(aut)
assert(res.to_str('hoa') == exp)

# Test 2.
aut = spot.automaton("""
HOA: v1
States: 3
Start: 0
AP: 1 "a"
Acceptance: 2 (Inf(1) & Fin(0))
--BODY--
State: 0
[!0] 0 {0}
[0] 1
State: 1
[0] 2 {}