AND result = new AND(a,b); if (result.operands.size() == 1) { return result.operands.iterator().next();
AND result = new AND(a,b); if (result.operands.size() == 1) { return result.operands.iterator().next();
public static SemanticContext and(SemanticContext a, SemanticContext b) { //System.out.println("AND: "+a+"&&"+b); if ( a==EMPTY_SEMANTIC_CONTEXT || a==null ) { return b; } if ( b==EMPTY_SEMANTIC_CONTEXT || b==null ) { return a; } if ( a.equals(b) ) { return a; // if same, just return left one } //System.out.println("## have to AND"); return new AND(a,b); }
public static SemanticContext and(SemanticContext a, SemanticContext b) { //System.out.println("AND: "+a+"&&"+b); if ( a==EMPTY_SEMANTIC_CONTEXT || a==null ) { return b; } if ( b==EMPTY_SEMANTIC_CONTEXT || b==null ) { return a; } if ( a.equals(b) ) { return a; // if same, just return left one } //System.out.println("## have to AND"); return new AND(a,b); }
public SemanticContext getGatedPredicateContext() { SemanticContext gatedLeft = left.getGatedPredicateContext(); SemanticContext gatedRight = right.getGatedPredicateContext(); if ( gatedLeft==null ) { return gatedRight; } if ( gatedRight==null ) { return gatedLeft; } return new AND(gatedLeft, gatedRight); } public boolean isSyntacticPredicate() {
public SemanticContext getGatedPredicateContext() { SemanticContext gatedLeft = left.getGatedPredicateContext(); SemanticContext gatedRight = right.getGatedPredicateContext(); if ( gatedLeft==null ) { return gatedRight; } if ( gatedRight==null ) { return gatedLeft; } return new AND(gatedLeft, gatedRight); }