Finite-arity decision trees -- definitions #
The original DecisionTree syntax uses natural-number query labels. Switching
arguments, however, count restrictions on exactly N variables. DecisionTree.On N makes that arity part of the type and prevents out-of-range queries.
@[implicit_reducible]
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Complexity.DecisionTree.instDecidableEqOn.decEq (Complexity.DecisionTree.On.leaf a) (Complexity.DecisionTree.On.leaf b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Complexity.DecisionTree.instDecidableEqOn.decEq (Complexity.DecisionTree.On.leaf value) (Complexity.DecisionTree.On.node index ifFalse ifTrue) = isFalse ⋯
- Complexity.DecisionTree.instDecidableEqOn.decEq (Complexity.DecisionTree.On.node index ifFalse ifTrue) (Complexity.DecisionTree.On.leaf value) = isFalse ⋯
Instances For
@[implicit_reducible]
Evaluate a finite-arity decision tree.
Equations
- One or more equations did not get rendered due to their size.
- Complexity.DecisionTree.On.eval input (Complexity.DecisionTree.On.leaf value) = value
Instances For
Maximum number of queries on any root-to-leaf path.
Equations
- (Complexity.DecisionTree.On.leaf value).depth = 0
- (Complexity.DecisionTree.On.node index ifFalse ifTrue).depth = max ifFalse.depth ifTrue.depth + 1
Instances For
Number of leaves.
Equations
- (Complexity.DecisionTree.On.leaf value).numLeaves = 1
- (Complexity.DecisionTree.On.node index ifFalse ifTrue).numLeaves = ifFalse.numLeaves + ifTrue.numLeaves
Instances For
Negate a decision tree by complementing every leaf.
Equations
- (Complexity.DecisionTree.On.leaf value).neg = Complexity.DecisionTree.On.leaf !value
- (Complexity.DecisionTree.On.node index ifFalse ifTrue).neg = Complexity.DecisionTree.On.node index ifFalse.neg ifTrue.neg
Instances For
Erase the arity proof from every query label.
Equations
- (Complexity.DecisionTree.On.leaf value).toDecisionTree = Complexity.DecisionTree.leaf value
- (Complexity.DecisionTree.On.node index ifFalse ifTrue).toDecisionTree = Complexity.DecisionTree.node (↑index) ifFalse.toDecisionTree ifTrue.toDecisionTree
Instances For
Simplify a finite decision tree under a matching restriction.
Equations
- One or more equations did not get rendered due to their size.
- Complexity.DecisionTree.On.restrict restriction (Complexity.DecisionTree.On.leaf value) = Complexity.DecisionTree.On.leaf value