private boolean matches(RelationshipPredicate r1, Substitution s1, RelationshipPredicate r2, Substitution s2) {
if (!(r1.getRelation().equals(r2.getRelation())))
return false;
for (int ndx = 0; ndx < r1.getVars().length; ndx++) {
ObjectLabel o1 = s1.getSub(r1.getVars()[ndx]);
ObjectLabel o2 = s2.getSub(r2.getVars()[ndx]);
//It's possible that something is null, because it isn't bound to anything in particular
//In that case, treat it as a match because it could be bound to the thing we have in the
//other one. Basically, it's a free variable, so continue to treat it like one!
if (o1 != null && o2 != null && !(o1.equals(o2)))