pub enum Pred {
Eq,
EqRange,
Gt,
Lt,
Gte,
Lte,
And,
Or,
Not,
EqSet,
BitAnd,
BitOr,
}
Expand description
Operations for computing predicates.
Variants§
Eq
EqRange
0x11
: EQRA
Check equality of two ranges on the stack.
The ranges must be of equal length.
The ranges must be stacked sequentially.
Here N
is len -1
.
§Stack Input
[arr_a_0, ..arr_a_N, arr_b_0, ..arr_b_N, len]
§Stack Output
[(top-(2*len))..(top - len) == (top - len)..top]
Gt
0x12
Check if left-hand side is greater than right-hand side.
§Stack Input
[lhs, rhs]
§Stack Output
[lhs > rhs]
Lt
0x13
Check if left-hand side is less than right-hand side.
§Stack Input
[lhs, rhs]
§Stack Output
[lhs < rhs]
Gte
0x14
Check if left-hand side is greater than or equal to right-hand side.
§Stack Input
[lhs, rhs]
§Stack Output
[lhs >= rhs]
Lte
0x15
Check if left-hand side is less than or equal to right-hand side.
§Stack Input
[lhs, rhs]
§Stack Output
[lhs <= rhs]
And
Or
Not
EqSet
0x19
: EQST
Pop two sets off the stack and check if they are equal. This is set equality so order does not matter. Sets must be the same length.
Note the encoding of each set is:
[elem_0_word_0, ...elem_0_word_I, elem_0_len, ...elem_N_word_0, ...elem_N_word_J, elem_N_len, set_len]
.
Note this differs from EqRange
in that there is a size given at the end of both sets.
§Stack Input
[lhs, lhs_set_length, rhs, rhs_set_length]
§Stack Output
[set(lhs) == set(rhs)]
BitAnd
BitOr
Trait Implementations§
Source§impl From<Pred> for Constraint
impl From<Pred> for Constraint
Source§fn from(subgroup: Pred) -> Constraint
fn from(subgroup: Pred) -> Constraint
Source§impl Ord for Pred
impl Ord for Pred
Source§impl PartialOrd for Pred
impl PartialOrd for Pred
Source§impl TryFromBytes for Pred
impl TryFromBytes for Pred
impl Copy for Pred
impl Eq for Pred
impl StructuralPartialEq for Pred
Auto Trait Implementations§
impl Freeze for Pred
impl RefUnwindSafe for Pred
impl Send for Pred
impl Sync for Pred
impl Unpin for Pred
impl UnwindSafe for Pred
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more