Boolean decision trees as free query programs #
Each internal node asks for one Boolean reply. equivFreeM identifies decision trees with the
free programs of this query interface. Evaluating the tree on an assignment folds the free
program by reading that assignment at each query.
Ported from the PolyFunFrontier.PFunctor.Free.DecisionTree module of Verified-zkEVM/PolyFun
at revision 713d8857e49d20927c1447b3ba7397acc5537319.
Main definitions #
Cslib.DecisionTree.toFreeMandCslib.DecisionTree.ofFreeMtranslate in both directions.Cslib.DecisionTree.equivFreeMpackages the translations as an equivalence.
Main results #
Cslib.DecisionTree.eval_toFreeMidentifies the fold of a translated tree with its evaluation.Cslib.DecisionTree.eval_ofFreeMevaluates the tree obtained from a free program.
A decision tree as a free program: a leaf returns its output, and a node queries its variable and continues with the branch for the answer.
A free program over Boolean queries as a decision tree.
Decision trees over ι are exactly the free programs of the Boolean query interface
monomial ι Bool.
Evaluating a decision tree on x folds its free program, answering each query i by
x i.
A free program over Boolean queries, answered from x, returns what its decision tree
returns on x.