@Override public Expression f(Expression previousAtom, Function currentAtom) { return TERM_FACTORY.getFunctionAND(previousAtom, currentAtom); } }, firstBooleanAtom);
@Override public Expression f(Expression previousAtom, Function currentAtom) { return termFactory.getFunctionAND(previousAtom, currentAtom); } }, firstBooleanAtom);
private Function getAND(ImmutableList<Function> list) { return list.reverse().stream() .reduce(null, (a, b) -> (a == null) ? b : TERM_FACTORY.getFunctionAND(b, a)); }
private Function getAND(ImmutableList<Function> list) { return list.reverse().stream() .reduce(null, (a, b) -> (a == null) ? b : termFactory.getFunctionAND(b, a)); }
/*** * Takes a list of boolean atoms and returns one single atom * representing the conjunction * * ASSUMPTION: the list is non-empty * * Example: A -> A * A, B -> AND(B,A) * A, B, C -> AND(C,AND(B,A)) * */ private Function getMergedByAND(List<Function> list) { Iterator<Function> iterAND = list.iterator(); Function mergedConditions = iterAND.next(); while (iterAND.hasNext()) { Function e = iterAND.next(); mergedConditions = termFactory.getFunctionAND(e, mergedConditions); } return mergedConditions; }
/*** * Takes a list of boolean atoms and returns one single atom * representing the conjunction * * ASSUMPTION: the list is non-empty * * Example: A -> A * A, B -> AND(B,A) * A, B, C -> AND(C,AND(B,A)) * */ private static Function getMergedByAND(List<Function> list) { Iterator<Function> iterAND = list.iterator(); Function mergedConditions = iterAND.next(); while (iterAND.hasNext()) { Function e = iterAND.next(); mergedConditions = TERM_FACTORY.getFunctionAND(e, mergedConditions); } return mergedConditions; }
private Term evalAnd(Term t1, Term t2) { Term e1 = eval(t1); Term e2 = eval(t2); if (e1 == valueFalse || e2 == valueFalse) return valueFalse; if (e1 == valueTrue) return e2; if (e2 == valueTrue) return e1; return termFactory.getFunctionAND(e1, e2); }
private Term evalAnd(Term t1, Term t2) { Term e1 = eval(t1); Term e2 = eval(t2); if (e1 == TermConstants.FALSE || e2 == TermConstants.FALSE) return TermConstants.FALSE; if (e1 == TermConstants.TRUE) return e2; if (e2 == TermConstants.TRUE) return e1; return TERM_FACTORY.getFunctionAND(e1, e2); }
if (temp.size() == 2) { if (isEqual){ result = termFactory.getFunctionAND(temp.get(0), temp.get(1)); }else{ result = termFactory.getFunctionOR(temp.get(0), temp.get(1));
if (temp.size() == 2) { if (isEqual){ result = TERM_FACTORY.getFunctionAND(temp.get(0), temp.get(1)); }else{ result = TERM_FACTORY.getFunctionOR(temp.get(0), temp.get(1));
return termFactory.getFunctionAND(term1, term2);