From 8f5035a9e3ae3fb59fbf8a4c9d8f8e698437d0ab Mon Sep 17 00:00:00 2001 From: Marcell Vazquez-Chanlatte Date: Mon, 24 Apr 2017 00:07:48 -0700 Subject: [PATCH] better bounds checking for get_times in boolean circuit --- stl/boolean_eval.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stl/boolean_eval.py b/stl/boolean_eval.py index 9fdf6ec..7c63eed 100644 --- a/stl/boolean_eval.py +++ b/stl/boolean_eval.py @@ -33,8 +33,10 @@ def get_times(x, tau, lo=None, hi=None): lo = min(v.first()[0] for v in x.values()) if hi is None or hi is oo: hi = max(v.last()[0] for v in x.values()) - lo += tau - hi += tau + end = min(v.domain.end() for v in x.values()) + hi = hi + tau if hi + tau <= end else end + lo = lo + tau if lo + tau <= end else end + if lo > hi: return [] elif hi == lo: