private static final boolean isQNFLiteralOrNot(Condition<?> condition) { if (condition instanceof Not) { Condition child = ((Not) condition).getChild(); if (!isQNFLiteral(child)) return false; else if (child instanceof PredicateCondition) { return !((PredicateCondition) child).getPredicate().hasNegation(); } else return true; } else return isQNFLiteral(condition); }
@Nullable @Override public Condition<E> apply(@Nullable Condition<E> cond) { if (cond instanceof Not) { Condition<E> child = ((Not) cond).getChild(); Preconditions.checkArgument(child.getType() == Condition.Type.LITERAL); //verify QNF if (child instanceof PredicateCondition) { PredicateCondition<?, E> pc = (PredicateCondition) child; if (pc.getPredicate().hasNegation()) { return new PredicateCondition(pc.getKey(), pc.getPredicate().negate(), pc.getValue()); } } } return null; } });
private static final boolean isQNFLiteralOrNot(Condition<?> condition) { if (condition instanceof Not) { Condition child = ((Not) condition).getChild(); if (!isQNFLiteral(child)) return false; else if (child instanceof PredicateCondition) { return !((PredicateCondition) child).getPredicate().hasNegation(); } else return true; } else return isQNFLiteral(condition); }
private static final boolean isQNFLiteralOrNot(Condition<?> condition) { if (condition instanceof Not) { Condition child = ((Not) condition).getChild(); if (!isQNFLiteral(child)) return false; else if (child instanceof PredicateCondition) { return !((PredicateCondition) child).getPredicate().hasNegation(); } else return true; } else return isQNFLiteral(condition); }
@Nullable @Override public Condition<E> apply(@Nullable Condition<E> cond) { if (cond instanceof Not) { Condition<E> child = ((Not) cond).getChild(); Preconditions.checkArgument(child.getType() == Condition.Type.LITERAL); //verify QNF if (child instanceof PredicateCondition) { PredicateCondition<?, E> pc = (PredicateCondition) child; if (pc.getPredicate().hasNegation()) { return new PredicateCondition(pc.getKey(), pc.getPredicate().negate(), pc.getValue()); } } } return null; } });
@Nullable @Override public Condition<E> apply(@Nullable Condition<E> cond) { if (cond instanceof Not) { Condition<E> child = ((Not) cond).getChild(); Preconditions.checkArgument(child.getType() == Condition.Type.LITERAL); //verify QNF if (child instanceof PredicateCondition) { PredicateCondition<?, E> pc = (PredicateCondition) child; if (pc.getPredicate().hasNegation()) { return new PredicateCondition(pc.getKey(), pc.getPredicate().negate(), pc.getValue()); } } } return null; } });