Trait creusot_contracts::logic::ord::OrdLogic

source ·
pub trait OrdLogic {
Show 14 methods // Required methods fn cmp_log(self, other: Self) -> Ordering; fn cmp_le_log(x: Self, y: Self); fn cmp_lt_log(x: Self, y: Self); fn cmp_ge_log(x: Self, y: Self); fn cmp_gt_log(x: Self, y: Self); fn refl(x: Self); fn trans(x: Self, y: Self, z: Self, o: Ordering); fn antisym1(x: Self, y: Self); fn antisym2(x: Self, y: Self); fn eq_cmp(x: Self, y: Self); // Provided methods fn le_log(self, o: Self) -> bool { ... } fn lt_log(self, o: Self) -> bool { ... } fn ge_log(self, o: Self) -> bool { ... } fn gt_log(self, o: Self) -> bool { ... }
}
Expand description

Trait for comparison operations (<, >, <=, >=) in pearlite.

Types that implement this trait must have a total order. In particular, the order must be:

Required Methods§

source

fn cmp_log(self, other: Self) -> Ordering

The comparison operation. Returns:

logic

source

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source

fn refl(x: Self)

Reflexivity of the order

law

ensures

x.cmp_log(x) == Ordering::Equal

source

fn trans(x: Self, y: Self, z: Self, o: Ordering)

Transitivity of the order

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source

fn antisym1(x: Self, y: Self)

Antisymmetry of the order (x < y ==> !(y < x))

The antisymmetry is in two part; here is the second part.

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source

fn antisym2(x: Self, y: Self)

Antisymmetry of the order (x > y ==> !(y > x))

The antisymmetry is in two part; here is the first part.

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source

fn eq_cmp(x: Self, y: Self)

Compatibility between Ordering::Equal and equality (==).

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

Provided Methods§

source

fn le_log(self, o: Self) -> bool

The logical <= operation.

logic

pearlite! { self.cmp_log(o) != Ordering::Greater }

source

fn lt_log(self, o: Self) -> bool

The logical < operation.

logic

pearlite! { self.cmp_log(o) == Ordering::Less }

source

fn ge_log(self, o: Self) -> bool

The logical >= operation.

logic

pearlite! { self.cmp_log(o) != Ordering::Less }

source

fn gt_log(self, o: Self) -> bool

The logical > operation.

logic

pearlite! { self.cmp_log(o) == Ordering::Greater }

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl OrdLogic for bool

source§

fn cmp_log(self, o: Self) -> Ordering

logic

match (self, o) {
    (false, false) => Ordering::Equal,
    (true, true) => Ordering::Equal,
    (false, true) => Ordering::Less,
    (true, false) => Ordering::Greater,
}
source§

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source§

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source§

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source§

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source§

fn refl(x: Self)

law

ensures

x.cmp_log(x) == Ordering::Equal

source§

fn trans(x: Self, y: Self, z: Self, o: Ordering)

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source§

fn antisym1(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source§

fn antisym2(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source§

fn eq_cmp(x: Self, y: Self)

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

source§

impl OrdLogic for i8

source§

fn cmp_log(self, o: Self) -> Ordering

logic

if self < o {
    Ordering::Less
} else if self == o {
    Ordering::Equal
} else {
    Ordering::Greater
}
source§

fn le_log(self, _: Self) -> bool

logic

source§

fn lt_log(self, _: Self) -> bool

logic

source§

fn ge_log(self, _: Self) -> bool

logic

source§

fn gt_log(self, _: Self) -> bool

logic

source§

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source§

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source§

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source§

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source§

fn refl(x: Self)

law

ensures

x.cmp_log(x) == Ordering::Equal

source§

fn trans(x: Self, y: Self, z: Self, o: Ordering)

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source§

fn antisym1(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source§

fn antisym2(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source§

fn eq_cmp(x: Self, y: Self)

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

source§

impl OrdLogic for i16

source§

fn cmp_log(self, o: Self) -> Ordering

logic

if self < o {
    Ordering::Less
} else if self == o {
    Ordering::Equal
} else {
    Ordering::Greater
}
source§

fn le_log(self, _: Self) -> bool

logic

source§

fn lt_log(self, _: Self) -> bool

logic

source§

fn ge_log(self, _: Self) -> bool

logic

source§

fn gt_log(self, _: Self) -> bool

logic

source§

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source§

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source§

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source§

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source§

fn refl(x: Self)

law

ensures

x.cmp_log(x) == Ordering::Equal

source§

fn trans(x: Self, y: Self, z: Self, o: Ordering)

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source§

fn antisym1(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source§

fn antisym2(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source§

fn eq_cmp(x: Self, y: Self)

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

source§

impl OrdLogic for i32

source§

fn cmp_log(self, o: Self) -> Ordering

logic

if self < o {
    Ordering::Less
} else if self == o {
    Ordering::Equal
} else {
    Ordering::Greater
}
source§

fn le_log(self, _: Self) -> bool

logic

source§

fn lt_log(self, _: Self) -> bool

logic

source§

fn ge_log(self, _: Self) -> bool

logic

source§

fn gt_log(self, _: Self) -> bool

logic

source§

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source§

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source§

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source§

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source§

fn refl(x: Self)

law

ensures

x.cmp_log(x) == Ordering::Equal

source§

fn trans(x: Self, y: Self, z: Self, o: Ordering)

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source§

fn antisym1(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source§

fn antisym2(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source§

fn eq_cmp(x: Self, y: Self)

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

source§

impl OrdLogic for i64

source§

fn cmp_log(self, o: Self) -> Ordering

logic

if self < o {
    Ordering::Less
} else if self == o {
    Ordering::Equal
} else {
    Ordering::Greater
}
source§

fn le_log(self, _: Self) -> bool

logic

source§

fn lt_log(self, _: Self) -> bool

logic

source§

fn ge_log(self, _: Self) -> bool

logic

source§

fn gt_log(self, _: Self) -> bool

logic

source§

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source§

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source§

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source§

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source§

fn refl(x: Self)

law

ensures

x.cmp_log(x) == Ordering::Equal

source§

fn trans(x: Self, y: Self, z: Self, o: Ordering)

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source§

fn antisym1(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source§

fn antisym2(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source§

fn eq_cmp(x: Self, y: Self)

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

source§

impl OrdLogic for i128

source§

fn cmp_log(self, o: Self) -> Ordering

logic

if self < o {
    Ordering::Less
} else if self == o {
    Ordering::Equal
} else {
    Ordering::Greater
}
source§

fn le_log(self, _: Self) -> bool

logic

source§

fn lt_log(self, _: Self) -> bool

logic

source§

fn ge_log(self, _: Self) -> bool

logic

source§

fn gt_log(self, _: Self) -> bool

logic

source§

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source§

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source§

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source§

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source§

fn refl(x: Self)

law

ensures

x.cmp_log(x) == Ordering::Equal

source§

fn trans(x: Self, y: Self, z: Self, o: Ordering)

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source§

fn antisym1(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source§

fn antisym2(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source§

fn eq_cmp(x: Self, y: Self)

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

source§

impl OrdLogic for isize

source§

fn cmp_log(self, o: Self) -> Ordering

logic

if self < o {
    Ordering::Less
} else if self == o {
    Ordering::Equal
} else {
    Ordering::Greater
}
source§

fn le_log(self, _: Self) -> bool

logic

source§

fn lt_log(self, _: Self) -> bool

logic

source§

fn ge_log(self, _: Self) -> bool

logic

source§

fn gt_log(self, _: Self) -> bool

logic

source§

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source§

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source§

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source§

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source§

fn refl(x: Self)

law

ensures

x.cmp_log(x) == Ordering::Equal

source§

fn trans(x: Self, y: Self, z: Self, o: Ordering)

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source§

fn antisym1(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source§

fn antisym2(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source§

fn eq_cmp(x: Self, y: Self)

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

source§

impl OrdLogic for u8

source§

fn cmp_log(self, o: Self) -> Ordering

logic

if self < o {
    Ordering::Less
} else if self == o {
    Ordering::Equal
} else {
    Ordering::Greater
}
source§

fn le_log(self, _: Self) -> bool

logic

source§

fn lt_log(self, _: Self) -> bool

logic

source§

fn ge_log(self, _: Self) -> bool

logic

source§

fn gt_log(self, _: Self) -> bool

logic

source§

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source§

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source§

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source§

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source§

fn refl(x: Self)

law

ensures

x.cmp_log(x) == Ordering::Equal

source§

fn trans(x: Self, y: Self, z: Self, o: Ordering)

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source§

fn antisym1(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source§

fn antisym2(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source§

fn eq_cmp(x: Self, y: Self)

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

source§

impl OrdLogic for u16

source§

fn cmp_log(self, o: Self) -> Ordering

logic

if self < o {
    Ordering::Less
} else if self == o {
    Ordering::Equal
} else {
    Ordering::Greater
}
source§

fn le_log(self, _: Self) -> bool

logic

source§

fn lt_log(self, _: Self) -> bool

logic

source§

fn ge_log(self, _: Self) -> bool

logic

source§

fn gt_log(self, _: Self) -> bool

logic

source§

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source§

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source§

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source§

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source§

fn refl(x: Self)

law

ensures

x.cmp_log(x) == Ordering::Equal

source§

fn trans(x: Self, y: Self, z: Self, o: Ordering)

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source§

fn antisym1(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source§

fn antisym2(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source§

fn eq_cmp(x: Self, y: Self)

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

source§

impl OrdLogic for u32

source§

fn cmp_log(self, o: Self) -> Ordering

logic

if self < o {
    Ordering::Less
} else if self == o {
    Ordering::Equal
} else {
    Ordering::Greater
}
source§

fn le_log(self, _: Self) -> bool

logic

source§

fn lt_log(self, _: Self) -> bool

logic

source§

fn ge_log(self, _: Self) -> bool

logic

source§

fn gt_log(self, _: Self) -> bool

logic

source§

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source§

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source§

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source§

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source§

fn refl(x: Self)

law

ensures

x.cmp_log(x) == Ordering::Equal

source§

fn trans(x: Self, y: Self, z: Self, o: Ordering)

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source§

fn antisym1(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source§

fn antisym2(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source§

fn eq_cmp(x: Self, y: Self)

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

source§

impl OrdLogic for u64

source§

fn cmp_log(self, o: Self) -> Ordering

logic

if self < o {
    Ordering::Less
} else if self == o {
    Ordering::Equal
} else {
    Ordering::Greater
}
source§

fn le_log(self, _: Self) -> bool

logic

source§

fn lt_log(self, _: Self) -> bool

logic

source§

fn ge_log(self, _: Self) -> bool

logic

source§

fn gt_log(self, _: Self) -> bool

logic

source§

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source§

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source§

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source§

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source§

fn refl(x: Self)

law

ensures

x.cmp_log(x) == Ordering::Equal

source§

fn trans(x: Self, y: Self, z: Self, o: Ordering)

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source§

fn antisym1(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source§

fn antisym2(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source§

fn eq_cmp(x: Self, y: Self)

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

source§

impl OrdLogic for u128

source§

fn cmp_log(self, o: Self) -> Ordering

logic

if self < o {
    Ordering::Less
} else if self == o {
    Ordering::Equal
} else {
    Ordering::Greater
}
source§

fn le_log(self, _: Self) -> bool

logic

source§

fn lt_log(self, _: Self) -> bool

logic

source§

fn ge_log(self, _: Self) -> bool

logic

source§

fn gt_log(self, _: Self) -> bool

logic

source§

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source§

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source§

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source§

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source§

fn refl(x: Self)

law

ensures

x.cmp_log(x) == Ordering::Equal

source§

fn trans(x: Self, y: Self, z: Self, o: Ordering)

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source§

fn antisym1(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source§

fn antisym2(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source§

fn eq_cmp(x: Self, y: Self)

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

source§

impl OrdLogic for usize

source§

fn cmp_log(self, o: Self) -> Ordering

logic

if self < o {
    Ordering::Less
} else if self == o {
    Ordering::Equal
} else {
    Ordering::Greater
}
source§

fn le_log(self, _: Self) -> bool

logic

source§

fn lt_log(self, _: Self) -> bool

logic

source§

fn ge_log(self, _: Self) -> bool

logic

source§

fn gt_log(self, _: Self) -> bool

logic

source§

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source§

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source§

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source§

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source§

fn refl(x: Self)

law

ensures

x.cmp_log(x) == Ordering::Equal

source§

fn trans(x: Self, y: Self, z: Self, o: Ordering)

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source§

fn antisym1(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source§

fn antisym2(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source§

fn eq_cmp(x: Self, y: Self)

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

source§

impl<A: OrdLogic, B: OrdLogic> OrdLogic for (A, B)

source§

fn cmp_log(self, o: Self) -> Ordering

logic

pearlite! { {
    let r = self.0.cmp_log(o.0);
    if r == Ordering::Equal {
        self.1.cmp_log(o.1)
    } else {
        r
    }
} }
source§

fn le_log(self, o: Self) -> bool

logic

pearlite! { (self.0 == o.0 && self.1 <= o.1) || self.0 < o.0 }

source§

fn lt_log(self, o: Self) -> bool

logic

pearlite! { (self.0 == o.0 && self.1 < o.1) || self.0 < o.0 }

source§

fn ge_log(self, o: Self) -> bool

logic

pearlite! { (self.0 == o.0 && self.1 >= o.1) || self.0 > o.0 }

source§

fn gt_log(self, o: Self) -> bool

logic

pearlite! { (self.0 == o.0 && self.1 > o.1) || self.0 > o.0 }

source§

fn cmp_le_log(x: Self, y: Self)

law

ensures

x.le_log(y) == (x.cmp_log(y) != Ordering::Greater)

source§

fn cmp_lt_log(x: Self, y: Self)

law

ensures

x.lt_log(y) == (x.cmp_log(y) == Ordering::Less)

source§

fn cmp_ge_log(x: Self, y: Self)

law

ensures

x.ge_log(y) == (x.cmp_log(y) != Ordering::Less)

source§

fn cmp_gt_log(x: Self, y: Self)

law

ensures

x.gt_log(y) == (x.cmp_log(y) == Ordering::Greater)

source§

fn refl(x: Self)

law

ensures

x.cmp_log(x) == Ordering::Equal

source§

fn trans(x: Self, y: Self, z: Self, o: Ordering)

law

requires

x.cmp_log(y) == o

requires

y.cmp_log(z) == o

ensures

x.cmp_log(z) == o

source§

fn antisym1(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Less

ensures

y.cmp_log(x) == Ordering::Greater

source§

fn antisym2(x: Self, y: Self)

law

requires

x.cmp_log(y) == Ordering::Greater

ensures

y.cmp_log(x) == Ordering::Less

source§

fn eq_cmp(x: Self, y: Self)

law

ensures

(x == y) == (x.cmp_log(y) == Ordering::Equal)

Implementors§