don't propogate sympy in robustness if unnecessary

This commit is contained in:
Marcell Vazquez-Chanlatte 2017-03-01 14:30:45 -08:00
parent 99e0995287
commit 8b2a114826
2 changed files with 7 additions and 3 deletions

View file

@ -66,5 +66,7 @@ def eval_terms(lineq, x, t):
def eval_term(x, t): def eval_term(x, t):
# TODO(lift interpolation much higher) def _eval_term(term):
return lambda term: term.coeff*np.interp(t, x.index, x[term.id.name]) coeff = float(term.coeff) if term.coeff.is_number else term.coeff
return coeff*np.interp(t, x.index, x[term.id.name])
return _eval_term

View file

@ -33,7 +33,9 @@ def type_pred(*args:List[Type]) -> Mapping[Type, bool]:
def _child_lens(psi:STL, focus:Lens) -> STL_Generator: def _child_lens(psi:STL, focus:Lens) -> STL_Generator:
if psi is None: if psi is None:
return return
if isinstance(psi, NaryOpSTL): elif psi is stl.TOP or psi is stl.BOT:
return
elif isinstance(psi, NaryOpSTL):
for j, _ in enumerate(psi.args): for j, _ in enumerate(psi.args):
yield focus.args[j] yield focus.args[j]
else: else: