(self, formula, **kwargs)
Add children to the stack.
Add children to the stack.
Add children to the stack .
def _push_with_children_to_stack(self, formula, **kwargs):
        """Add children to the stack."""

        # Deal with quantifiers
        if formula.is_quantifier():
            # 1. We create a new substitution in which we remove the
            #    bound variables from the substitution map
            substitutions = kwargs["substitutions"]
            new_subs = {}
            for k,v in substitutions.items():
                # If at least one bound variable is in the cone of k,
                # we do not consider this substitution in the body of
                # the quantifier.
                if all(m not in formula.quantifier_vars()
                       for m in k.get_free_variables()):
                    new_subs[k] = v

            # 2. We apply the substitution on the quantifier body with
            #    the new 'reduced' map
            sub = self.__class__(self.env)
            res_formula = sub.substitute(formula.arg(0), new_subs)

            # 3. We invoke the relevant function (walk_exists or
            #    walk_forall) to compute the substitution
            fun = self.functions[formula.node_type()]
            res = fun(formula, args=[res_formula], **kwargs)

            # 4. We memoize the result
            key = self._get_key(formula, **kwargs)
            self.memoization[key] = res
        else:
            pysmt.walkers.IdentityDagWalker._push_with_children_to_stack(self,
                                                                         formula,
                                                                         **kwargs)
def _push_with_children_to_stack ( self , formula , * * kwargs ) : # Deal with quantifiers if formula . is_quantifier ( ) : # 1. We create a new substitution in which we remove the #    bound variables from the substitution map substitutions = kwargs [ "substitutions" ] new_subs = { } for k , v in substitutions . items ( ) : # If at least one bound variable is in the cone of k, # we do not consider this substitution in the body of # the quantifier. if all ( m not in formula . quantifier_vars ( ) for m in k . get_free_variables ( ) ) : new_subs [ k ] = v # 2. We apply the substitution on the quantifier body with #    the new 'reduced' map sub = self . __class__ ( self . env ) res_formula = sub . substitute ( formula . arg ( 0 ) , new_subs ) # 3. We invoke the relevant function (walk_exists or #    walk_forall) to compute the substitution fun = self . functions [ formula . node_type ( ) ] res = fun ( formula , args = [ res_formula ] , * * kwargs ) # 4. We memoize the result key = self . _get_key ( formula , * * kwargs ) self . memoization [ key ] = res else : pysmt . walkers . IdentityDagWalker . _push_with_children_to_stack ( self , formula , * * kwargs )