Did you know ... Search Documentation:
Pack dialect-ciao -- prolog/dialect/ciao/hiordlib.pl
PublicShow source

Re-exported predicates

The following predicates are re-exported from other modules

 foldl(:Goal, +List, +V0, -V)
 foldl(:Goal, +List1, +List2, +V0, -V)
 foldl(:Goal, +List1, +List2, +List3, +V0, -V)
 foldl(:Goal, +List1, +List2, +List3, +List4, +V0, -V)
Fold an ensemble of m (0 <= m <= 4) lists of length n head-to-tail ("fold-left"), using columns of m list elements as arguments for Goal. The foldl family of predicates is defined as follows, with V0 an initial value and V the final value of the folding operation:
foldl(G, [X_11, ..., X_1n],
         [X_21, ..., X_2n],
         [X_m1, ..., X_mn], V0, V) :-
   call(G, X_11, ..., X_m1, V0, V1),
   call(G, X_12, ..., X_m2, V1, V2),
   call(G, X_1n, ..., X_mn, V<n-1>, V).

No implementation for a corresponding foldr is given. A foldr implementation would consist in first calling reverse/2 on each of the m input lists, then applying the appropriate foldl. This is actually more efficient than using a properly programmed-out recursive algorithm that cannot be tail-call optimized.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 map(Arg1, Arg2, Arg3)
 map(Arg1, Arg2, Arg3, Arg4)
 map(Arg1, Arg2, Arg3, Arg4, Arg5)
 map(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 minimum(Arg1, Arg2, Arg3)
 split(Arg1, Arg2, Arg3, Arg4)