How to use tabling?

I’m trying to use tabling but running into an error with the example:

$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 7.6.4)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- consult("").
ERROR: /home/sir/ailive/livebetter/phy_nlp/phy_nlp/prolog/ Syntax error: Operator expected

where is exactly as and

:- table fib2/2.

fib2(0, 1) :- !.
fib2(1, 1) :- !.
fib2(N, F) :-
    N > 1,
    N1 is N-1,
    N2 is N-2,
    fib2(N1, F1),
    fib2(N2, F2),
    F is F1+F2.

Thanks in advance.

  • Stu
1 Like

You need a more recent SWI-Prolog version. For tabling, try the latest development version, 8.1.24.

1 Like

That worked. Thank you!