Obtain the type of a term, which should be a term returned by one of the other
interface predicates or passed as an argument. The function returns the type of
the Prolog term. The type identifiers are listed below.
Declaration Syntax
C# | Visual Basic | Visual C++ | F# |
public enum PlType
Public Enumeration PlType
public enum class PlType
type PlType
Members
Member | Description |
---|---|
PlUnknown | 0 - PL_UNKNOWN: Undefined |
PlVariable | 1 - PL_VARIABLE: An unbound variable. The value of term as such is a unique identifier for the variable. |
PlAtom | 2 - PL_ATOM: A Prolog atom. |
PlInteger | 3 - PL_INTEGER: A Prolog integer. |
PlFloat | 4 - PL_FLOAT: A Prolog floating point number. |
PlString | 5 - PL_STRING: A Prolog string. |
PlTerm | 6 - PL_TERM: A compound term. Note that a list is a compound term ./2. |
Remarks
see PL_term_type(term_t) in the SWI-Prolog Manual.
Examples
In this sample a Prolog variable is created in PlTerm t and the PlType
is checked by his integer representation and his name.
Copy | |
---|---|
PlTerm t = PlTerm.PlVar(); Assert.AreEqual(1, (int)t.PlType); Assert.AreEqual(PlType.PlVariable, t.PlType); |
See Also
Assembly: SwiPlCs (Module: SwiPlCs.dll) Version: 1.1.60601.0 (1.1.60601.0)