FiniteRange

Trait FiniteRange 

Source
pub trait FiniteRange: Sized {
    // Required methods
    spec fn range_set(lo: Self, hi: Self) -> Set<Self>;
    spec fn range_len(lo: Self, hi: Self) -> nat;
    proof fn range_properties(lo: Self, hi: Self);
}

Required Methods§

Source

spec fn range_set(lo: Self, hi: Self) -> Set<Self>

Source

spec fn range_len(lo: Self, hi: Self) -> nat

Source

proof fn range_properties(lo: Self, hi: Self)

ensures
Self::range_set(lo, hi).finite(),
Self::range_set(lo, hi).len() == Self::range_len(lo, hi),

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FiniteRange for i8

Source§

open spec fn range_set(lo: Self, hi: Self) -> Set<Self>

{ Set::new(|i: Self| lo <= i < hi) }
Source§

open spec fn range_len(lo: Self, hi: Self) -> nat

{ if lo <= hi { (hi - lo) as nat } else { 0 } }
Source§

proof fn range_properties(lo: Self, hi: Self)

Source§

impl FiniteRange for i16

Source§

open spec fn range_set(lo: Self, hi: Self) -> Set<Self>

{ Set::new(|i: Self| lo <= i < hi) }
Source§

open spec fn range_len(lo: Self, hi: Self) -> nat

{ if lo <= hi { (hi - lo) as nat } else { 0 } }
Source§

proof fn range_properties(lo: Self, hi: Self)

Source§

impl FiniteRange for i32

Source§

open spec fn range_set(lo: Self, hi: Self) -> Set<Self>

{ Set::new(|i: Self| lo <= i < hi) }
Source§

open spec fn range_len(lo: Self, hi: Self) -> nat

{ if lo <= hi { (hi - lo) as nat } else { 0 } }
Source§

proof fn range_properties(lo: Self, hi: Self)

Source§

impl FiniteRange for i64

Source§

open spec fn range_set(lo: Self, hi: Self) -> Set<Self>

{ Set::new(|i: Self| lo <= i < hi) }
Source§

open spec fn range_len(lo: Self, hi: Self) -> nat

{ if lo <= hi { (hi - lo) as nat } else { 0 } }
Source§

proof fn range_properties(lo: Self, hi: Self)

Source§

impl FiniteRange for i128

Source§

open spec fn range_set(lo: Self, hi: Self) -> Set<Self>

{ Set::new(|i: Self| lo <= i < hi) }
Source§

open spec fn range_len(lo: Self, hi: Self) -> nat

{ if lo <= hi { (hi - lo) as nat } else { 0 } }
Source§

proof fn range_properties(lo: Self, hi: Self)

Source§

impl FiniteRange for isize

Source§

open spec fn range_set(lo: Self, hi: Self) -> Set<Self>

{ Set::new(|i: Self| lo <= i < hi) }
Source§

open spec fn range_len(lo: Self, hi: Self) -> nat

{ if lo <= hi { (hi - lo) as nat } else { 0 } }
Source§

proof fn range_properties(lo: Self, hi: Self)

Source§

impl FiniteRange for u8

Source§

open spec fn range_set(lo: Self, hi: Self) -> Set<Self>

{ Set::new(|i: Self| lo <= i < hi) }
Source§

open spec fn range_len(lo: Self, hi: Self) -> nat

{ if lo <= hi { (hi - lo) as nat } else { 0 } }
Source§

proof fn range_properties(lo: Self, hi: Self)

Source§

impl FiniteRange for u16

Source§

open spec fn range_set(lo: Self, hi: Self) -> Set<Self>

{ Set::new(|i: Self| lo <= i < hi) }
Source§

open spec fn range_len(lo: Self, hi: Self) -> nat

{ if lo <= hi { (hi - lo) as nat } else { 0 } }
Source§

proof fn range_properties(lo: Self, hi: Self)

Source§

impl FiniteRange for u32

Source§

open spec fn range_set(lo: Self, hi: Self) -> Set<Self>

{ Set::new(|i: Self| lo <= i < hi) }
Source§

open spec fn range_len(lo: Self, hi: Self) -> nat

{ if lo <= hi { (hi - lo) as nat } else { 0 } }
Source§

proof fn range_properties(lo: Self, hi: Self)

Source§

impl FiniteRange for u64

Source§

open spec fn range_set(lo: Self, hi: Self) -> Set<Self>

{ Set::new(|i: Self| lo <= i < hi) }
Source§

open spec fn range_len(lo: Self, hi: Self) -> nat

{ if lo <= hi { (hi - lo) as nat } else { 0 } }
Source§

proof fn range_properties(lo: Self, hi: Self)

Source§

impl FiniteRange for u128

Source§

open spec fn range_set(lo: Self, hi: Self) -> Set<Self>

{ Set::new(|i: Self| lo <= i < hi) }
Source§

open spec fn range_len(lo: Self, hi: Self) -> nat

{ if lo <= hi { (hi - lo) as nat } else { 0 } }
Source§

proof fn range_properties(lo: Self, hi: Self)

Source§

impl FiniteRange for usize

Source§

open spec fn range_set(lo: Self, hi: Self) -> Set<Self>

{ Set::new(|i: Self| lo <= i < hi) }
Source§

open spec fn range_len(lo: Self, hi: Self) -> nat

{ if lo <= hi { (hi - lo) as nat } else { 0 } }
Source§

proof fn range_properties(lo: Self, hi: Self)

Implementors§