(base) Desktop$ swipl Welcome to SWI-Prolog (threaded, 64 bits, version 8.2.4) SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software. Please run ?- license. for legal details. For online help and background, visit https://www.swi-prolog.org For built-in help, use ?- help(Topic). or ?- apropos(Word). ?- [fibonacci]. true. ?- f(5,X). X = 5 ; false. ?- f(6,X). X = 8 ; false. ?- f(7,X). X = 13 . ?- f(1000,X). ?- f(1000,X). ERROR: Stack limit (1.0Gb) exceeded ERROR: Stack sizes: local: 0.9Gb, global: 79.8Mb, trail: 53.2Mb ERROR: Stack depth: 1,000, last-call: 0%, Choice points: 3,485,432 ERROR: Possible non-terminating recursion: ERROR: [1,000] user:f(0, _20924990) ERROR: [999] user:f(2, _20925010) ?- f(100,X). ERROR: Stack limit (1.0Gb) exceeded ERROR: Stack sizes: local: 0.9Gb, global: 79.8Mb, trail: 53.2Mb ERROR: Stack depth: 101, last-call: 1%, Choice points: 3,485,301 ERROR: In: ERROR: [101] user:f(0, _20912648) ERROR: [100] user:f(2, _20912668) ERROR: [99] user:f(3, _20912688) ERROR: [98] user:f(4, _20912708) ERROR: [97] user:f(5, _20912728) ERROR: ERROR: Use the --stack_limit=size[KMG] command line option or ERROR: ?- set_prolog_flag(stack_limit, 2_147_483_648). to double the limit. ?- f(20,X). ?- f(20,X). X = 6765 ; false. ?- f(30,X). X = 832040 ; false. ?- f(40,X). ERROR: Stack limit (1.0Gb) exceeded ERROR: Stack sizes: local: 0.9Gb, global: 79.6Mb, trail: 53.1Mb ERROR: Stack depth: 39, last-call: 3%, Choice points: 3,485,608 ERROR: In: ERROR: [39] user:f(2, _20864062) ERROR: [38] user:f(3, _20864082) ERROR: [37] user:f(5, _20864102) ERROR: [36] user:f(7, _20864122) ERROR: [35] user:f(8, _20864142) ERROR: ERROR: Use the --stack_limit=size[KMG] command line option or ERROR: ?- set_prolog_flag(stack_limit, 2_147_483_648). to double the limit. ?-