// input
// constraints
for (Iterator<Tuple> it = outputConstraints.iterator(); it
.hasNext();) {
Tuple outputConstraint = it.next();
ExampleTuple inputConstraint = GenerateMatchingTuple(
outputConstraint, filterCond, false);
if (inputConstraint != null)
inputConstraints.add(inputConstraint);
}
} else if (outputData.size() == 0) { // no output constraints, but
// output is empty; generate
// one input that will pass the
// filter
ExampleTuple inputConstraint = GenerateMatchingTuple(filter
.getSchema(), filterCond, false);
if (inputConstraint != null)
inputConstraints.add(inputConstraint);
}
// if necessary, insert a negative example (i.e. a tuple that does
// not pass the filter)
if (outputData.size() == inputData.size()) { // all tuples pass the
// filter; generate one
// input that will not
// pass the filter
ExampleTuple inputConstraint = GenerateMatchingTuple(filter
.getSchema(), filterCond, true);
if (inputConstraint != null)
inputConstraints.add(inputConstraint);
}