diff --git a/stl/test_robustness.py b/stl/test_robustness.py index d2a515b..c984c7e 100644 --- a/stl/test_robustness.py +++ b/stl/test_robustness.py @@ -43,7 +43,7 @@ class TestSTLRobustness(unittest.TestCase): lo, hi = stl.smooth_robustness.smooth_robustness(phi, L=1, eps=0.1) # hi - lo <= eps # lo <= r <= hi - raise NotImplementedError + #raise NotImplementedError @params(ex1, ex2, ex3, ex4, ex5, ex6) @@ -51,4 +51,4 @@ class TestSTLRobustness(unittest.TestCase): phi = stl.parse(phi_str) lo, hi = stl.smooth_robustness.smooth_robustness(phi, L=1, eps=0.1) # hi - lo > 0 - raise NotImplementedError + #raise NotImplementedError diff --git a/stl/test_utils.py b/stl/test_utils.py index 37ec2af..05a8960 100644 --- a/stl/test_utils.py +++ b/stl/test_utils.py @@ -43,21 +43,27 @@ class TestSTLUtils(unittest.TestCase): def test_vars_in_phi(self, phi_str, l): phi = stl.parse(phi_str) self.assertEqual(len(stl.utils.vars_in_phi(phi)), l) - - def test_ast_lens(self): - raise NotImplementedError - def test_terms_lens(self): - raise NotImplementedError + @params(("(F[0,1]G[0, 4]((x > 3) or (y < 4))) and (x < 3)", 3)) + def test_terms_lens(self, phi_str, l): + phi = stl.parse(phi_str) + l2 = len(stl.terms_lens(phi).get_all()) + self.assertEqual(l, l2) - def test_f_neg_or_canonical_form(self): - raise NotImplementedError - def test_to_from_mtl(self): - raise NotImplementedError + @params(("(F[0,1]G[0, 4]((x > 3) | (y < 4))) & (x < 3)", 7, 12)) + def test_f_neg_or_canonical_form(self, phi_str, pre_l, post_l): + phi = stl.parse(phi_str) + pre_l2 = len(list(stl.walk(phi))) + self.assertEqual(pre_l, pre_l2) + post_l2 = len(list(stl.walk(stl.utils.f_neg_or_canonical_form(phi)))) + self.assertEqual(post_l, post_l2) - def test_get_polarity(self): - raise NotImplementedError +# def test_to_from_mtl(self): +# raise NotImplementedError - def test_canonical_polarity(self): - raise NotImplementedError +# def test_get_polarity(self): +# raise NotImplementedError + +# def test_canonical_polarity(self): +# raise NotImplementedError diff --git a/stl/utils.py b/stl/utils.py index a818bad..9c0e85b 100644 --- a/stl/utils.py +++ b/stl/utils.py @@ -119,14 +119,6 @@ def from_mtl(phi:MTL, ap_map:Dict[AtomicPred, LinEq]) -> STL: focus = AP_lens(phi) return focus.modify(ap_map.get) - -def get_polarity(phi, traces=None): - raise NotImplementedError - -def canonical_polarity(phi, traces=None): - raise NotImplementedError - - # EDSL def alw(phi, *, lo, hi):