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: [4,50,1,21,2,30,11,43,12,12,231,3423,1212,12] Result: [1,2,4,11,12,12,12,21,30,43,50,231,1212,3423]; OK true. % halt