docs: private static void removeRedundantPredicates(List<BooleanExpr> children, boolean isConjunction) {
        for (int i = 0; i < children.size(); i++) {
           BooleanExpr ci = children.get(i);
           if (ci instanceof BooleanOperatorExpr || ci instanceof FullTextBoostExpr || ci instanceof FullTextOccurExpr) {
              // we may encounter non-predicate expressions, just ignore them
              continue;
           }
           boolean isCiNegated = ci instanceof NotExpr;
           if (isCiNegated) {
              ci = ((NotExpr) ci).getChild();
           }
           assert ci instanceof PrimaryPredicateExpr;
           PrimaryPredicateExpr ci1 = (PrimaryPredicateExpr) ci;
           assert ci1.getChild() instanceof PropertyValueExpr;
           PropertyValueExpr pve = (PropertyValueExpr) ci1.getChild();
           if (pve.isRepeated()) {
              // do not optimize repeated predicates
              continue;
           }
           int j = i + 1;
           while (j < children.size()) {
              BooleanExpr cj = children.get(j);
              // we may encounter non-predicate expressions, just ignore them
              if (!(cj instanceof BooleanOperatorExpr || cj instanceof FullTextBoostExpr || cj instanceof FullTextOccurExpr)) {
                 boolean isCjNegated = cj instanceof NotExpr;
                 if (isCjNegated) {
                    cj = ((NotExpr) cj).getChild();
                 }
                 PrimaryPredicateExpr cj1 = (PrimaryPredicateExpr) cj;
                 assert cj1.getChild() instanceof PropertyValueExpr;
                 PropertyValueExpr pve2 = (PropertyValueExpr) cj1.getChild();
                 // do not optimize repeated predicates
                 if (!pve2.isRepeated()) {
                    int res = comparePrimaryPredicates(isCiNegated, ci1, isCjNegated, cj1);
                    if (res == 0) {
                       // found duplication
                       children.remove(j);
                       continue;
                    } else if (res == 1) {
                       // found tautology or contradiction
                       children.clear();
                       children.add(ConstantBooleanExpr.forBoolean(!isConjunction));
                       return;
                    }
                 }
              }
              j++;
           }
        }
     }