Skip to main content

STL robustness evaluation with explicit semantics.

Project description

tidystl

STL robustness evaluation for Python. Explicit semantics, batch-first, extensible backends.

import numpy as np
from tidystl import Signal, parse, robustness

phi = parse("G[0,5](F[0,2](velocity >= 10))")

velocity_batch = np.full((100, 200), 12.0)  # N=100 traces, T=200 samples

sig = Signal.from_dict(
    times=np.linspace(0, 10, 200),
    values={"velocity": velocity_batch},  # shape: (N, T)
)

rho = robustness(phi, sig)  # shape: (N, T)

Features

  • Minimal dependencies: numpy and lark only; no C++ build, no MATLAB
  • Explicit semantics: boundary handling, interpolation, and end-of-trace behavior are documented and switchable per backend
  • Cross-validated: regression suites against reference tools (Breach, RTAMT, and others) using their ground-truth data
  • Batch-first: native (N, S, T) tensor layout
  • Backend-centric: swap evaluation strategy without changing formula or signal
  • Full STL: arbitrary nesting including the Until operator

Use cases

tidySTL is useful when you want to evaluate STL robustness in a small, explicit, and testable way.

  • Evaluate STL robustness Compute robustness values of STL formulas over real-valued signals.

  • Test STL semantics Check boundary-sensitive behavior such as interpolation, sampling, interval endpoints, and temporal aggregation, and compare the results with other STL tools when needed.

  • Experiment with semantics Implement alternative robustness semantics by changing only the relevant evaluation components.

  • Build research prototypes Use tidySTL as a lightweight STL evaluation layer inside monitoring, falsification, learning, or control workflows.

Installation

pip install tidystl

Requires Python 3.11+, numpy, lark.

The compatibility backends (Breach, RTAMT, STLCG++, TaLiRo, py-MTL, and more) live in a separate package; install it and register it once:

pip install tidystl-compat
import tidystl
import tidystl_compat
from tidystl import list_backends

tidystl.use(tidystl_compat)

print(list_backends())  # the full set registered, e.g. ['breach', 'native', ...]
# every listed name is usable as backend="...", e.g. backend="breach"

Only native is built into tidystl itself; list_backends() always reflects what is currently registered.

Documentation

For the full user manual (installation, signals, specification language, backend semantics, and worked examples), see docs/usage.md; for grammar tables, call signatures, and API contracts, see docs/reference.md.

License

MIT License. Copyright (c) 2026 National Institute of Advanced Industrial Science and Technology (AIST). Developed by Sota Sato.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tidystl-0.2.0.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tidystl-0.2.0-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file tidystl-0.2.0.tar.gz.

File metadata

  • Download URL: tidystl-0.2.0.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tidystl-0.2.0.tar.gz
Algorithm Hash digest
SHA256 79b169256f712214d8f66b40839bbb01151ca7c3bfd24d622b998d57f1ca2519
MD5 9a71411e343c885e466f982b8ea6a835
BLAKE2b-256 61288413350d8f9ef97ade30cefc80fc87759fde0ff58d6077f6a78579406e8f

See more details on using hashes here.

File details

Details for the file tidystl-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tidystl-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tidystl-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de2032d9c93b79ce7bc2c6c445f2160c1309129054495f1d49ee010b0c58c35c
MD5 04fd70d1a4cfe1d37a90348294a47102
BLAKE2b-256 a5846bbd742baa001c8f83377a653d1fadfc2e2461c2e592e1febdf2c320630d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page