public static Expression predicateRemoveNot(Expression predicate) {
    if (predicate.getExpressionType().equals(ExpressionType.LOGIC_AND)) {
      return ExpressionFactory.and(
          predicateRemoveNot(((BinaryExpression) predicate).getLeftExpression()),
          predicateRemoveNot(((BinaryExpression) predicate).getRightExpression()));
    } else if (predicate.getExpressionType().equals(ExpressionType.LOGIC_OR)) {
      return ExpressionFactory.or(
          predicateRemoveNot(((BinaryExpression) predicate).getLeftExpression()),
          predicateRemoveNot(((BinaryExpression) predicate).getRightExpression()));
    } else if (predicate.getExpressionType().equals(ExpressionType.LOGIC_NOT)) {
      return reversePredicate(((LogicNotExpression) predicate).getExpression());
    }
    return predicate;
  }
Recursively removes all use of the not() operator in a predicate by replacing all instances of
not(x) with the inverse(x),

<p>eg: not(and(eq(), not(eq(y))) -&gt; or(notEq(), eq(y))

<p>The returned predicate should have the same meaning as the original, but without the use of
the not() operator.

<p>See also {@link PredicateUtils#reversePredicate(Expression)}, which is used to do the
inversion.

@param predicate the predicate to remove not() from
@return the predicate with all not() operators removed
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/PredicateUtils.java