diff --git a/stl/boolean_eval.py b/stl/boolean_eval.py index 32dd19f..09f1243 100644 --- a/stl/boolean_eval.py +++ b/stl/boolean_eval.py @@ -177,16 +177,6 @@ def eval_stl_ap(phi, _): return _eval -@eval_stl.register(stl.LinEq) -def eval_stl_lineq(phi, _): - def _eval(x): - out = x[phi] - out.compact() - return out - - return _eval - - @eval_stl.register(type(stl.TOP)) def eval_stl_top(_, _1): return lambda *_: TRUE_TRACE diff --git a/stl/fastboolean_eval.py b/stl/fastboolean_eval.py index 455e3cb..a135b3a 100644 --- a/stl/fastboolean_eval.py +++ b/stl/fastboolean_eval.py @@ -1,15 +1,14 @@ -import operator as op from functools import reduce, singledispatch from operator import and_, or_ import funcy as fn from bitarray import bitarray -from lenses import bind import stl.ast oo = float('inf') + def get_times(x, tau, lo, hi): end = min(v.domain.end() for v in x.values()) diff --git a/stl/parser.py b/stl/parser.py index 08909e3..8bec950 100644 --- a/stl/parser.py +++ b/stl/parser.py @@ -1,18 +1,14 @@ # -*- coding: utf-8 -*- - -# TODO: allow multiplication to be distributive -# TODO: support variables on both sides of ineq import operator as op from functools import partialmethod, reduce -from lenses import bind from parsimonious import Grammar, NodeVisitor from stl import ast from stl.utils import iff, implies, xor, timed_until STL_GRAMMAR = Grammar(u''' phi = (neg / paren_phi / next / bot / top - / xor_outer / iff_outer / implies_outer / and_outer / or_outer + / xor_outer / iff_outer / implies_outer / and_outer / or_outer / timed_until / until / g / f / AP) paren_phi = "(" __ phi __ ")" diff --git a/stl/test_ast.py b/stl/test_ast.py index c6d5ea4..1db9dc4 100644 --- a/stl/test_ast.py +++ b/stl/test_ast.py @@ -24,6 +24,7 @@ def test_identities(phi): assert (phi | phi) | phi == phi | (phi | phi) assert ~~phi == phi + def test_walk(): phi = stl.parse( '(([ ][0, 1] ap1 & < >[1,2] ap2) | (@ap1 U ap2))')