$ swipl -l fibonacci.prolog Welcome to SWI-Prolog (threaded, 64 bits, version 9.2.8) 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). ?- f(10,N). N = 55. ?- f(20,N). N = 6765. ?- f(30,N). N = 832040. ?- f(40,N). N = 102334155. ?- f(50,N). ^CAction (h for help) ? abort % Execution Aborted ?- $ swipl -l class12.prolog Welcome to SWI-Prolog (threaded, 64 bits, version 9.2.8) 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). ?- f(10,N). N = 55. ?- f(20,N). N = 6765. ?- f(30,N). N = 832040. ?- f(40,N). N = 102334155. ?- listing(t). :- dynamic t/2. t(0, 0). t(1, 1). t(2, 1). t(3, 2). t(4, 3). t(5, 5). t(6, 8). t(7, 13). t(8, 21). t(9, 34). t(10, 55). t(11, 89). t(12, 144). t(13, 233). t(14, 377). t(15, 610). t(16, 987). t(17, 1597). t(18, 2584). t(19, 4181). t(20, 6765). t(21, 10946). t(22, 17711). t(23, 28657). t(24, 46368). t(25, 75025). t(26, 121393). t(27, 196418). t(28, 317811). t(29, 514229). t(30, 832040). t(31, 1346269). t(32, 2178309). t(33, 3524578). t(34, 5702887). t(35, 9227465). t(36, 14930352). t(37, 24157817). t(38, 39088169). t(39, 63245986). true. ?- f(50,N). N = 12586269025.