simplify parser + start removing lineq code
This commit is contained in:
parent
7798fe679e
commit
b9b10ac835
11 changed files with 143 additions and 247 deletions
|
|
@ -24,30 +24,7 @@ def test_identities(phi):
|
|||
assert (phi | phi) | phi == phi | (phi | phi)
|
||||
assert ~~phi == phi
|
||||
|
||||
|
||||
def test_lineqs_unittest():
|
||||
phi = stl.parse('(G[0, 1](x + y > a?)) & (F[1,2](z - x > 0))')
|
||||
assert len(phi.lineqs) == 2
|
||||
assert phi.lineqs == {stl.parse('x + y > a?'), stl.parse('z - x > 0')}
|
||||
|
||||
phi = stl.parse('(G[0, 1](x + y > a?)) U (F[1,2](z - x > 0))')
|
||||
assert len(phi.lineqs) == 2
|
||||
assert phi.lineqs == {stl.parse('x + y > a?'), stl.parse('z - x > 0')}
|
||||
|
||||
phi = stl.parse('G(⊥)')
|
||||
assert phi.lineqs == set()
|
||||
|
||||
phi = stl.parse('F(⊤)')
|
||||
assert phi.lineqs == set()
|
||||
|
||||
|
||||
def test_walk():
|
||||
phi = stl.parse(
|
||||
'((G[0, 1](x + y > a?)) & (F[1,2](z - x > 0))) | ((X(AP1)) U (AP2))')
|
||||
'(([ ][0, 1] ap1 & < >[1,2] ap2) | (@ap1 U ap2))')
|
||||
assert len(list((~phi).walk())) == 11
|
||||
|
||||
|
||||
def test_var_names():
|
||||
phi = stl.parse(
|
||||
'((G[0, 1](x + y > a?)) & (F[1,2](z - x > 0))) | ((X(AP1)) U (AP2))')
|
||||
assert phi.var_names == {'x', 'y', 'z', 'x', 'AP1', 'AP2'}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue