pub fn eval(&self, expression: &il::Expression) -> Result<Option<il::Constant>> {
        if expression.all_constants() {
            Ok(Some(eval(expression)?))
        } else if self.merged_constraints.is_empty() {
            Ok(solve(&self.path_constraints(), expression)?)
        }
        // If we have merged constraints, we need to assert that at least one
        // set of merged constraints is true
        else {
            let path_constraints = self
                .path_constraints()
                .into_iter()
                .fold(il::expr_const(1, 1), |sum, constraint| {
                    il::Expression::and(sum, constraint).unwrap()
                });
            let merged_constraints =
                self.merged_constraints()
                    .into_iter()
                    .fold(path_constraints, |ite, constraints| {
                        let constraints = constraints
                            .into_iter()
                            .fold(il::expr_const(1, 1), |sum, constraint| {
                                il::Expression::and(sum, constraint).unwrap()
                            });
                        il::Expression::ite(constraints, il::expr_const(1, 1), ite).unwrap()
                    });

            Ok(solve(&[merged_constraints], expression)?)
        }
    }
/// Evaluates the expression to a single, concrete value
Evaluates the expression to a single, concrete value
Evaluates the expression to a single concrete value
pub fn eval(&self, expression: &il::Expression) -> Result<Option<il::Constant>> {
        if expression.all_constants() {
            Ok(Some(eval(expression)?))
        } else if self.merged_constraints.is_empty() {
            Ok(solve(&self.path_constraints(), expression)?)
        }
        // If we have merged constraints, we need to assert that at least one
        // set of merged constraints is true
        else {
            let path_constraints = self
                .path_constraints()
                .into_iter()
                .fold(il::expr_const(1, 1), |sum, constraint| {
                    il::Expression::and(sum, constraint).unwrap()
                });
            let merged_constraints =
                self.merged_constraints()
                    .into_iter()
                    .fold(path_constraints, |ite, constraints| {
                        let constraints = constraints
                            .into_iter()
                            .fold(il::expr_const(1, 1), |sum, constraint| {
                                il::Expression::and(sum, constraint).unwrap()
                            });
                        il::Expression::ite(constraints, il::expr_const(1, 1), ite).unwrap()
                    });
            Ok(solve(&[merged_constraints], expression)?)
        }
    }
pub fn eval ( & self , expression : & il :: Expression ) -> Result < Option < il :: Constant > > { if expression . all_constants ( ) { Ok ( Some ( eval ( expression ) ? ) ) } else if self . merged_constraints . is_empty ( ) { Ok ( solve ( & self . path_constraints ( ) , expression ) ? ) } // If we have merged constraints, we need to assert that at least one // set of merged constraints is true else { let path_constraints = self . path_constraints ( ) . into_iter ( ) . fold ( il :: expr_const ( 1 , 1 ) , | sum , constraint | { il :: Expression :: and ( sum , constraint ) . unwrap ( ) } ) ; let merged_constraints = self . merged_constraints ( ) . into_iter ( ) . fold ( path_constraints , | ite , constraints | { let constraints = constraints . into_iter ( ) . fold ( il :: expr_const ( 1 , 1 ) , | sum , constraint | { il :: Expression :: and ( sum , constraint ) . unwrap ( ) } ) ; il :: Expression :: ite ( constraints , il :: expr_const ( 1 , 1 ) , ite ) . unwrap ( ) } ) ; Ok ( solve ( & [ merged_constraints ] , expression ) ? ) } }
Evaluates the expression to a single, concrete value
Evaluates the expression to a single concrete value
&self
expression
&il::Expression