Input sharing for findall/3
Phuong‐Lan Nguyen, Bart Demoen · Lirias · 2009
A simple addition to findall/3 achieves sharing between answers in the solution list and the input to findall/3. This reduces the time and space complexity of some queries. Its overhead is extremely small. It can be integrated in any WAM-like Prolog implementation.