added code to get scope of stl formula

This commit is contained in:
Marcell Vazquez-Chanlatte 2017-11-22 12:21:44 -08:00
parent e491ac7043
commit 2c34d9dc7a
2 changed files with 38 additions and 2 deletions

View file

@ -85,3 +85,19 @@ def test_discretize():
phi = stl.parse('G[0.3, 1.2]((AP1) U (AP2))')
assert not stl.utils.is_discretizable(phi, dt)
def test_scope():
dt = 0.3
phi = stl.parse('X(AP1)')
assert stl.utils.scope(phi, dt) == 0.3
phi = stl.parse('G[0.3, 1.2](F[0.6, 1.5](AP1))')
assert stl.utils.scope(phi, dt) == 1.2 + 1.5
phi = stl.parse('G[0.3, 1.2](F(AP1))')
assert stl.utils.scope(phi, dt) == float('inf')
phi = stl.parse('G[0.3, 1.2]((AP1) U (AP2))')
assert stl.utils.scope(phi, dt) == float('inf')