public SearchArgument.TruthValue evaluate(SearchArgument.TruthValue[] leaves
                                            ) {
    SearchArgument.TruthValue result = null;
    switch (operator) {
      case OR:
        for(ExpressionTree child: children) {
          result = child.evaluate(leaves).or(result);
        }
        return result;
      case AND:
        for(ExpressionTree child: children) {
          result = child.evaluate(leaves).and(result);
        }
        return result;
      case NOT:
        return children.get(0).evaluate(leaves).not();
      case LEAF:
        return leaves[leaf.getId()];
      case CONSTANT:
        return constant;
      default:
        throw new IllegalStateException("Unknown operator: " + operator);
    }
  }
The inner representation of the SearchArgument. Most users should not
need this interface, it is only for file formats that need to translate
the SearchArgument into an internal form.
storage-api/src/java/org/apache/hadoop/hive/ql/io/sarg/ExpressionTree.java