Removing repeated decision-tree queries #
prune remembers every observed answer in a partial assignment. Queries already answered are
skipped. On agreeing inputs it preserves evaluation and decreases pointwise natural weighted
cost; on a finite coordinate space its depth is bounded by the initially free coordinates.
A pruned tree never queries a coordinate twice on a path
(DecisionTree.queriesDistinctFrom_prune), as the book insists for decision trees
O'Donnell, Definition 3.13, and it has no more leaves than the original
(DecisionTree.leafCount_prune_le). So bounds in terms of the leaves of trees without repeated
queries transfer to every tree.
Main definitions #
Cslib.DecisionTree.prune: remove queries already fixed along the execution path.Cslib.DecisionTree.QueriesDistinctFrom,Cslib.DecisionTree.QueriesDistinct: no path queries a coordinate twice.
Main results #
Cslib.DecisionTree.eval_prune_of_agrees: agreeing inputs retain their output.Cslib.DecisionTree.weightedCost_prune_le_of_agrees: their weighted query cost does not grow.Cslib.DecisionTree.depth_prune_le_card_free: each initially free coordinate is read at most once along any remaining structural path.Cslib.DecisionTree.queriesDistinctFrom_prune,Cslib.DecisionTree.leafCount_prune_le: pruned trees never repeat a query and have no more leaves.
References #
Prune queries whose answers are known, recording each newly queried coordinate before
recursing. Unlike restrict, the assignment grows along each branch.
Pruning preserves evaluation on inputs agreeing with the initial assignment.
Pruning never increases the weighted cost on an agreeing input. Costs may be zero.
The depth after pruning is at most the number of initially free coordinates.
No path of the tree queries a coordinate of A, or any coordinate twice.
No path of the tree queries a coordinate twice, as the book insists for decision trees O'Donnell, Definition 3.13.
A tree that avoids A never queries a coordinate of A.
Pruning does not add leaves.
A pruned tree never repeats a query, nor queries a coordinate fixed by ρ.