Documentation

Complexity.Computability.DecisionTree.NormalForm

Decision trees in normal form #

The paths of a decision tree to leaves labelled true are the terms of a formula in disjunctive normal form computing the same function (DecisionTree.toDNF), and the paths to leaves labelled false, negated, are the clauses of a formula in conjunctive normal form (DecisionTree.toCNF). A path reads each variable at most once, a variable read again following the branch of its first reading, so the terms and clauses have distinct variables and at most depth literals Jukna, Section 14.1. So a function of decision tree depth t is a disjunction of terms and a conjunction of clauses of width at most t.

Main definitions #

Main results #

References #

def Cslib.DecisionTree.map {ι : Type u_1} {β : Type u_2} {γ : Type u_3} (f : β → γ) :
DecisionTree ι β → DecisionTree ι γ

Relabel the leaves of a decision tree.

Instances For
    @[simp]
    theorem Cslib.DecisionTree.eval_map {ι : Type u_1} {β : Type u_2} {γ : Type u_3} (f : β → γ) (t : DecisionTree ι β) (x : ι → Bool) :
    (map f t).eval x = f (t.eval x)
    @[simp]
    theorem Cslib.DecisionTree.depth_map {ι : Type u_1} {β : Type u_2} {γ : Type u_3} (f : β → γ) (t : DecisionTree ι β) :
    (map f t).depth = t.depth

    The terms of the paths of a decision tree to leaves labelled true, each extending the term p of the path so far; a variable already in p is not read again.

    Instances For

      The formula in disjunctive normal form of the paths of a decision tree to leaves labelled true.

      Instances For

        The formula in conjunctive normal form of the negated paths of a decision tree to leaves labelled false.

        Instances For
          @[simp]
          theorem Cslib.DecisionTree.eval_toDNF {ι : Type u_1} [DecidableEq ι] (t : DecisionTree ι Bool) (x : ι → Bool) :

          The paths to leaves labelled true compute the tree.

          @[simp]
          theorem Cslib.DecisionTree.eval_toCNF {ι : Type u_1} [DecidableEq ι] (t : DecisionTree ι Bool) (x : ι → Bool) :

          The negated paths to leaves labelled false compute the tree.

          The terms of the normal form of a tree have at most depth literals.

          The terms of the normal form of a tree read each variable once.

          The clauses of the conjunctive normal form of a tree have at most depth literals.