Properties

Properties

This module provides representations of (safety) properties.

General property interface

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)
source

Boolean combination of properties

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$:

\[ X \models ๐‘ƒ \iff X \models ๐‘ƒ_j \text{ for all } 1 โ‰ค j โ‰ค m\]
source
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.

source
check(๐‘ƒ::Conjunction, X::LazySet{N}; witness::Bool=false) where {N<:Real}

Check whether a convex set satisfies a conjunction of properties.

Input

  • ๐‘ƒ โ€“ conjunction of properties
  • X โ€“ convex set
  • witness โ€“ (optional, default: false) flag for returning a counterexample if the property is violated

Output

  • If witness option is deactivated: true iff X satisfies the property ๐‘ƒ
  • If witness option is activated:
    • (true, []) iff X satisfies the property ๐‘ƒ
    • (false, v) iff X does not satisfy the property ๐‘ƒ with witness v

Notes

By convention, the empty conjunction is equivalent to true and hence is satisfied by any set.

source
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$:

\[ X \models ๐‘ƒ \iff X \models ๐‘ƒ_j \text{ for some } 1 โ‰ค j โ‰ค 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.

source
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.

source
check(๐‘ƒ::Disjunction, X::LazySet{N}; witness::Bool=false) where {N<:Real}

Check whether a convex set satisfies a disjunction of properties.

Input

  • ๐‘ƒ โ€“ disjunction of properties
  • X โ€“ convex set
  • witness โ€“ (optional, default: false) flag for returning a counterexample if the property is violated

Output

  • If witness option is deactivated: true iff X satisfies the property ๐‘ƒ
  • If witness option is activated:
    • (true, []) iff X satisfies the property ๐‘ƒ
    • (false, v) iff X does not satisfy the property ๐‘ƒ with witness v; note that v == 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.

source

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 states
  • witness โ€“ 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 ๐‘ƒ:

\[ X \models ๐‘ƒ \iff X โŠ† ๐‘ƒ.\texttt{safe}\]
source
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.

source
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 states
  • X โ€“ convex set
  • witness โ€“ (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$
source
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 states
  • witness โ€“ 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 ๐‘ƒ:

\[ X \models ๐‘ƒ \iff X โˆฉ ๐‘ƒ.\texttt{bad} = โˆ…\]
source
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.

source
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 states
  • X โ€“ convex set
  • witness โ€“ (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$
source