Skip to main content

Reach

Trait Reach 

Source
pub trait Reach<const N: usize> {
    type Control: Clone;

    // Required method
    fn propagate(
        &self,
        initial: &SparsePolyZonotope,
        control: &Self::Control,
        cover: &mut Vec<SparsePolyZonotope>,
    ) -> Option<SparsePolyZonotope>;

    // Provided method
    fn certify_collision(
        &self,
        initial: &SparsePolyZonotope,
        control: &Self::Control,
        set: &SparsePolyZonotope,
        obstacle: &Polytope,
    ) -> Option<Vec<f64>> { ... }
}
Expand description

Over-approximates the reachable set of a system along one edge.

Implement it for your dynamics model, for example on top of polyzonotope-reach, whose time-interval sets are cover sets and whose time-point sets are end sets. States are points in N dimensions; the reachable sets live in the same space. Planners also need a Steer implementation for Reach::Control: implement it on the model, or pair the model with a steering function through WithSteering.

§Contract

Reach::propagate must over-approximate: every state the real system can occupy while it executes the control, including between time steps, must lie in one of the cover sets, and every state it can end in must lie in the returned end set. Planners prove safety from these sets only, so an under-approximation makes their proofs void. A model that cannot enclose an edge, for example because its integrator refuses a step, returns None instead of a set it has not proven.

Required Associated Types§

Source

type Control: Clone

What drives the system along one edge, for example a sequence of nominal inputs.

Required Methods§

Source

fn propagate( &self, initial: &SparsePolyZonotope, control: &Self::Control, cover: &mut Vec<SparsePolyZonotope>, ) -> Option<SparsePolyZonotope>

Propagates initial under control.

Appends sets to cover that together contain every state on the way, from the start of the edge to its end, in time order. Returns the set of states at the end of the edge, which becomes the next edge’s initial.

Returns None if the model cannot enclose the whole edge. The sets it appended before giving up stay in cover and are still sound, but they do not reach the end of the edge, so check_edge answers SafetyVerdict::Indeterminate.

Provided Methods§

Source

fn certify_collision( &self, initial: &SparsePolyZonotope, control: &Self::Control, set: &SparsePolyZonotope, obstacle: &Polytope, ) -> Option<Vec<f64>>

Certifies a state the real system reaches in set that lies inside obstacle.

set is one of the cover sets Reach::propagate produced from initial under control, which identify the edge. The hook behind SafetyVerdict::Unsafe. Edge checks call it only for edges that are not proven safe, once per cover set and obstacle, and turn the first point it returns into a Witness. The default returns None, so such edges stay SafetyVerdict::Indeterminate.

Return Some(point) only if point is proven to be a state the real system can actually reach on the edge, and proven to lie in obstacle. Cover sets are over-approximations, so a point of set is in general not such a state; only a model whose cover set is exact or under-approximated can certify one. polyzonotope has no certified witness, so this is for models that prove it themselves.

The returned point is sanity-checked in plain f64 (inside obstacle and inside the interval hull of set) and dropped if it fails, which keeps the verdict Indeterminate. That check is a guard against hook bugs, not a proof.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<D: Dynamics, const N: usize> Reach<N> for Nonlinear<D, N>

Source§

impl<R: Reach<N>, S, const N: usize> Reach<N> for WithSteering<R, S>

Source§

type Control = <R as Reach<N>>::Control

Source§

impl<const N: usize> Reach<N> for Linear<N>