

Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog
PlType Enumeration
SwiPlCs interface ► SbsSW.SwiPlCs ► PlType
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.

C# | Visual Basic | Visual C++ | F# |
public enum PlType
Public Enumeration PlType
public enum class PlType
type PlType

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. |
PlCodeList | 14 - PL_CODE_LIST: [ascii...]. |
PlCharList | 15 - PL_CHAR_LIST: [h,e,l,l,o]. |

see PL_term_type(term_t) in the SWI-Prolog Manual.

In this sample a Prolog variable is created in PlTerm t and the PlType
is checked by his integer representation and his name.
![]() | |
---|---|
PlTerm t = PlTerm.PlVar(); Assert.AreEqual(1, (int)t.PlType); Assert.AreEqual(PlType.PlVariable, t.PlType); |

Assembly: SwiPlCs (Module: SwiPlCs.dll) Version: 1.1.60605.0 (1.1.60605.0)