Properties
This module provides representations of (safety) properties.
General property interface
Reachability.Properties.Property
โ Type.Abstract supertype of properties that can be checked.
Every concrete subtype should provide the following functions:
dim(๐::Property)::Int
check(๐::Property, X::LazySet; witness::Bool=false)
Boolean combination of properties
Reachability.Properties.Conjunction
โ Type.Conjunction <: Property
Type that represents a conjunction of properties.
Fields
conjuncts
โ vector of properties
Notes
The following formula characterizes whether a set $X$ satisfies a disjunction $๐ = ๐_1 โง ๐_2 โง โฆ โง ๐_m$:
LazySets.dim
โ Method.dim(๐::Conjunction)::Int
Return the dimension of a conjunction of properties.
Input
๐
โ conjunction of properties
Output
The dimension of the conjunction of properties.
Reachability.Properties.check
โ Method.check(๐::Conjunction, X::LazySet{N}; witness::Bool=false) where {N<:Real}
Check whether a convex set satisfies a conjunction of properties.
Input
๐
โ conjunction of propertiesX
โ convex setwitness
โ (optional, default:false
) flag for returning a counterexample if the property is violated
Output
- If
witness
option is deactivated:true
iffX
satisfies the property๐
- If
witness
option is activated:(true, [])
iffX
satisfies the property๐
(false, v)
iffX
does not satisfy the property๐
with witnessv
Notes
By convention, the empty conjunction is equivalent to true
and hence is satisfied by any set.
Reachability.Properties.Disjunction
โ Type.Disjunction <: Property
Type that represents a disjunction of properties.
Fields
disjuncts
โ vector of properties (elements are reordered by this type)reorder
โ flag to indicate whether shuffling is allowed
Notes
The following formula characterizes whether a set $X$ satisfies a disjunction $๐ = ๐_1 โจ ๐_2 โจ โฆ โจ ๐_m$:
If the reorder
flag is set, the disjuncts may be reordered after each call to check
as a heuristics to make subsequent checks faster.
LazySets.dim
โ Method.dim(๐::Disjunction)::Int
Return the dimension of a disjunction of properties.
Input
๐
โ disjunction of properties
Output
The dimension of the disjunction of properties.
Reachability.Properties.check
โ Method.check(๐::Disjunction, X::LazySet{N}; witness::Bool=false) where {N<:Real}
Check whether a convex set satisfies a disjunction of properties.
Input
๐
โ disjunction of propertiesX
โ convex setwitness
โ (optional, default:false
) flag for returning a counterexample if the property is violated
Output
- If
witness
option is deactivated:true
iffX
satisfies the property๐
- If
witness
option is activated:(true, [])
iffX
satisfies the property๐
(false, v)
iffX
does not satisfy the property๐
with witnessv
; note thatv == N[]
if ๐ is the empty disjunction
Notes
By convention, the empty disjunction is equivalent to false
and hence is satisfied by no set.
If the ๐.reorder
flag is set, the disjuncts may be reordered as a heuristics to make subsequent checks faster. Since we check satisfaction from left to right, we move the disjunct for which satisfaction was established to the front.
To be consistent with other propertes, the witness
option only returns one counterexample, namely for the left-most disjunct in the disjuncts
vector. We deactivate witness production for checking the remaining disjuncts.
Specific properties
SafeStatesProperty{N<:Real} <: Property
Type that represents a safety property characterized by a set of safe states. The property is satisfied by a given set of states $X$ if $X$ is fully contained in the set of safe states.
Fields
safe
โ convex set representing the safe stateswitness
โ witness point (empty vector if not set)
Notes
The following formula characterizes whether a set $X$ satisfies a safety property characterized by a set of safe states ๐:
LazySets.dim
โ Method.dim(๐::SafeStatesProperty)::Int
Return the dimension of a property with safe states.
Input
๐
โ safety property with safe states
Output
The dimension of the safe states.
Reachability.Properties.check
โ Method.check(๐::SafeStatesProperty, X::LazySet; witness::Bool=false)
Checks whether a convex set is contained in the set of safe states.
Input
๐
โ safety property with safe statesX
โ convex setwitness
โ (optional, default:false
) flag for returning a counterexample if the property is violated
Output
Let $Y$ be the safe states represented by ๐.
- If
witness
option is deactivated:true
iff $X โ Y$ - If
witness
option is activated:(true, [])
iff $X โ Y$(false, v)
iff $X โ Y$ and $v โ X \setminus Y$
BadStatesProperty{N<:Real} <: Property
Type that represents a safety property characterized by a set of bad states. The property is satisfied by a given set of states if the intersection with the set of bad states is empty.
Fields
bad
โ convex set representing the bad stateswitness
โ witness point (empty vector if not set)
Notes
The following formula characterizes whether a set $X$ satisfies a safety property characterized by a set of bad states ๐:
LazySets.dim
โ Method.dim(๐::BadStatesProperty)::Int
Return the dimension of a property with bad states.
Input
๐
โ safety property with bad states
Output
The dimension of the bad states.
Reachability.Properties.check
โ Method.check(๐::BadStatesProperty, X::LazySet; witness::Bool=false)
Checks whether a convex set is disjoint from the set of bad states.
Input
๐
โ safety property with bad statesX
โ convex setwitness
โ (optional, default:false
) flag for returning a counterexample if the property is violated
Output
Let $Y$ be the bad states represented by ๐.
- If
witness
option is deactivated:true
iff $X โฉ Y = โ $ - If
witness
option is activated:(true, [])
iff $X โฉ Y = โ $(false, v)
iff $X โฉ Y โ โ $ and $v โ X โฉ Y$