continue refactoring to optimize for mtl
This commit is contained in:
parent
5fd66cfd2c
commit
98824c9ba1
21 changed files with 393 additions and 467 deletions
20
mtl/test_params.py
Normal file
20
mtl/test_params.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import mtl
|
||||
from mtl.hypothesis import MetricTemporalLogicStrategy
|
||||
|
||||
import hypothesis.strategies as st
|
||||
from hypothesis import given
|
||||
|
||||
|
||||
@given(st.integers(), st.integers(), st.integers())
|
||||
def test_params1(a, b, c):
|
||||
phi = mtl.parse('G[a, b] x')
|
||||
assert {x.name for x in phi.params} == {'a', 'b'}
|
||||
|
||||
phi2 = phi.set_params({'a': a, 'b': b})
|
||||
assert phi2.params == set()
|
||||
assert phi2 == mtl.parse(f'G[{a}, {b}](x)')
|
||||
|
||||
|
||||
@given(MetricTemporalLogicStrategy)
|
||||
def test_hash_stable(phi):
|
||||
assert hash(phi) == hash(mtl.parse(str(phi)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue