Documentation Prolog Predicate Reference lists foldl/4

foldl/4

Reduce list to a single value.

Description

foldl( :callable_term, +list, +term, -term )

foldl(Goal, List, Start, End) is true if and only if End is the result of applying Goal to the elements of List, from left to right, in a cumulative way, using Start as initial accumulator.

Implementation