Uneven tabling performance in BProlog 8.1
问题 I did a few experiments with the tabling capabilities of b-prolog version 8.1 and was quite surprised by the performance I observed. Here is the code that I used. It counts the number of Collatz steps N required for reducing some positive integer I down to 1 : %:- table posInt_CollatzSteps/2. % remove comment to enable tabling posInt_CollatzSteps(I,N) :- ( I == 1 -> N = 0 % base case ; 1 is I /\ 1 -> I0 is I*3+1, posInt_CollatzSteps(I0,N0), N is N0+1 % odd ; I0 is I>>1, posInt_CollatzSteps(I0