TIRO stands for TIme RObustness — the central concept of this work.
This repository contains the implementation of the monitoring algorithm for time robustness and quantitative semantics of Metric Interval Temporal Logic (MITL) under point-based semantics, as presented in the paper:
Time Robustness for Point-Based Semantics of Metric Interval Temporal Logic
(Accepted at Knowledge Representation and Reasoning 2026 — KR 2026)
The version of the code used in the paper is tagged 26KR.
Authors: Simone Silvetti, Francesca Cairoli, and Laura Nenzi (University of Trieste) and Ivan Compagnucci and Catia Trubiani (Gran Sasso Science Institute, L'Aquila).
The repository provides a Python implementation of the proposed time robustness monitoring algorithm and its validation on two use cases: a Drone Surveillance system and a Smart Hospital Multi-Agent system.
Requires Python ≥ 3.9. You can set up the environment using venv or Conda.
git clone https://github.com/LogArtLab/tiro.git
cd tiro
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
pip install -e .git clone https://github.com/LogArtLab/tiro.git
cd tiro
conda env create -f environment.yml
conda activate mitl-robustness
pip install -e .The monitoring algorithm is available in the mitl/ package. After installation, you can use it as follows:
from mitl import load_formula, evaluate_robustness_semantics, evaluate_boolean_semantics
trajectory = [(0, {"a"}), (4, {"a", "d"}), (8, {"z", "h"}), (12, {"a"}), (78, {"a"})]
formula = 'F[5,9](z & G[10,34](a))'
loaded_formula = load_formula(formula)
boolean_semantics = evaluate_boolean_semantics(trajectory, loaded_formula)
quantitative_semantics = evaluate_robustness_semantics(trajectory, loaded_formula)
print("Boolean semantics: ", boolean_semantics)
print("time robustness: ", quantitative_semantics)All the results available in the paper can be reproduced by running the scripts in the use_cases/ folder. Each script must be run from its own subdirectory (scripts use relative paths for input/output files).
Drone use case:
cd use_cases/drone
python drone.pySmart Hospital use case (run in order):
cd use_cases/hospital
python time_bounds.py
python analysis_item.py
python analysis_robot.py
python generate_statistics.pySee use_cases/README.md for full details.
.
├── mitl/
│ ├── Semantics.py
│ ├── MITL.g4
│ ├── MITL*.py # files generated by ANTLR4 tool (with visitor pattern)
│ └── __init__.py
├── use_cases/
│ ├── README.md
│ ├── drone/ # use case 1
│ │ ├── drone.py
│ │ └── results/
│ │ └── figure.* # generated charts
│ └── hospital/ # use case 2
│ ├── analysis_item.py # used to monitor items' formulas
│ ├── analysis_robot.py # used to monitor robots' formulas
│ ├── generate_statistics.py # used to evaluate statistics of formulas over trajectories
│ ├── time_bounds.py # used to generate time bounds of item formulas
│ ├── results/
│ └── coordinate/ # external trajectory generation tool (not our contribution)
│ ├── param.py # modified file
│ ├── runParallelSim.py # execute simulation (with centralized communication)
│ ├── results/ # contains results of simulation
│ └── results_backup/ # pre-generated trajectories used to reproduce paper's results
├── pyproject.toml
├── requirements.txt
├── environment.yml
├── LICENSE
└── README.md
-
mitl/
Contains the implementation of the MITL monitoring algorithm, including the Boolean and quantitative (robustness-based) semantics for point-based event traces. -
use_cases/
Includes the two main evaluation scenarios:drone/— Toy example demonstrating robustness analysis on ordered, time-constrained drone trajectories.hospital/— Simulation of a multi-agent smart hospital environment.coordinate/— External tool used to generate agent trajectories.⚠️ This folder is not part of our contribution; onlyparam.pywas modified.
The monitoring algorithm implements the quantitative time robustness semantics for MITL formulas over finite event traces, as defined in the paper.
Given an MITL formula φ and an event trace σ, the algorithm computes:
- The Boolean satisfaction: whether (σ, i) ⊨ φ.
- The quantitative robustness value ρ(φ, σ, i): a real-valued metric quantifying the tolerance of φ to timing perturbations in σ.
The implementation is modular, allowing the definition and evaluation of custom MITL formulas and event traces.
A toy scenario where a drone must visit regions A, B, and C in a predefined temporal order:
ψ_d = F[10,20](enterA ∧ F[40,50](enterB ∧ F[20,30] enterC))
Used to demonstrate the relationship between time robustness and probability of satisfaction under temporal perturbations.
A large-scale simulation of autonomous hospital robots delivering medical items.
Three MITL properties are monitored:
φ_a = G(created → F[0,20] startLoading)
φ_b = G(startLoading → F[L,U] delivered)
φ_c = G(fail → X[0,2500] recovered)
The coordinate module generates agent trajectories (external), while our modified param.py adjusts environment parameters for robustness evaluation.
This project is licensed under the MIT License — see the LICENSE file for details.