Skip to main content

MaxBounds

Struct MaxBounds 

Source
pub struct MaxBounds { /* private fields */ }
Expand description

Per-clock maximal constants for Dbm::try_extrapolate_max (ExtraM).

The slice passed to MaxBounds::new contains ceilings for actual clocks 1 through n in order. The reference clock’s ceiling is implicitly zero. Values must lie in [0, MAX_CONSTANT].

ExtraM overapproximates a zone. Applying it does not alone guarantee timed-automata reachability preservation: that requires restrictions on guards, invariants, and clock resets.

§Example

use clock_dbm::{MaxBounds, Variable};
let ceilings = MaxBounds::new(vec![5, 8])?;
assert_eq!(ceilings.variables(), 2);
assert_eq!(ceilings.get(Variable::new(2).unwrap()), Some(8));

Implementations§

Source§

impl MaxBounds

Source

pub fn new(ceilings: Vec<i32>) -> Result<MaxBounds, Error>

Creates maximal constants for actual clocks 1, 2, …, in the order supplied: ceilings[0] is the ceiling for clock 1.

§Errors

In this order:

Proved: exactly these errors in this order; on success the ceilings are stored as given.

§Complexity

O(n) time for n = ceilings.len().

Source

pub fn variables(&self) -> usize

The number of actual clocks.

Source

pub fn get(&self, x: Variable) -> Option<i32>

Returns the ceiling for actual clock x, or None if it is outside the range covered by these bounds.

§Complexity

O(1) time.

Trait Implementations§

Source§

impl Clone for MaxBounds

Source§

fn clone(&self) -> MaxBounds

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MaxBounds

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DeepModel for MaxBounds

Source§

impl Eq for MaxBounds

Source§

impl Hash for MaxBounds

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Invariant for MaxBounds

Source§

impl PartialEq for MaxBounds

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MaxBounds

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<F> FnGhost for F

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.