The dual of a decision tree #
The dual of a Boolean function f is x ↦ ¬ f(¬ x), with ¬ x the bitwise complement. The
dual of a decision tree (DecisionTree.dual) swaps the two children of every node and negates
every leaf. On x it follows the path of the original tree on ¬ x, with the same queries
(DecisionTree.queries_dual, DecisionTree.cost_dual), and outputs the negated leaf
(DecisionTree.eval_dual). So it computes the dual of the function computed by the original tree
(DecisionTree.Computes.dual), and a function and its dual have the same decision tree complexity
(DecisionTree.complexity_dual). For example, De Morgan duality turns OR into AND, so lower and
upper bounds for an OR-rooted formula transfer to the AND-rooted one.
Main definitions #
Cslib.DecisionTree.dual: swap the children of every node and negate every leaf.
Main results #
Cslib.DecisionTree.Computes.dual: the dual tree computes the dual function.Cslib.DecisionTree.complexity_dual:D(x ↦ ¬ f(¬ x)) = D(f).
The dual of a decision tree: swap the two children of every node and negate every leaf.
On x, the dual tree pays the original tree's query costs on ¬ x.
On x, the dual tree queries the variables that the original tree queries on ¬ x.
A function and its dual have the same decision tree complexity.