LIRRA  1.0.0
Loading...
Searching...
No Matches
rl_stl.stl.interval Namespace Reference

Classes

class  IntervalPredicate
 

Functions

 interval_term_min (a_lo, a_hi, c, r=0.0)
 
 interval_term_max (a_lo, a_hi, c, r=0.0)
 
 interval_lower (a_lo, a_hi, b_hi, c, r=0.0)
 
 interval_upper (a_lo, a_hi, b_lo, c, r=0.0)
 
float predicate_lower (LinearPredicate pred, c, r=0.0)
 
float predicate_upper (LinearPredicate pred, c, r=0.0)
 

Detailed Description

Interval (uncertain) linear predicates ``[a]^T y - [b] >= 0`` (I-STL).

An :class:`IntervalPredicate` is an ``stlpy`` :class:`~stlpy.STL.LinearPredicate` whose normal and
offset are only known to lie in boxes ``a in [a_lo, a_hi]``, ``b in [b_lo, b_hi]``. The parent's
``a`` and ``b`` hold the nominal values (so the formula tree, horizons and names work unchanged);
the bounds define the semantics. Every evaluator in the project dispatches on this class before
:class:`LinearPredicate` (``rl_stl.stl.robustness``, ``rl_stl.synthesis.check``,
``rl_stl.synthesis.istl``, the JAX certificate), so formulas built only from exact predicates take the
old code paths unchanged.

Semantics (paper Sec. 2, eq. (margin)): for a signal sample in the box ``[y] = [c - r, c + r]``
(``r = 0`` for a measured sample) the predicate's value is the interval ``[a]^T [y] - [b]``; its lower
endpoint is

    lower(c, r) = sum_j min_{a_j in {a_lo_j, a_hi_j}} (a_j c_j - |a_j| r_j) - b_hi.

Per coordinate, ``min_{y in [c - r, c + r]} a y = a c - |a| r`` and ``a -> a c - |a| r`` is concave, so
its minimum over ``[a_lo, a_hi]`` is at an endpoint: the formula is the exact minimum of
``a^T y - b`` over the box ``[a] x [y] x [b]`` (the bilinear minimum is attained at a corner). The
upper endpoint is ``sum_j max_a (a_j c_j + |a_j| r_j) - b_lo``. With ``a_lo = a_hi`` and
``b_lo = b_hi`` both reduce to ``a^T c -+ |a|^T r - b``.

``lower`` is concave in ``c`` (a sum of minima of affine functions), so ``lower(C x, r) >= thr`` is a
convex constraint on ``x``; :mod:`rl_stl.synthesis.istl` encodes it exactly with one auxiliary variable
per signal coordinate.

Function Documentation

◆ interval_lower()

rl_stl.stl.interval.interval_lower (   a_lo,
  a_hi,
  b_hi,
  c,
  r = 0.0 
)
``sum_j interval_term_min - b_hi`` over the last axis.

◆ interval_term_max()

rl_stl.stl.interval.interval_term_max (   a_lo,
  a_hi,
  c,
  r = 0.0 
)

◆ interval_term_min()

rl_stl.stl.interval.interval_term_min (   a_lo,
  a_hi,
  c,
  r = 0.0 
)
Elementwise ``min_{a in [a_lo, a_hi], y in [c - r, c + r]} a y`` (broadcasting, numpy only).

◆ interval_upper()

rl_stl.stl.interval.interval_upper (   a_lo,
  a_hi,
  b_lo,
  c,
  r = 0.0 
)

◆ predicate_lower()

float rl_stl.stl.interval.predicate_lower ( LinearPredicate  pred,
  c,
  r = 0.0 
)
Lower endpoint of a predicate (exact or interval) over the box ``[c - r, c + r]``.

◆ predicate_upper()

float rl_stl.stl.interval.predicate_upper ( LinearPredicate  pred,
  c,
  r = 0.0 
)