Tools

Timing

fugit/1

Time a command

Flow Tracing

flow/1

Trace plain code

flow/3

Trace DCG code

Tools for Long Lists

The basic prolog tools for list manipulation are normally defined to process the list one element at a time. However, when the individual list elements are not of interest, as in the following:

then it is quicker to process long lists in chunks.

Those primitives are defined here as alternatives to the standard library and operate on chunks up to eight elements at a time. They are intended to be fully bilateral.

Tools related to Iteration

iota/3

iota(Start, Finish, List)

produces a List of integers increasing or decreasing in unit steps from Start to Finish.

in/2

in(Element, List)

is the same as member(Element, List).

in(Element, iota(Start, Finish))

is the same as: iota(Start, Finish, List), member(Element, List).

do/2

These are repeat - fail operations which are only useful for producing side effects Being failure driven, they can be nested.

do(while(Condition), Goals)

do(Goals, while(Condition))