[][src]Enum falcon::il::Expression

An IL Expression.

Variants

Scalar(Scalar)
Constant(Constant)

Methods

impl Expression[src]

pub fn bits(&self) -> usize[src]

Return the bitness of this expression.

pub fn replace_scalar(
    &self,
    scalar: &Scalar,
    expression: &Expression
) -> Result<Expression>
[src]

Return a clone of this expression, but with every occurrence of the given scalar replaced with the given expression

pub fn all_constants(&self) -> bool[src]

Return true if all terminals in this expression are Constant

pub fn scalars(&self) -> Vec<&Scalar>[src]

Returns all Scalars used in this Expression

pub fn scalars_mut(&mut self) -> Vec<&mut Scalar>[src]

Return mutable references to all Scalars in this Expression.

pub fn get_scalar(&self) -> Option<&Scalar>[src]

If this expression is a scalar, return the scalar

pub fn get_constant(&self) -> Option<&Constant>[src]

If this expression is a constant, return the constant

pub fn scalar(scalar: Scalar) -> Expression[src]

Create a new Expression from a Scalar.

pub fn constant(constant: Constant) -> Expression[src]

Create a new Expression from a Constant.

pub fn add(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create an addition Expression.

Error

The sort of the lhs and the rhs are not the same

pub fn sub(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create a subtraction Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn mul(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create an unsigned multiplication Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn divu(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create an unsigned division Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn modu(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create an unsigned modulus Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn divs(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create a signed division Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn mods(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create a signed modulus Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn and(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create a binary and Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn or(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create a binary or Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn xor(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create a binary xor Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn shl(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create a logical shift-left Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn shr(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create a logical shift-right Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn cmpeq(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create an equals comparison Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn cmpneq(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create an not equals comparison Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn cmpltu(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create an unsigned less-than comparison Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn cmplts(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Create a signed less-than comparison Expression.

Error

The sort of the lhs and the rhs are not the same.

pub fn zext(bits: usize, src: Expression) -> Result<Expression>[src]

Create an expression to zero-extend src to the number of bits specified in bits.

Error

src has more or equal number of bits than bits

pub fn sext(bits: usize, src: Expression) -> Result<Expression>[src]

Create an expression to sign-extend src to the number of bits specified

Error

src has more or equal number of bits than bits

pub fn trun(bits: usize, src: Expression) -> Result<Expression>[src]

Create an expression to truncate the number of bits in src to the number of bits given.

Error

src has less-than or equal bits than bits

pub fn ite(
    cond: Expression,
    then: Expression,
    else_: Expression
) -> Result<Expression>
[src]

Create an if-than-else expression

Error

condition is not 1-bit, or bitness of then and else_ do not match.

pub fn sra(lhs: Expression, rhs: Expression) -> Result<Expression>[src]

Perform a shift-right arithmetic

This is a pseudo-expression, and emits an expression with sub-expressions

pub fn rotl(e: Expression, s: Expression) -> Result<Expression>[src]

Perform a left-rotation

This is a pseudo-expression, and emits an expression with sub-expressions

Trait Implementations

impl Clone for Expression[src]

impl Debug for Expression[src]

impl<'de> Deserialize<'de> for Expression[src]

impl Display for Expression[src]

impl Eq for Expression[src]

impl Hash for Expression[src]

impl Into<Expression> for Constant[src]

impl Into<Expression> for Scalar[src]

impl Ord for Expression[src]

impl PartialEq<Expression> for Expression[src]

impl PartialOrd<Expression> for Expression[src]

impl Serialize for Expression[src]

impl StructuralEq for Expression[src]

impl StructuralPartialEq for Expression[src]

impl Value for Expression[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.