Example with dynamic memory, collecting all solution
Source: PROLOG str. 89 Wydawnictwo PLJ Warszawa 1991 ISBN 83-85190-63-5
Program source code: dynamic_memory.pl