wmpy.core.polynomial.PolynomialParser¶
- class PolynomialParser(variables)[source]¶
Bases:
DagWalkerA walker to parse a polynomial expression (pysmt.FNode) into a dictionary of monomials.
The flag
invalidate_memoizationcan be used to clear the cache after the walk has been completed: the cache is one-time use.Methods
Performs an iterative walk of the DAG
parseOverrides the default walking function for each of the specified node_types with the given function
Associate in cls the given function to the given node_types.
Call the correct walk_* function of cls for the given formula.
walkDefault function for a node that is not handled by the Walker.
Returns True if all the children returned True.
Default function for a node that is not handled by the Walker.
Returns True if any of the children returned True.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Returns False, independently from the children's value.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Returns formula, independently from the childrens's value.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Returns None, independently from the children's value.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Default function for a node that is not handled by the Walker.
Returns True, independently from the children's value.
- iter_walk(formula, **kwargs)¶
Performs an iterative walk of the DAG
- set_function(function, *node_types)¶
Overrides the default walking function for each of the specified node_types with the given function
- classmethod set_handler(function, *node_types)¶
Associate in cls the given function to the given node_types.
- classmethod super(self, formula, *args, **kwargs)¶
Call the correct walk_* function of cls for the given formula.
- walk_algebraic_constant(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_all(formula, args, **kwargs)¶
Returns True if all the children returned True.
- walk_and(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_any(formula, args, **kwargs)¶
Returns True if any of the children returned True.
- walk_array_select(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_array_store(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_array_value(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bool_constant(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_add(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_and(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_ashr(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_comp(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_concat(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_constant(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_extract(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_lshl(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_lshr(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_mul(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_neg(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_not(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_or(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_rol(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_ror(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_sdiv(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_sext(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_sle(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_slt(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_srem(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_sub(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_tonatural(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_udiv(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_ule(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_ult(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_urem(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_xor(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_bv_zext(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_div(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_equals(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_error(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_exists(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_false(formula, args, **kwargs)¶
Returns False, independently from the children’s value.
- walk_forall(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_function(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_identity(formula, **kwargs)¶
Returns formula, independently from the childrens’s value.
- walk_iff(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_implies(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_int_constant(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_int_to_str(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_ite(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_le(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_lt(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_minus(formula, args, **kwargs)[source]¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_none(formula, args, **kwargs)¶
Returns None, independently from the children’s value.
- walk_not(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_or(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_plus(formula, args, **kwargs)[source]¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_pow(formula, args, **kwargs)[source]¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_real_constant(formula, **kwargs)[source]¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_str_charat(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_str_concat(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_str_constant(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_str_contains(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_str_indexof(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_str_length(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_str_prefixof(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_str_replace(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_str_substr(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_str_suffixof(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_str_to_int(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_symbol(formula, **kwargs)[source]¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_times(formula, args, **kwargs)[source]¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_toreal(formula, **kwargs)¶
Default function for a node that is not handled by the Walker.
This tries to handle the node using the Dynamic Walker Function information from the environment. If this fails, then an UnsupportedOperatorError exception is given.
- walk_true(formula, args, **kwargs)¶
Returns True, independently from the children’s value.