fix timed until
This commit is contained in:
parent
31c3d3bead
commit
74f6efa314
2 changed files with 14 additions and 3 deletions
|
|
@ -125,7 +125,12 @@ def eval_mtl_g(phi, dt):
|
||||||
return min(val[phi.arg])
|
return min(val[phi.arg])
|
||||||
|
|
||||||
def _eval(x):
|
def _eval(x):
|
||||||
return f(x).rolling(a, b).map(_min, tag=phi)
|
tmp = f(x)
|
||||||
|
assert b >= a
|
||||||
|
if b > a:
|
||||||
|
return tmp.rolling(a, b).map(_min, tag=phi)
|
||||||
|
|
||||||
|
return tmp.retag({phi.arg: phi})
|
||||||
|
|
||||||
return _eval
|
return _eval
|
||||||
|
|
||||||
|
|
|
||||||
10
mtl/sugar.py
10
mtl/sugar.py
|
|
@ -25,5 +25,11 @@ def until(phi, psi):
|
||||||
return ast.WeakUntil(phi, psi) & env(psi)
|
return ast.WeakUntil(phi, psi) & env(psi)
|
||||||
|
|
||||||
|
|
||||||
def timed_until(phi, psi, lo, hi):
|
def timed_until(left, right, lo, hi):
|
||||||
return env(psi, lo=lo, hi=hi) & alw(until(phi, psi), lo=0, hi=lo)
|
assert 0 <= lo < hi
|
||||||
|
|
||||||
|
expr = env(right, lo=lo, hi=hi)
|
||||||
|
expr &= alw(left, lo=0, hi=lo)
|
||||||
|
expr &= alw(until(left, right), lo=lo, hi=lo)
|
||||||
|
|
||||||
|
return expr
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue