/** * Determine whether a term is a free variable. * * @param term The object to test for predicate membership. * * @return <tt>true</tt> if the term is a free variable, <tt>false</tt> otherwise. */ public boolean evaluate(Term term) { if (term.isVar() && (term instanceof Variable)) { Variable var = (Variable) term; return !var.isBound(); } return false; } }
/** * Determine whether a term is a free variable. * * @param term The object to test for predicate membership. * * @return <tt>true</tt> if the term is a free variable, <tt>false</tt> otherwise. */ public boolean evaluate(Term term) { if (term.isVar() && (term instanceof Variable)) { Variable var = (Variable) term; return !var.isBound(); } return false; } }
/** * Reports whether or not this variable is bound to a value. * * @return <tt>true</tt> if this variable has been assigned a value, <tt>false</tt> otherwise. */ public boolean isBound() { VariableBindingContext<Variable> context = getBindingContext(); // The variable can only be bound if it has a binding context and is bound in that context. return (context != null) && context.getStorageCell(this).isBound(); }
/** * Determine whether a term is a free variable. * * @param term The object to test for predicate membership. * * @return <tt>true</tt> if the term is a free variable, <tt>false</tt> otherwise. */ public boolean evaluate(Term term) { if (term.isVar() && (term instanceof Variable)) { Variable var = (Variable) term; return !var.isBound() && !var.isAnonymous(); } return false; } }
/** * Determine whether a term is a free variable. * * @param term The object to test for predicate membership. * * @return <tt>true</tt> if the term is a free variable, <tt>false</tt> otherwise. */ public boolean evaluate(Term term) { if (term.isVar() && (term instanceof Variable)) { Variable var = (Variable) term; return !var.isBound() && !var.isAnonymous(); } return false; } }