pub fn symbolize_expression(&self, expression: &il::Expression) -> Result<il::Expression> {
        Ok(match *expression {
            il::Expression::Scalar(ref scalar) => match self.scalars.get(scalar.name()) {
                Some(expr) => expr.clone().into(),
                None => il::Expression::Scalar(scalar.clone()),
            },
            il::Expression::Constant(_) => expression.clone(),
            il::Expression::Add(ref lhs, ref rhs) => il::Expression::add(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Sub(ref lhs, ref rhs) => il::Expression::sub(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Mul(ref lhs, ref rhs) => il::Expression::mul(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Divu(ref lhs, ref rhs) => il::Expression::divu(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Modu(ref lhs, ref rhs) => il::Expression::modu(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Divs(ref lhs, ref rhs) => il::Expression::divs(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Mods(ref lhs, ref rhs) => il::Expression::mods(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::And(ref lhs, ref rhs) => il::Expression::and(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Or(ref lhs, ref rhs) => il::Expression::or(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Xor(ref lhs, ref rhs) => il::Expression::xor(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Shl(ref lhs, ref rhs) => il::Expression::shl(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Shr(ref lhs, ref rhs) => il::Expression::shr(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            #[cfg(feature = "il-expression-ashr")]
            il::Expression::AShr(ref lhs, ref rhs) => il::Expression::ashr(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Cmpeq(ref lhs, ref rhs) => il::Expression::cmpeq(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Cmpneq(ref lhs, ref rhs) => il::Expression::cmpneq(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Cmplts(ref lhs, ref rhs) => il::Expression::cmplts(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Cmpltu(ref lhs, ref rhs) => il::Expression::cmpltu(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Zext(bits, ref src) => {
                il::Expression::zext(bits, self.symbolize_expression(src)?)?
            }
            il::Expression::Sext(bits, ref src) => {
                il::Expression::sext(bits, self.symbolize_expression(src)?)?
            }
            il::Expression::Trun(bits, ref src) => {
                il::Expression::trun(bits, self.symbolize_expression(src)?)?
            }
            il::Expression::Ite(ref cond, ref then, ref else_) => il::Expression::ite(
                self.symbolize_expression(cond)?,
                self.symbolize_expression(then)?,
                self.symbolize_expression(else_)?,
            )?,
        })
    }
/// Symbolize an expression, replacing all scalars with the concrete values
/// stored in this state.
Symbolize an expression, replacing all scalars with the concrete values
stored in this state.
Symbolize an expression replacing all scalars with the concrete values stored in this state .
pub fn symbolize_expression(&self, expression: &il::Expression) -> Result<il::Expression> {
        Ok(match *expression {
            il::Expression::Scalar(ref scalar) => match self.scalars.get(scalar.name()) {
                Some(expr) => expr.clone().into(),
                None => il::Expression::Scalar(scalar.clone()),
            },
            il::Expression::Constant(_) => expression.clone(),
            il::Expression::Add(ref lhs, ref rhs) => il::Expression::add(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Sub(ref lhs, ref rhs) => il::Expression::sub(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Mul(ref lhs, ref rhs) => il::Expression::mul(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Divu(ref lhs, ref rhs) => il::Expression::divu(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Modu(ref lhs, ref rhs) => il::Expression::modu(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Divs(ref lhs, ref rhs) => il::Expression::divs(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Mods(ref lhs, ref rhs) => il::Expression::mods(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::And(ref lhs, ref rhs) => il::Expression::and(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Or(ref lhs, ref rhs) => il::Expression::or(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Xor(ref lhs, ref rhs) => il::Expression::xor(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Shl(ref lhs, ref rhs) => il::Expression::shl(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Shr(ref lhs, ref rhs) => il::Expression::shr(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            #[cfg(feature = "il-expression-ashr")]
            il::Expression::AShr(ref lhs, ref rhs) => il::Expression::ashr(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Cmpeq(ref lhs, ref rhs) => il::Expression::cmpeq(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Cmpneq(ref lhs, ref rhs) => il::Expression::cmpneq(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Cmplts(ref lhs, ref rhs) => il::Expression::cmplts(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Cmpltu(ref lhs, ref rhs) => il::Expression::cmpltu(
                self.symbolize_expression(lhs)?,
                self.symbolize_expression(rhs)?,
            )?,
            il::Expression::Zext(bits, ref src) => {
                il::Expression::zext(bits, self.symbolize_expression(src)?)?
            }
            il::Expression::Sext(bits, ref src) => {
                il::Expression::sext(bits, self.symbolize_expression(src)?)?
            }
            il::Expression::Trun(bits, ref src) => {
                il::Expression::trun(bits, self.symbolize_expression(src)?)?
            }
            il::Expression::Ite(ref cond, ref then, ref else_) => il::Expression::ite(
                self.symbolize_expression(cond)?,
                self.symbolize_expression(then)?,
                self.symbolize_expression(else_)?,
            )?,
        })
    }
pub fn symbolize_expression ( & self , expression : & il :: Expression ) -> Result < il :: Expression > { Ok ( match * expression { il :: Expression :: Scalar ( ref scalar ) => match self . scalars . get ( scalar . name ( ) ) { Some ( expr ) => expr . clone ( ) . into ( ) , None => il :: Expression :: Scalar ( scalar . clone ( ) ) , } , il :: Expression :: Constant ( _ ) => expression . clone ( ) , il :: Expression :: Add ( ref lhs , ref rhs ) => il :: Expression :: add ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Sub ( ref lhs , ref rhs ) => il :: Expression :: sub ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Mul ( ref lhs , ref rhs ) => il :: Expression :: mul ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Divu ( ref lhs , ref rhs ) => il :: Expression :: divu ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Modu ( ref lhs , ref rhs ) => il :: Expression :: modu ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Divs ( ref lhs , ref rhs ) => il :: Expression :: divs ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Mods ( ref lhs , ref rhs ) => il :: Expression :: mods ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: And ( ref lhs , ref rhs ) => il :: Expression :: and ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Or ( ref lhs , ref rhs ) => il :: Expression :: or ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Xor ( ref lhs , ref rhs ) => il :: Expression :: xor ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Shl ( ref lhs , ref rhs ) => il :: Expression :: shl ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Shr ( ref lhs , ref rhs ) => il :: Expression :: shr ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , # [ cfg ( feature " " ) ] il :: Expression :: AShr ( ref lhs , ref rhs ) => il :: Expression :: ashr ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Cmpeq ( ref lhs , ref rhs ) => il :: Expression :: cmpeq ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Cmpneq ( ref lhs , ref rhs ) => il :: Expression :: cmpneq ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Cmplts ( ref lhs , ref rhs ) => il :: Expression :: cmplts ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Cmpltu ( ref lhs , ref rhs ) => il :: Expression :: cmpltu ( self . symbolize_expression ( lhs ) ? , self . symbolize_expression ( rhs ) ? , ) ? , il :: Expression :: Zext ( bits , ref src ) => { il :: Expression :: zext ( bits , self . symbolize_expression ( src ) ? ) ? } il :: Expression :: Sext ( bits , ref src ) => { il :: Expression :: sext ( bits , self . symbolize_expression ( src ) ? ) ? } il :: Expression :: Trun ( bits , ref src ) => { il :: Expression :: trun ( bits , self . symbolize_expression ( src ) ? ) ? } il :: Expression :: Ite ( ref cond , ref then , ref else_ ) => il :: Expression :: ite ( self . symbolize_expression ( cond ) ? , self . symbolize_expression ( then ) ? , self . symbolize_expression ( else_ ) ? , ) ? , } ) }
Symbolize an expression, replacing all scalars with the concrete values
stored in this state.
Symbolize an expression replacing all scalars with the concrete values stored in this state .
&self
expression
&il::Expression
&self
expression
&il::Expression