4 ms·
A lot of code from The Art of Prolog that used some form of accumulator data structure as a third argument to predicates.
by rrwo 4y ago
A lot of code from The Art of Prolog that used some form of accumulator data structure as a third argument to predicates.
- Jtsummers 4y agoDo you mean something like how you might define `append/3` append([], L, L). append([H|T], L2, [H|L3]) :- append(T, L2, L3). Such that the computation can be run in any direction? Where it will produce the result of appending two lists, or the prefixes and suffixes of a list if the result (third parameter) is known, and so on?