added test for f_neg_canonical form

This commit is contained in:
Marcell Vazquez-Chanlatte 2017-11-13 12:44:39 -08:00
parent c495216626
commit f7f322148e
3 changed files with 33 additions and 14 deletions

13
stl/test_utils.py Normal file
View file

@ -0,0 +1,13 @@
import stl
from stl.hypothesis import SignalTemporalLogicStrategy
from hypothesis import given
@given(SignalTemporalLogicStrategy)
def test_f_neg_or_canonical_form(phi):
phi2 = stl.utils.f_neg_or_canonical_form(phi)
phi3 = stl.utils.f_neg_or_canonical_form(phi2)
assert phi2 == phi3
assert not any(
isinstance(x, (stl.ast.G, stl.ast.And)) for x in phi2.walk())