These examples are tests for scc_info on alternating automata.


In [1]:
from IPython.display import display
import spot
spot.setup(show_default='.bas')

In [2]:
spot.automaton('''
HOA: v1
States: 2
Start: 0&1
AP: 2 "a" "b"
acc-name: Buchi
Acceptance: 1 Inf(0)
--BODY--
State: 0
[0] 0
[!0] 1
State: 1
[1] 1 {0}
--END--
''')


Out[2]:
G Inf( ) [Büchi] cluster_0 cluster_1 -1 I->-1 1 1 -1->1 0 0 -1->0 1->1 b 0->1 !a 0->0 a

universal edges are handled as if they were many distinct existencial edges from the point of view of scc_info, so the acceptance / rejection status is not always meaningful.


In [3]:
spot.automaton('''
HOA: v1
States: 2
Start: 0&1
AP: 2 "a" "b"
Acceptance: 1 Fin(0)
--BODY--
State: 0
[0] 0&1 {0}
State: 1
[1] 1
--END--
''')


Out[3]:
G Fin( ) [co-Büchi] cluster_0 cluster_1 -1 I->-1 1 1 -1->1 0 0 -1->0 1->1 b 0->-1 a

In [4]:
spot.automaton('''
HOA: v1
States: 2
Start: 0&1
AP: 2 "a" "b"
Acceptance: 1 Fin(0)
--BODY--
State: 0
[0] 0 {0}
[!0] 1
State: 1
[1] 1&0
--END--
''')


Out[4]:
G Fin( ) [co-Büchi] cluster_0 -1 I->-1 0 0 -1->0 1 1 -1->1 0->0 a 0->1 !a 1->-1 b

In [5]:
spot.automaton('''
HOA: v1
States: 2
Start: 0
AP: 2 "a" "b"
Acceptance: 1 Fin(0)
--BODY--
State: 0
[0] 0
[!0] 1 {0}
State: 1
[1] 1&0
--END--
''')


Out[5]:
G Fin( ) [co-Büchi] cluster_0 0 0 I->0 0->0 a 1 1 0->1 !a -1 1->-1 b -1->0 -1->1

In [6]:
spot.automaton('''
HOA: v1
States: 2
Start: 0
AP: 2 "a" "b"
Acceptance: 1 Fin(0)
--BODY--
State: 0
[0] 0 {0}
[!0] 1 
State: 1
[1] 1&0 {0}
--END--
''')


Out[6]:
G Fin( ) [co-Büchi] cluster_0 0 0 I->0 0->0 a 1 1 0->1 !a -1 1->-1 b -1->0 -1->1

A corner case for the dot printer


In [7]:
for a in spot.automata('''
HOA: v1
States: 3
Start: 0
AP: 2 "a" "b"
Acceptance: 1 Fin(0)
--BODY--
State: 0
[0] 1&2
State: 1
[1] 1&2 {0}
State: 2
[1] 2
--END--
HOA: v1
States: 3
Start: 0
AP: 2 "a" "b"
Acceptance: 1 Fin(0)
--BODY--
State: 0
[0] 1&2
State: 1
[1] 1 {0}
State: 2
[1] 2
--END--
'''):
    display(a)

a = spot.automaton('''
HOA: v1
States: 3
Start: 0&2
AP: 2 "a" "b"
Acceptance: 1 Fin(0)
spot.highlight.edges: 2 2
--BODY--
State: 0
[0] 1&2
State: 1
[1] 1&2 {0}
State: 2
[1] 1&2
--END--
''')
display(a, a.show('.basy'))


G Fin( ) [co-Büchi] cluster_0 cluster_1 cluster_2 0 0 I->0 -1 0->-1 a 2 2 2->2 b 1 1 1->-1 b -1->2 -1->1
G Fin( ) [co-Büchi] cluster_0 cluster_1 cluster_2 0 0 I->0 -1 0->-1 a 1 1 1->1 b 2 2 2->2 b -1->1 -1->2
G Fin( ) [co-Büchi] cluster_0 cluster_1 -4 I->-4 2 2 -4->2 0 0 -4->0 1 1 -1 1->-1 b -1->1 -1->2 2->-1 b 0->-1 a
G Fin( ) [co-Büchi] cluster_0 cluster_1 -4 I->-4 2 2 -4->2 0 0 -4->0 1 1 -1.2 1->-1.2 b -1.2->1 -1.2->2 -1 2->-1 b -1->1 -1->2 0->-1 a