YAP 7.1.0
Inlined Tests and Term Manipulation

## ◆ fail/0

 class fail/0

fail

defined in the ISO standard

Always fails Defined as if by:

fail :- 2=1.

## ◆ false/0

 class false/0

false

defined in the ISO standard

The same as fail Defined as if by:

false :- 2=1.

## ◆ true/0

 class true/0

true

defined in the ISO standard

Succeed

Succeeds once Defined as if by:

true :- true.

## ◆ otherwise/0

 class otherwise/0

otherwise

defined in the ISO standard

Succeed

Succeeds once Defined as if by:

otherwise.

## ◆ atom/1

 class atom/1

atom( T)

defined in the ISO standard

Succeeds if and only if T is currently instantiated to an atom

## ◆ atomic/1

 class atomic/1

atomic(T)

defined in the ISO standard

Checks whether T is an atomic symbol (atom or number)

## ◆ integer/1

 class integer/1

integer( T)

defined in the ISO standard

Succeeds if and only if T is currently instantiated to an integer

## ◆ number/1

 class number/1

number( T)

defined in the ISO standard

Checks whether T is an integer, rational or a float

## ◆ db_reference/1

 class db_reference/1

db_reference( T)

Checks whether T is a database reference

## ◆ primitive/1

 class primitive/1

primitive( ?_T_)

Checks whether T is an atomic term or a database reference

## ◆ float/1

 class float/1

float( T)

defined in the ISO standard

Checks whether T is a floating point number

## ◆ compound/1

 class compound/1

compound( T)

defined in the ISO standard

Checks whether T is a compound term

## ◆ nonvar/1

 class nonvar/1

nonvar( T)

defined in the ISO standard

The opposite of var( _T_)

## ◆ var/1

 class var/1

var( T)

defined in the ISO standard

Succeeds if T is currently a free variable, otherwise fails

## ◆ var/2

 class var/2

?_X_ == ?_Y_

defined in the ISO standard

Succeeds if terms X and Y are strictly identical The difference between this predicate and =/2 is that, if one of the arguments is a free variable, it only succeeds when they have already been unified

?- X == Y.

fails, but,

?- X = Y, X == Y.

succeeds

?- X == 2.

fails, but,

?- X = 2, X == 2.

succeeds

## ◆ arg/3

 class arg/3

arg(+ N,+ T, A)

defined in the ISO standard

Succeeds if the argument N of the term T unifies with A The arguments are numbered from 1 to the arity of the term

The current version will generate an error if T or N are unbound, if T is not a compound term, of if N is not a positive integer Note that previous versions of YAP would fail silently under these errors

## ◆ functor/3

 class functor/3

functor( T, F, N)

defined in the ISO standard

The top functor of term T is named F and has arity N

When T is not instantiated, F and N must be If N is 0, F must be an atomic symbol, which will be unified with T If N is not 0, then F must be an atom and T becomes instantiated to the most general term having functor F and arity N If T is instantiated to a term then F and N are respectively unified with its top functor name and arity

In the current version of YAP the arity N must be an integer Previous versions allowed evaluable expressions, as long as the expression would evaluate to an integer This feature is not available in the ISO Prolog standard

## ◆ current_choice_point/1

 class current_choice_point/1

current_choice_point( -CP )

unify the logic variable CP with a number that gives the offset of the current choice-point This number is only valid as long as we do not backtrack by or cut CP, and is safe in the presence of stack shifting and/or garbage collection

## ◆ IN_INLINES_C

 #define IN_INLINES_C   1

Definition at line 33 of file inlines.c.

## ◆ Yap_eq()

 int Yap_eq ( Term t1, Term t2 )

Definition at line 571 of file inlines.c.

## Macros

#define IN_INLINES_C   1

## Functions

int Yap_eq (Term t1, Term t2)