個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗mstlo (mistletoe) is a Rust library for online monitoring of Signal Temporal Logic (STL) specifications. It is designed for high performance and low memory usage, making it suitable for real-time monitoring of Cyber-Physical Systems. Python bindings are published as mstlo-python.
stl! macro embeds specifications in Rust and syntax-checks them at compile time.mstlo-python package (import name mstlo_python) enables interactive workflows, e.g. in Jupyter notebooks.Rust:
cargo add mstlo
Python:
pip install mstlo-python
The monitor is configured with a builder, then fed samples as they arrive. This monitors G[0, 2](x > 5) ("x stays above 5 for the next two seconds") under RoSI semantics:
use mstlo::monitor::{Rosi, StlMonitor};
use mstlo::{step, stl};
fn main() {
// Define a formula using the embedded DSL
let formula = stl! {G[0, 2](x > 5.0)};
// Build the monitor
let mut monitor = StlMonitor::builder()
.formula(formula)
.semantics(Rosi)
.build()
.expect("Failed to build monitor");
// Feed data steps to the monitor
let out1 = monitor.update(&step!("x", 7.0, 0s));
println!("{:?}", out1.verdicts());
// [Step { signal: "x", value: RobustnessInterval(-inf, 2.0), timestamp: 0ns }]
// at time 0, the robustness value is in the interval (-inf, 2.0)
let out2 = monitor.update(&step!("x", 4.0, 1s));
println!("{:?}", out2.verdicts());
// [Step { signal: "x", value: RobustnessInterval(-inf, -1.0), timestamp: 0ns },
// Step { signal: "x", value: RobustnessInterval(-inf, -1.0), timestamp: 1s }]
// early violation detection for times 0 and 1
}
Whole traces can also be fed at once with update_batch and the steps! macro, see Batch Updates. More examples are in mstlo/examples.
import mstlo_python as mstlo
# Parse formula using the DSL syntax
phi = mstlo.parse_formula("G[0, 10](x > 5)")
# Create a monitor using the selected semantics
monitor = mstlo.Monitor(phi, semantics="Rosi")
# Update the monitor with streaming data (signal_name, value, timestamp)
output = monitor.update("x", 6.0, 0.5)
print(f"Verdicts: {output.verdicts()}")
# Verdicts: [(0.5, (-inf, 1.0))] # (timestamp, (lower_bound, upper_bound) for robustness)
output = monitor.update("x", 3.0, 1.2)
print(f"Verdicts: {output.verdicts()}")
# Verdicts: [(0.5, (-inf, -2.0)), (1.2, (-inf, -2.0))] # early indication of violation
More examples, including a notebook comparing the semantics, are in mstlo-python/examples.
Prerequisites: Rust (stable toolchain), and for the Python bindings Python 3.9+ and maturin.
git clone https://github.com/INTO-CPS-Association/mstlo.git
cd mstlo
cargo test -p mstlo
cargo run -p mstlo --example intro_example
Python bindings, from the repository root:
cd mstlo-python
pip install maturin pytest
maturin develop
pytest
If you use mstlo in your research, please cite the following paper:
@InProceedings{10.1007/978-3-032-41160-0_2,
author = {Thomsen, Andreas Kaag and Madsen, Niels Viggo Stark and Evans, Valdemar Tang and Wright, Thomas and Esterle, Lukas and Larsen, Peter Gorm},
title = {mstlo: Efficient Online Monitoring of Signal Temporal Logic},
booktitle = {Runtime Verification},
year = {2027},
pages = {19--29},
doi = {10.1007/978-3-032-41160-0_2}
}
For citation metadata, see CITATION.cff.
This project is distributed under the INTO-CPS Association Public License (ICAPL) with GPL v3 as a supported subsidiary mode. See LICENSE for the full terms and ICA-USAGE-MODE.txt for the selected usage mode in this distribution.