Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 6.6.5) Copyright (c) 1990-2013 University of Amsterdam, VU Amsterdam SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit http://www.swi-prolog.org for details. For help, use ?- help(Topic). or ?- apropos(Word). true. Stack: [10,9,8,7,6,5,4,3,2,1,1,2,3,4,5,6,7,8,9,10] Result: [1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10]; OK true. % halt