This is reduced re-implementation of the corresponding library from formerly Jekejeke Prolog. Unlike the latter, which makes use of a Java Pivot data structure, this implantation is based on change_arg/3. This module is inspired by SQL query options such as TOP. Providing such a module was recently pioneered by SWI-Prolog.
Currently the predicates limit/2, offset/2 and call_nth/2 are provided. The current implementation of limit/2 and offset/2 is based on call_nth/2. The predicates limit/2, offset/2 and call_nth/2 solely work tuple oriented and it is possible to cascade these predicates as the example below shows:
Example:?- limit(5, offset(3, between(1, 10, X))).
X = 4 ;
X = 5 ;
X = 6 ;
X = 7 ;
X = 8
The following sequence predicates are provided: