Library imports

The @library annotation allows to import library functions implemented in the Java source.

Syntax
@library("alias:", "libraryName"[, "methodName", "parameterString"]).

Where:

  • alias is the name the user wants to call the library as inside the program;

  • libraryName is the name of the library to invoke.

  • methodName (optional) is the name of the method to import

  • parameterString (optional) the string of parameters (mainly used in the machine learning libraries)

Example

To use the collections library, the user will want to import the library in a similar way:

@library("c:", "collections").

The alias here is "c", but the name is arbitrary and is chosen by the user. The colon is always present.

Usage:

Let us assume we want to call the size() function to compute the size of a collection.

collectionSize(S):- collection(X), S = c:size(X).