PBTerm
is the .NET representations
of Prolog terms.
Field Summary | |
---|---|
public static final PBTerm |
NIL
|
protected final string |
name
|
Method Summary | |
---|---|
public bool |
isAtom()
Returns true if this null is
an atom and false otherwise. |
public bool |
isAtomic()
Returns true if this null is a
constant (e.g. integer, floating-point number, or atom) and
false if this null is a
compound term or variable. |
public bool |
isNumber()
Returns true if this null is a
number and false otherwise. |
public bool |
isInteger()
Returns true if this null is
an integer and false otherwise. |
public bool |
isBignum()
Returns true if this null is
an bignum integer and false otherwise. |
public bool |
isFloat()
Returns true if this null is a
floating-point number and false otherwise. |
public bool |
isCompound()
Returns true if this null is a
compund term and false otherwise. |
public bool |
isListCell()
Returns true if this null is a
list cell, i.e. a compound term with the functor ./2, and
false otherwise. |
public bool |
isProperList()
Returns true if this null is a
proper list and false otherwise. |
public bool |
isEmptyList()
Returns true if this null is
the empty list and false otherwise. |
public bool |
isString()
Returns true if this null is a
proper list and all of its elements are character codes or one character
atoms. |
public PBTerm |
head()
Returns the head of this null if it is a
list cell, i.e. a compound term with the functor ./2. |
public PBTerm |
tail()
Returns the tail of this null if it is a
list cell, i.e. a compound term with the functor ./2. |
public bool |
isVariable()
Returns true if this null is a
variable and false otherwise. |
public string |
getName()
Returns the name of this constant or compound term. |
public PBTerm |
getArgument(int index)
Returns the argument at the specified index. |
public int |
length()
If this null is a proper list, returns its
length. |
public int |
getArity()
Returns the number of arguments of this compound term or 0 if this null is not a compound term. |
public long |
intValue()
Returns the integer value of this null . |
public BigInteger |
bigIntegerValue()
Returns the null value of this
null . |
public double |
floatValue()
Returns the floating-point value of this PBTerm. |
public string |
getString()
If this null is a proper list and all its
elements are small integers (less than 256), returns a
null with the list elements as the character
codes of the null . |
public abstract string |
toString()
Returns a string description of this term. |
public static PBTerm |
makeTerm(float value)
Creates a new null instance representing a
float value. |
public static PBTerm |
makeTerm(double value)
Creates a new null instance representing a
double value. |
public static PBTerm |
makeTerm(int value)
Creates a new null instance representing an
int value. |
public static PBTerm |
makeTerm(long value)
Creates a new null instance representing a
long value. |
public static PBTerm |
makeTerm(BigInteger value)
Creates a new null instance representing a
BigInteger value. |
public static PBTerm |
makeTerm(string value)
Creates a new null instance representing a
list with the characters, as integer values, in the string argument as
its elements. |
public static PBTerm |
makeTerm(string name, PBTerm[] arguments)
Creates a new null instance representing a
compound term. |
public static PBTerm |
makeTerm(PBTerm head, PBTerm tail)
Creates a new null instance representing a
list cell. |
public static PBTerm |
makeAtom(string value)
Creates a new null instance representing an
atom. |
protected string |
stuffAtom(string atom)
|
Field Detail |
---|
public static final PBTerm NIL
null
NIL
, with the
printname "[]", represents the empty list.
protected final string name
Method Detail |
---|
public bool isAtom()
true
if this null
is
an atom and false
otherwise.
public bool isAtomic()
true
if this null
is a
constant (e.g. integer, floating-point number, or atom) and
false
if this null
is a
compound term or variable.
public bool isNumber()
true
if this null
is a
number and false
otherwise.
public bool isInteger()
true
if this null
is
an integer and false
otherwise.
public bool isBignum()
true
if this null
is
an bignum integer and false
otherwise.
public bool isFloat()
true
if this null
is a
floating-point number and false
otherwise.
public bool isCompound()
true
if this null
is a
compund term and false
otherwise.
public bool isListCell()
true
if this null
is a
list cell, i.e. a compound term with the functor ./2, and
false
otherwise.
public bool isProperList()
true
if this null
is a
proper list and false
otherwise.
public bool isEmptyList()
true
if this null
is
the empty list and false
otherwise.
public bool isString()
true
if this null
is a
proper list and all of its elements are character codes or one character
atoms. Returns false
otherwise.
public PBTerm head()
null
if it is a
list cell, i.e. a compound term with the functor ./2.
public PBTerm tail()
null
if it is a
list cell, i.e. a compound term with the functor ./2.
public bool isVariable()
true
if this null
is a
variable and false
otherwise.
public string getName()
public PBTerm getArgument(int index)
index
- the (one based) index of the argumentpublic int length()
null
is a proper list, returns its
length.
public int getArity()
null
is not a compound term.
public long intValue()
null
.
public BigInteger bigIntegerValue()
null
value of this
null
.
public double floatValue()
public string getString()
null
is a proper list and all its
elements are small integers (less than 256), returns a
null
with the list elements as the character
codes of the null
.
public abstract string toString()
public static PBTerm makeTerm(float value)
null
instance representing a
float value.
public static PBTerm makeTerm(double value)
null
instance representing a
double value.
public static PBTerm makeTerm(int value)
null
instance representing an
int value.
public static PBTerm makeTerm(long value)
null
instance representing a
long value.
public static PBTerm makeTerm(BigInteger value)
null
instance representing a
BigInteger value.
public static PBTerm makeTerm(string value)
null
instance representing a
list with the characters, as integer values, in the string argument as
its elements.
public static PBTerm makeTerm(string name, PBTerm[] arguments)
null
instance representing a
compound term.
public static PBTerm makeTerm(PBTerm head, PBTerm tail)
null
instance representing a
list cell.
public static PBTerm makeAtom(string value)
null
instance representing an
atom.
protected string stuffAtom(string atom)