From 41ccd20a6e7c5336eeadaa2b6d16a7c21e380e12 Mon Sep 17 00:00:00 2001 From: Marcell Vazquez-Chanlatte Date: Sat, 9 Jul 2016 00:39:58 -0700 Subject: [PATCH] add set_time to game_to_sl --- __init__.py | 2 +- stl.py | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/__init__.py b/__init__.py index 86290da..99d5389 100644 --- a/__init__.py +++ b/__init__.py @@ -1,4 +1,4 @@ -from stl.stl import time_lens, set_time, walk, tree +from stl.stl import time_lens, walk, tree from stl.stl import dt_sym, t_sym from stl.stl import LinEq, Var, Interval, NaryOpSTL, Or, And, F, G, ModalOp, Neg from stl.parser import parse diff --git a/stl.py b/stl.py index bb8a26a..3834ffb 100644 --- a/stl.py +++ b/stl.py @@ -102,8 +102,9 @@ def tree(stl): return {x:set(x.children()) for x in walk(stl) if x.children()} -def time_lens(phi:"STL") -> lens: - return _time_lens(phi).bind(phi) +def time_lens(phi:"STL", bind=True) -> lens: + l = _time_lens(phi) + return l.bind(phi) if bind else l def _time_lens(phi): @@ -116,7 +117,3 @@ def _time_lens(phi): return lens().args.tuple_(*child_lens).each_() else: return lens().arg.add_lens(_time_lens(phi.arg)) - - -def set_time(phi, *, t, dt=0.1): - return time_lens(phi).call("evalf", subs={t_sym: t, dt_sym: dt})