There are three lists of integers, as shown below.
The aim is to find the common trio of consecutive integers in
the lists above, which has maximum sum. Obviously in each
listing the triad may be in a different location. at our
example the trio sought shown below.
| location 4)
| (location 5)
| (location 7)
Implement a predicate allign / 3 which in the first argument
returns the positions where start the triplets we seek in any
list, the second argument is the triad, and the third the
?- allign(Pos, Triple, Sum).
Pos = [4, 5, 7]
Triple = [10, 22, 11]
Sum = 43
Yes ([url removed, login to view] cpu)