public Frame unify(RBTerm other, Frame f) { // System.err.println("** entering unify " + this + " to: " + other); if (other instanceof RBIgnoredVariable) return f; RBTerm val = f.get(this); if (val == null) { other = other.substitute(f); if (equals(other)) return f; else if (other.freefor(this)) { return bind(other, f); } else return null; } else return val.unify(other, f); }
public Frame unify(RBTerm other, Frame f) { if (!(other instanceof RBCompoundTerm)) { if ((other instanceof RBVariable)) { return other.unify(this, f); } return null; } RBCompoundTerm cother = (RBCompoundTerm) other; if (!cother.getConstructorType().equals(getConstructorType())) { return null; } return getArg().unify(cother.getArg(), f); }