This class is extended within tt and is not meant to be used
directly.

If you plan to extend it, note that descendants of this class
must compute the _is_cnf, _is_dnf, and _is_really_unary boolean
attributes and the _non_negated_symbol_set and _negated_symbol_set
set attributes within their initialization. Additionally, descendants of
this class must implemented the __eq__ magic method (but not
__ne__) as well as the private _copy transformation.

In the latter of the two above examples, we see that this
transformation will compare operands with negations condensed. This
transformation will also prune redundant operands from CNF and DNF
clauses. Let’s take a look:

Note that this transformation will not reduce expressions of
constants; the transformation apply_identity_law will
probably do what you want in this case, though.

This transformation will also reduce expressions in CNF or DNF that
contain negated and non-negated forms of the same symbol. Let’s take a
look:

>>> fromttimportBooleanExpression>>> tree=BooleanExpression('A or B or C or ~B').tree>>> print(tree.apply_inverse_law())1>>> tree=BooleanExpression('A and B and C and !B').tree>>> print(tree.apply_inverse_law())0