Quantitative Safety and Liveness

Thomas A. Henzinger, Nicolas Mazzocchi, N. Ege Saraç

Abstract

Traditional formal verification categorizes system requirements into safety ("nothing bad happens") and liveness ("something good eventually happens"). This paper generalizes this Boolean classification to quantitative properties, where system behaviors are assigned values from a complete lattice rather than binary truth values. We present a landmark decomposition theorem showing that every quantitative property is the pointwise minimum of a safety property and a liveness property. Furthermore, we demonstrate that while perfect monitoring of quantitative properties often requires infinite memory, they can be monitored using finite-state machines if a small margin of numerical error is permitted.

Introduction

In the classical study of reactive systems, the Alpern-Schneider theorem provides a fundamental decomposition: every property can be expressed as the intersection of a safety property and a liveness property. Safety properties are those that can be falsified by a finite prefix (e.g., a system crash), while liveness properties can only be violated over an infinite timeline (e.g., eventual termination).

As systems become more complex, binary specifications often prove insufficient. Engineers are frequently concerned with quantitative metrics: "What is the maximum response time?", "What is the average power consumption?", or "How close did the system get to a restricted state?" Despite the prevalence of these questions, a mathematically rigorous foundation for quantitative safety and liveness—one that mirrors the elegance of the Boolean world—has remained underdeveloped until now.

Theoretical Framework

The authors define a quantitative property $\Phi$ as a function mapping an infinite trace of system observations to a value in a complete lattice. This mathematical structure allows for the comparison of values and the determination of infima and suprema, providing a flexible language for costs, distances, and probabilities.

The Ghost Monitor and Safety Closure

To analyze these properties, the authors introduce the "Ghost Monitor." This theoretical construct maintains a set of possible future values based on the current finite observation. If a monitor can eventually reject the hypothesis that the final value will be at least $v$, the property possesses a safety component.

Central to this framework is the safety closure operator ($\Phi^*$). This operator represents the best safe approximation of a property, effectively capturing the "safety part" of any given quantitative specification.

The Decomposition Theorem

The most significant theoretical contribution of this work is the generalization of the Alpern-Schneider Theorem to the quantitative domain. The authors prove that for any quantitative property $\Phi$, there exists a quantitative liveness property $\Psi$ such that:

$$\Phi = \min(\Phi^*, \Psi)$$

In this context, the "intersection" of Boolean logic is replaced by the pointwise minimum in the lattice. This result confirms that the safety-liveness dichotomy is not a quirk of Boolean logic but a fundamental structural feature of property specifications across value domains.

Safety as Semicontinuity

A key insight of the paper is the formal link between formal methods and topology. The authors demonstrate that a quantitative property is "safe" if and only if it is upper semicontinuous. This provides a bridge between the discrete world of computer science logic and the continuous world of mathematical analysis, allowing tools from topology to be applied to system verification.

Practical Monitoring with Finite Memory

While the theoretical results are robust, perfect monitoring of quantitative properties (like average response time) typically requires infinite memory to track precise history. To bridge the gap to practical systems engineering, the authors introduce $\alpha$-safety.

By allowing for a defined error bound $\alpha$, the authors prove that any property that is both approximately safe and approximately co-safe can be monitored to arbitrary precision using a finite-state monitor. This result is a major win for real-time systems, as it suggests that we can trade a negligible amount of numerical precision for a significant reduction in computational complexity and memory overhead.

Conclusion

This work provides a comprehensive foundation for quantitative formal methods. By generalizing the safety-progress hierarchy—mapping concepts like inf, sup, lim inf, and lim sup to safety, co-safety, response, and persistence—the authors have created a framework that is both theoretically complete and practically relevant. Future work remains in developing general algorithms for the automated synthesis of these approximate monitors and extending the framework to handle quantitative assumptions about the operating environment.

Summary updated

BibTeX
@inproceedings{henzinger2023quantitative,
  author = {Thomas A. Henzinger and Nicolas Mazzocchi and N. Ege Saraç},
  title = {{Quantitative Safety and Liveness}},
  booktitle = {FoSSaCS},
  year = {2023},
  doi = {10.1007/978-3-031-30829-1\_17},
}
Figure