1.9 Auxiliary Interface Functions

OZ_gCollectTerm

void OZ_gCollectTerm(OZ_Term &t);

During garbage collection this function updates the reference t to a term on the heap. This is typically required when the member function gCollect() of a propagator is invoked.

OZ_gCollectBlock

void OZ_gCollectBlock(OZ_Term * frmOZ_Term * toconst int n);

During garbage collection this function updates the n elememts in frm and stores them in to.

OZ_gCollectAllocBlock

OZ_Term * OZ_gCollectAllocBlock(int n, OZ_Term * frm);

During garbage collection this function updates the n elements in frm and returns a pointer to the updates. The updates are stored in freshly allocated heap memory.

OZ_sCloneTerm

void OZ_sCloneTerm(OZ_Term &t);

During cloning this function updates the reference t to a term on the heap. This is typically required when the member function sClone() of a propagator is invoked.

OZ_sCloneBlock

void OZ_sCloneBlock(OZ_Term * frmOZ_Term * toconst int n);

During cloning this function updates the n elememts in frm and stores them in to.

OZ_sCloneAllocBlock

OZ_Term * OZ_sCloneAllocBlock(int n, OZ_Term * frm);

During cloning this function updates the n elements in frm and returns a pointer to the updates. The updates are stored in freshly allocated heap memory.

OZ_isPosSmallInt

OZ_Boolean OZ_isPosSmallInt(OZ_Term val);

This function returns OZ_TRUE if val denotes an integer contained in the finite set \{0, \ldots, \mbox{\tt OZ\_getFDSup()}\}. Otherwise it returns OZ_FALSE.

OZ_hallocOzTerms

OZ_Term * OZ_hallocOzTerms(int n);

This function allocates a block of heap memory for n items of type OZ_Term and returns a pointer to the block.

OZ_hallocChars

char * OZ_hallocChars(int n);

This function allocates a block of heap memory for n items of type char and returns a pointer to the block.

OZ_hallocCInts

int * OZ_hallocCInts(int n);

This function allocates a block of heap memory for n items of type int and returns a pointer to the block.

OZ_hfreeOzTerms

void OZ_hfreeOzTerms(OZ_Term * tsint n);

The function frees the heap memory allocated by OZ_hallocOzTerms(). The first argument ts points to a memory block and the value of n must denote the correct size of the block.

OZ_hfreeCInts

void OZ_hfreeCInts(int * isint n);

The function frees the heap memory allocated by OZ_hallocCInts. The first argument is points to a memory block and the value of n must denote the correct size of the block.

OZ_hfreeChars

void OZ_hfreeChars(char * isint n);

The function frees the heap memory allocated by OZ_hallocChars(). The first argument is points to a memory block and the value of n must denote the correct size of the block.

OZ_copyCInts

int * OZ_copyCInts(int nint * is);

Copies n ints from is and returns the location of the copy. If n is equal to 0 it returns (int *) NULL.

OZ_copyChars

char * OZ_copyChars(int nchar * cs);

Copies n chars from cs and returns the location of the copy. If n is equal to 0 it returns (char *) NULL.

OZ_findEqualVars

int * OZ_findEqualVars(int szOZ_Term * ts);

The function expects ts to be a pointer to an OZ_Term array of size sz. It returns an array of ints indicating variables which are equal. Suppose that the ith field of the returned array holds one of the following values.

value

explanation

-1

The term stored at that position is not a variable.

i

This is the first occurrence of a variable stored in the array at position i.

j \neq i

This is a repeated occurrence of a variable stored at position j in the array.

The first occurrence can be found at position j.

The returned int array is statically allocated, i. e. it is overridden on every invocation. For details see Section 1.7.1 of ``The Mozart Constraint Extensions Tutorial''.

OZ_isEqualVars

OZ_Boolean OZ_isEqualVars(OZ_Term v1OZ_Term v2);

This function returns OZ_TRUE if v1 and v2 refer to the same variable. Otherwise it returns OZ_FALSE.

OZ_findSingletons

int * OZ_findSingletons(int szOZ_Term * ts);

The function expects ts to be a pointer to an OZ_Term array of size sz which expects its elements to refer to finite domain variables. It returns an array of ints indicating variables which are singletons. Suppose that the ith field of the returned array holds one of the following values.

value

explanation

\geq 0

The term stored at that position is a singleton.

otherwise

The term stored at that position is still a finite domain variable.

The returned int array is statically allocated, i. e. it is overridden on every invocation.

OZ_typeErrorCPI

OZ_Return OZ_typeErrorCPI(char * __typeString,
                          int pos,  
                          char * comment);

The return value of this function indicates the runtime system that an exception has to be raised. The message printed is composed using the posth substring of __typeString and comment.

OZ_getFDInf

int OZ_getFDInf(void);

This function returns the value of the smallest element a finite domain which is represented by an instance of the class OZ_FiniteDomain can take. The value returned is 0.

OZ_getFDSup

int OZ_getFDSup(void);

This function returns the value of the largest element a finite domain which is represented by an instance of the class OZ_FiniteDomain can take. The value returned is 134\;217\;726.

OZ_getFSetInf

int OZ_getFSetInf(void);

This function returns the value of the smallest element a finite set value which is represented by an instance of the class OZ_FSetValue can take. The value returned is 0.

OZ_getFSetSup

int OZ_getFSetSup(void);

This function returns the value of the largest element a finite set value which is represented by an instance of the class OZ_FSetValue can take. The value returned is 134\;217\;726.

OZ_fsetValue

OZ_Term OZ_fsetValue(OZ_FSetValue * fsv);

This function converts the finite set value fsv to the corresponding OZ_Term.

OZ_fsetValueToC

OZ_FSetValue * OZ_fsetValueToC(OZ_Term fsv);

This function converts fsv, referring to a finite set value, to a pointer to the finite set value.

OZ_vectorSize

int OZ_vectorSize(OZ_Term t);

This function returns the size of a vector. In case t is no vector it returns -1.

type

returned value

Literal

The value returned is 0.

List

he value returned is the length of the list.

Tuple

The value returned is the arity of the tuple.

Record

The value returned is the number of features of the record.

OZ_getOzTermVector

OZ_Term * OZ_getOzTermVector(OZ_Term t, OZ_Term * v);

This function expects t to be a vector and v to be an array with minimal OZ_vectorSize(t) elements. It converts t to an OZ_Term array and returns a pointer to the next free position in the array v after converting t. In case t is no vector the function returns NULL.

OZ_getCIntVector

int * OZ_getCIntVector(OZ_Term tint * v);

This function expects t to be a vector of small integers and v to be an array with minimal OZ_vectorSize(t) elements. It converts t to an int array and returns a pointer to the next free position in the array v after converting t. In case t is no vector the function returns NULL.


Tobias Müller
Version 1.4.0 (20080702)