class documentation
class Balancer: (source)
The Balancer is an equation redistributor. The idea is to take an AST and rebalance it to, for example, isolate unknown terms on one side of an inequality.
Method | __init__ |
Undocumented |
Class Variable | comparison |
Undocumented |
Instance Variable | sat |
Undocumented |
Property | compat |
Undocumented |
Property | replacements |
Undocumented |
Static Method | _adjust |
Swap the operands of the truism if the unknown variable is on the right side and the concrete value is on the left side. |
Static Method | _balance |
Undocumented |
Static Method | _balance |
Undocumented |
Static Method | _balance |
Undocumented |
Static Method | _balance_ |
Undocumented |
Static Method | _balance_ |
Undocumented |
Static Method | _balance_ |
Undocumented |
Static Method | _balance_ |
Undocumented |
Static Method | _balance_ |
Undocumented |
Static Method | _cardinality |
Undocumented |
Static Method | _get |
Given a constraint, _get_assumptions() returns a set of constraints that are implicitly assumed to be true. For example, `x <= 10` would return `x >= 0`. |
Static Method | _handleable |
Checks whether we can handle this truism. The truism should already be aligned. |
Static Method | _invert |
Undocumented |
Static Method | _max |
Undocumented |
Static Method | _min |
Undocumented |
Static Method | _reverse |
Undocumented |
Method | _add |
Undocumented |
Method | _add |
Undocumented |
Method | _align |
Undocumented |
Method | _align |
Aligns the AST so that the argument with the highest cardinality is on the left. |
Method | _align |
Undocumented |
Method | _align |
Undocumented |
Method | _balance |
Undocumented |
Method | _balance |
Undocumented |
Method | _balance_ |
Undocumented |
Method | _doit |
This function processes the list of truisms and finds bounds for ASTs. |
Method | _handle |
Undocumented |
Method | _handle |
Undocumented |
Method | _handle |
Undocumented |
Method | _handle |
Handles all comparisons. |
Method | _handle_ |
Undocumented |
Method | _queue |
Undocumented |
Method | _queue |
Undocumented |
Method | _range |
Undocumented |
Method | _replacements |
Undocumented |
Method | _same |
Undocumented |
Method | _unpack |
Given a constraint, _unpack_truisms() returns a set of constraints that must be True for this constraint to be True. |
Method | _unpack_truisms_ |
Undocumented |
Method | _unpack_truisms_ |
Undocumented |
Method | _unpack_truisms_ |
Undocumented |
Instance Variable | _helper |
Undocumented |
Instance Variable | _identified |
Undocumented |
Instance Variable | _lower |
Undocumented |
Instance Variable | _processed |
Undocumented |
Instance Variable | _truisms |
Undocumented |
Instance Variable | _upper |
Undocumented |
Instance Variable | _validation |
Undocumented |
Swap the operands of the truism if the unknown variable is on the right side and the concrete value is on the left side.
Given a constraint, _get_assumptions() returns a set of constraints that are implicitly assumed to be true. For example, `x <= 10` would return `x >= 0`.
Aligns the AST so that the argument with the highest cardinality is on the left. :return: a new AST.