Example #1
0
 /* Term */
 public boolean unify(Term t, Trail trail) {
   t = t.dereference();
   if (t.isVariable()) {
     ((VariableTerm) t).bind(this, trail);
     return true;
   }
   return eq(this, t);
 }
Example #2
0
 private boolean termsWeakEqual(ITerm t1, ITerm t2) {
   if (t1 == null || t2 == null || t1.equals(t2)) return true;
   if (!(t1 instanceof VariableTerm) || !(t2 instanceof VariableTerm)) return false;
   VariableTerm v1 = (VariableTerm) t1;
   VariableTerm v2 = (VariableTerm) t2;
   return (!v1.isMatched() && v2.isMatched() && (v1.getSymbol().equals(v2.getSymbol())));
 }