(self, formula, solver=None)
return False
Checks whether the model satisfies the formula.

        The optional solver argument is used to complete partial
        models.
Checks whether the model satisfies the formula.
Checks whether the model satisfies the formula .
def satisfies(self, formula, solver=None):
        """Checks whether the model satisfies the formula.

        The optional solver argument is used to complete partial
        models.
        """

        subs = self.get_values(formula.get_free_variables())
        simp = formula.substitute(subs).simplify()
        if simp.is_true():
            return True
        if simp.is_false():
            return False

        free_vars = simp.get_free_variables()
        if  len(free_vars) > 0:
            # Partial model
            return False

        if self.environment.enable_div_by_0 and solver is not None:
            # Models might not be simplified to a constant value
            # if there is a division by zero. We find the
            # division(s) and ask the solver for a replacement
            # expression.
            stack = [simp]
            div_0 = []
            while stack:
                x = stack.pop()
                if x.is_constant():
                    pass
                elif x.is_div() and x.arg(1).is_zero():
                    div_0.append(x)
                stack += x.args()

            subs = self.get_values(div_0)
            simp = simp.substitute(subs).simplify()
            return simp.is_true()
        return False
def satisfies ( self , formula , solver = None ) : subs = self . get_values ( formula . get_free_variables ( ) ) simp = formula . substitute ( subs ) . simplify ( ) if simp . is_true ( ) : return True if simp . is_false ( ) : return False free_vars = simp . get_free_variables ( ) if len ( free_vars ) > 0 : # Partial model return False if self . environment . enable_div_by_0 and solver is not None : # Models might not be simplified to a constant value # if there is a division by zero. We find the # division(s) and ask the solver for a replacement # expression. stack = [ simp ] div_0 = [ ] while stack : x = stack . pop ( ) if x . is_constant ( ) : pass elif x . is_div ( ) and x . arg ( 1 ) . is_zero ( ) : div_0 . append ( x ) stack += x . args ( ) subs = self . get_values ( div_0 ) simp = simp . substitute ( subs ) . simplify ( ) return simp . is_true ( ) return False