Exemplo n.º 1
0
def test_state_0():
    # State 0
    # Z ::= .S
    # S ::= .bAd
    s = StateSet()
    s.add(State(None_S, 0))
    s.add(State(S_bAd, 0))
    assert graph.state_sets[0] == s
Exemplo n.º 2
0
def test_state_2():
    # State 2
    # S ::= b.Ad
    # A ::= .c
    # A ::= .
    s = StateSet()
    s.add(State(S_bAd, 1))
    s.add(State(A_c, 0))
    s.add(State(A_None, 1))
    assert graph.state_sets[2] == s
Exemplo n.º 3
0
def test_state_5():
    # State 5
    # A ::= c.
    s = StateSet()
    s.add(State(A_c, 1))
    assert s in graph.state_sets
Exemplo n.º 4
0
def test_state_6():
    # State 6
    # S ::= bAd.
    s = StateSet()
    s.add(State(S_bAd, 3))
    assert s in graph.state_sets
Exemplo n.º 5
0
def test_state_4():
    # State 4
    # S ::= bA.d
    s = StateSet()
    s.add(State(S_bAd, 2))
    assert s in graph.state_sets
Exemplo n.º 6
0
def test_state_1():
    # State 1
    # Z ::= S.
    s = StateSet()
    s.add(State(None_S, 1))
    assert graph.state_sets[1] == s