Online Quantitative Timed Pattern Matching with Semiring-Valued Weighted Automata

Masaki Waga

Monitoring Cyber-Physical Systems (CPS) is essential for ensuring safety and performance in domains ranging from autonomous vehicles to medical devices. Traditional monitoring often relies on Boolean logic—determining if a specification was met or violated. However, engineers frequently require more nuanced feedback: how well did the system perform? This "quantitative" aspect, often referred to as robustness, provides a measure of the distance to violation. This paper, presented at FORMATS 2019, introduces a framework for online quantitative timed pattern matching, addressing the need for real-time, nuanced monitoring of continuous signals.

The Monitoring Challenge

Effective CPS monitoring must navigate three primary hurdles: dense time (continuous signals), quantitative evaluation (robustness scores), and online processing (real-time feedback). While previous research has addressed these individually or in pairs, a unified approach for pattern matching—checking all sub-signals—was missing.

Comparison of the proposed approach with existing literature. The "This Paper" row highlights the unique combination of quantitative, online, and dense-time capabilities for all sub-signals.

As shown in the comparison table above, prior works like [BFN+18] lacked quantitative measures, while others like [JBGN18] were limited to evaluating the whole signal rather than all sub-patterns. The proposed framework is the first to satisfy all these requirements simultaneously.

Timed Symbolic Weighted Automata (TSWA)

The core contribution is the Timed Symbolic Weighted Automata (TSWA) formalism. TSWAs extend standard timed automata by incorporating symbolic alphabets to handle real-valued sensor data and semirings to compute scores. The use of semirings allows for algebraic generality; for instance, a sup-inf semiring can calculate spatial robustness, while a tropical semiring can track cumulative costs or energy consumption.

Online Algorithm and Zone-based Abstraction

To handle the infinite state space of timed systems, the algorithm employs zone-based abstraction, grouping clock valuations into convex polyhedra. The quantitative matching problem is then transformed into finding the shortest distance in a weighted zone graph.

The online computation flow for quantitative timed pattern matching. The algorithm incrementally updates weights and computes partial results as signal segments arrive.

The online nature of the algorithm is achieved through a dynamic programming approach. As illustrated in the flow diagram, the monitor maintains intermediate weights. When a new signal segment arrives, the "shortest distance" module updates the current state and computes the partial result without re-processing the entire history.

Key Insights and Results

A critical insight of this work is that for time-bounded specifications (e.g., "the car must slow down within 5 seconds"), the monitor only needs to retain a finite amount of history. This leads to linear scalability: execution time grows linearly with signal length, and memory usage remains constant.

The framework was evaluated using automotive benchmarks (Overshoot and Ringing) on signals from a cruise control model. Results demonstrated real-time performance, with the monitor processing 60,000 entries in under 20 seconds. Crucially, the processing time for each signal segment was consistently shorter than the segment's actual duration, confirming the system's suitability for live deployment.

Conclusion

By unifying timed automata with semiring-valued weights and zone-based shortest distance calculations, this paper provides a robust foundation for real-time CPS monitoring. Future work aims to expand the expressiveness of TSWAs and explore trace-distance-based semantics for even more granular system feedback.

Summary updated

BibTeX
@inproceedings{waga2019online,
  author = {Masaki Waga},
  title = {{Online Quantitative Timed Pattern Matching with Semiring-Valued Weighted Automata}},
  booktitle = {FORMATS},
  year = {2019},
  doi = {10.1007/978-3-030-29662-9\_1},
}
Figure