TL;DR
This paper tackles the challenge of automatically generating formal specifications for cyber-physical systems (CPS). They introduce a novel algorithm that synthesizes Metric Temporal Logic (MTL) formulas that are not only concise but also efficient for runtime monitoring by bounding their "lookahead" requirement. This is achieved by reducing the synthesis problem to a series of satisfiability problems in Linear Real Arithmetic (LRA).
What Problem Does This Paper Address?
Manually writing formal specifications for complex systems, especially cyber-physical systems (CPS), is a time-consuming and error-prone task. This bottleneck hinders the adoption of formal verification and runtime verification techniques. While existing methods often focus on minimizing the size of the synthesized formulas, this paper highlights that for efficient online monitoring, the "lookahead" – how far into the future a specification needs to check – is equally crucial. A specification with a large lookahead can introduce significant latency, making it unsuitable for safety-critical applications. The authors aim to synthesize MTL formulas that are both small and have a bounded lookahead, making them practical for real-time monitoring.
Methods
The core of the paper is a novel algorithm that synthesizes MTL formulas by reducing the problem to a series of satisfiability modulo theory (SMT) problems in Linear Real Arithmetic (LRA). The algorithm iteratively searches for formulas of increasing size, ensuring that the smallest valid formula is found.
Key technical contributions include:
- Formalizing "lookahead": They adopt and formalize the notion of "future-reach" for MTL formulas, quantifying the temporal horizon required for their evaluation.
- SMT-based Synthesis: The algorithm encodes the synthesis problem into LRA formulas. This involves:
- Structural Constraints: Encoding the syntax-DAG of potential MTL formulas.
- Future-reach Constraints: Encoding the inductive definition of future-reach.
- Semantic Constraints: Encoding a popular MTL monitoring procedure using LRA to ensure the formulas are "globally-separating" (hold for positive examples, fail for negative ones).
- Existence Check: They introduce a criterion called "K-infix-separability" to efficiently check if a solution exists for a given sample and future-reach bound.
- TEAL Tool: They implement their algorithm in a tool called TEAL.
Datasets
The paper does not introduce new datasets. Instead, they evaluate their algorithm on synthetically generated benchmark suites. These suites are created from predefined MTL patterns (e.g., Bounded Recurrence, Bounded Response) by replacing time intervals with different values. Samples are generated by creating random prefixes and classifying them as positive or negative based on whether they satisfy the original formula.
Key Insights and Ideas
- Lookahead is Crucial for Monitoring: The paper strongly emphasizes that for efficient online monitoring, minimizing formula size alone is insufficient. Bounded lookahead is a critical factor for reducing monitoring latency, especially in safety-critical systems.
- SMT as a Powerful Synthesis Engine: By reducing the complex problem of MTL synthesis to LRA satisfiability, the authors leverage the power of modern SMT solvers to find solutions. This approach is generalizable and allows for synthesizing formulas with arbitrary syntactic structures.
- K-infix-separability for Existence: The introduction of K-infix-separability provides an efficient way to determine if a solution is even possible before attempting synthesis, saving computational resources.
- Trade-off Between Size and Lookahead: Experiments suggest that while increasing the future-reach bound generally leads to smaller formulas, the decrease in size is not always drastic, highlighting the importance of finding a good balance.
Key Results
- Successful Synthesis: The TEAL tool successfully synthesized MTL formulas that matched the patterns of the original formulas in 87.1% of cases (when not timing out).
- Conciseness: Synthesized formulas were consistently equal to or smaller than the original formulas, demonstrating the algorithm's ability to find concise specifications.
- Impact of Future-Reach: Varying the future-reach bound (K) showed that increasing K generally led to a decrease in the average size of the synthesized formulas, though the effect was not always dramatic. For instance, average formula sizes ranged from 3.904 (K=1) to 3.361 (K=4).
- Runtime Scalability: Experiments indicated that runtime increases significantly with the number of prefixes and the length of prefixes, as visualized in Figure 2.
- Complexity: The decision problem for synthesizing MTL formulas is shown to be in NP.
Limitations and Future Work
- Runtime: The runtime of the algorithm can be significant, especially with larger samples or longer prefixes, as shown in the experimental results.
- Specific Operators: The encoding for certain operators, like "Until" (U), can be complex and contribute to larger formulas. The authors suggest omitting such operators might improve performance.
- Future Work:
- STL Synthesis: Extending the techniques to synthesize Signal Temporal Logic (STL) formulas for verification.
- Heuristics and Optimizations: Developing more advanced heuristics and optimizations for industrial-scale applications.
- Hardness of MTL Synthesis: The exact complexity lower bound for MTL synthesis remains an open problem.
Summary updated