public class PLVariable extends PLTerm
Constructor and Description |
---|
PLVariable()
Creates a new Prolog variable
and references it to a free variable number.
|
PLVariable(int number)
Creates a new Prolog variable with a given
variable number.
|
Modifier and Type | Method and Description |
---|---|
void |
backtrack(PLTerm term)
Undo the unification made on this variable using as pattern
the term received as argument.
|
void |
bind(PLTerm term)
Variable binding.
|
PLTerm |
copy()
Makes a full copy of this
PLVariable Prolog variable
object. |
boolean |
equals(PLTerm t)
Strict comparison between Prolog terms.
|
PLTerm |
getBinding()
Returns the binding of this Prolog variable.
|
boolean |
isFree()
free variable test.
|
boolean |
isRunnable()
Execution test on Prolog objects.
|
java.lang.Object |
javaRepr(CiaoJava.PLInterpreter i)
Java representation of a variable: just itself.
|
java.lang.String |
toString()
Returns the string representation of this Prolog variable.
|
void |
unbind()
Variable unbinding.
|
boolean |
unify(PLTerm term)
Term unification.
|
isAtom, isFloat, isInteger, isList, isNil, isString, isStructure, isVariable
public PLVariable()
public PLVariable(int number)
number
- variable number.public boolean isFree()
true
if this Prolog variable is unbound<
false
if is bound to anothe Prolog term.public PLTerm getBinding()
public void bind(PLTerm term)
term
- Term to bind to.public void unbind()
null
to the binding attribute.public java.lang.String toString()
public java.lang.Object javaRepr(CiaoJava.PLInterpreter i)
public boolean isRunnable()
PLTerm
abstract method.isRunnable
in class PLTerm
false
.public boolean equals(PLTerm t)
public PLTerm copy()
PLVariable
Prolog variable
object. Recursively clones the term bound by this variable, in order
to create a new PLVariable
with no shared components.public boolean unify(PLTerm term)
public void backtrack(PLTerm term) throws PLException
term
- PLTerm
object that contains the
PLVariable
object with the content
to be stored on this variable.PLException
- if this term cannot be backtracked.