/** * Evaluate the constraints given the right object, left tuple * (null for alpha nodes) and the state. * @param right The right input object. * @param left The left input tuple. * @param state The working memory. */ public boolean evaluate(Object right, Tuple left, IOAVState state) { // System.out.println("Not match: "+left+", "+right); Tuple tright = (Tuple)right; int diff = tright.size() - left.size(); for(int i=0; i<diff; i++) tright = tright.getLastTuple(); return left.equals(tright); }
/** * Evaluate the constraints given the right object, left tuple * (null for alpha nodes) and the state. * @param right The right input object. * @param left The left input tuple. * @param state The working memory. */ public boolean evaluate(Object right, Tuple left, IOAVState state) { // System.out.println("Not match: "+left+", "+right); Tuple tright = (Tuple)right; int diff = tright.size() - left.size(); for(int i=0; i<diff; i++) tright = tright.getLastTuple(); return left.equals(tright); }