Safety and Co-Safety Properties
Definition
A safety property is a temporal property whose violations can be witnessed by a finite bad prefix. A co-safety property is the dual notion: satisfactions can be witnessed by a finite good prefix.
Why It Matters
Finite-prefix structure is what makes many monitoring, testing, model-checking, shielding, and synthesis workflows practical. It lets a verifier stop once a violation or satisfaction has become unavoidable, and it permits finite automata or safety games in places where full omega-automata would be heavier.
Formalism / Key Objects
- For a language
L subseteq Sigma^omega, a finite wordx in Sigma^*is a bad prefix when
- A finite word
xis a good prefix when
Lis safety when every word outsideLhas a bad prefix.Lis co-safety when every word insideLhas a good prefix.- In LTL,
G pis the canonical safety shape andF pis the canonical co-safety shape. - Safety LTL Automata and Games records how bad/good prefixes become automata, games, and complexity results.
Connections
- Linear Temporal Logic supplies the usual specification language for the finite-prefix formulas in this wiki.
- Runtime Verification and testing can observe finite bad prefixes directly.
- Reactive Synthesis can reduce Safety LTL to Safety Games rather than full parity games in restricted settings.
- Shielding uses safety specifications to block or correct actions before a finite bad prefix is completed.
- Probabilistic Model Checking uses co-safe LTL as a stopping condition for accumulated reward distributions.
Common Confusions
- “Safety” here is a formal trace-language class, not a general claim that a system is safe in deployment.
- A semantic safety property need not be syntactically obvious in a chosen LTL grammar.
- Co-safety is not the absence of safety; it is the finite-prefix dual for witnessing satisfaction.
- Finite-prefix structure helps algorithms, but it does not by itself make all reasoning problems easy.