From 6f20a4811c8cad54e2fc42a9da3688ae8cfce0db Mon Sep 17 00:00:00 2001 From: Shromona MacBook Date: Thu, 8 Dec 2016 22:02:20 -0800 Subject: [PATCH 1/2] Updated fast boolean --- stl/fastboolean_eval.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/stl/fastboolean_eval.py b/stl/fastboolean_eval.py index ab6cf18..498edf5 100644 --- a/stl/fastboolean_eval.py +++ b/stl/fastboolean_eval.py @@ -23,10 +23,9 @@ def _(stl): def _(stl): def sat_comp(x,t): sat = bitarray(len(t)) - sat.setall('True') for arg in stl.args: - sat = pointwise_satf(arg)(x, t) & sat - return sat + sat = ~pointwise_satf(arg)(x, t) | ~sat + return ~sat return sat_comp @@ -49,8 +48,7 @@ def _(stl): sat = bitarray() for tau in t: tau_t = [min(tau + t2, x.index[-1]) for t2 in x[lo:hi].index] - point_sat = pointwise_satf(stl.arg)(x, tau_t) - sat.append(point_sat.count() == point_sat.length()) + sat.append((~(pointwise_satf(stl.arg)(x, tau_t))).count() == 0) return sat return sat_comp From 5683a6902fbaaf16ab3dd55b6bdd8aeee9584bf4 Mon Sep 17 00:00:00 2001 From: Shromona MacBook Date: Thu, 8 Dec 2016 22:13:10 -0800 Subject: [PATCH 2/2] Updated globally and conjunction --- stl/fastboolean_eval.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stl/fastboolean_eval.py b/stl/fastboolean_eval.py index 498edf5..89729ed 100644 --- a/stl/fastboolean_eval.py +++ b/stl/fastboolean_eval.py @@ -22,10 +22,10 @@ def _(stl): @pointwise_satf.register(stl.And) def _(stl): def sat_comp(x,t): - sat = bitarray(len(t)) + sat = ~bitarray(len(t)) for arg in stl.args: - sat = ~pointwise_satf(arg)(x, t) | ~sat - return ~sat + sat = ~(~pointwise_satf(arg)(x, t) | ~sat) + return sat return sat_comp