next up previous contents index
Next: Syntax Up: The Compiler Previous: Other Directives   Contents   Index


Inline Predicates

Inline predicates represent ``primitive'' operations in the WAM. Calls to inline predicates are compiled into a sequence of WAM instructions in-line, i.e. without actually making a call to the predicate. Thus, for example, relational predicates (like >/2, >=/2, etc.) compile to, essentially, a subtraction followed by a conditional branch. Inline predicates are expanded specially by the compiler and thus cannot be redefined by the user without changing the compiler. The user does not need to import these predicates from anywhere. There are available no matter what options are specified during compiling.

Table 3.1 lists the inline predicates of XSB Version 2.2. Those predicates that start with _$ are internal predicates that are also expanded in-line during compilation.


Table 3.1: The Inline Predicates of XSB
'='/2 '<'/2 '=<'/2 '>='/2 '>'/2
'=:='/2 '=\='/2 is/2 '@<'/2 '@=<'/2
'@>'/2 '@>='/2 '=='/2 '\=='/2 fail/0
true/0 var/1 nonvar/1 halt/0 '!'/0
'_$cutto'/1 '_$savecp'/1 '_$builtin'/1


We warn the user to be very cautious when defining predicates whose functor starts with _$ since the names of these predicates may interfere with some of XSB's internal predicates. The situation may be particularly severe for predicates like '_$builtin'/1 that are treated specially by the XSB compiler.


next up previous contents index
Next: Syntax Up: The Compiler Previous: Other Directives   Contents   Index
Baoqiu Cui
2000-04-23