/** * Test whether this number is equal to another number. * * @param other the number to compare with * @return true if equal, false otherwise */ public boolean equals(Term other) { if (other instanceof APLNum) { APLNum term = (APLNum) other; return val.equals(term.getVal()); } else if (other instanceof APLVar) { APLVar term = (APLVar) other; if (!term.isBounded()) return false; else return equals(term.getSubst()); } else return false; }