A path counting problem revisited

EDIT 2022-Aug-1

On debugging the revised version, I found the old query log below was wrong. I’m very sorry for that. The following is correct, which is the output of the new version.

% ?- time(count_rect_path(rect(8,8), C)).
%@ % 908,479,617 inferences, 111.417 CPU in 113.052 seconds (99% CPU, 8153884 Lips)
%@ C = 3266598486981642,
% ?- call_with_time_limit(1200, time(count_rect_path(rect(9,9), C))).
%@ % 3,940,768,312 inferences, 405.163 CPU in 411.537 seconds (98% CPU, 9726383 Lips)
%@ C = 41044208702632496804,


After taking about one year rest, I am going to review my codes in zdd library on the path counting problem rect(w, h), rectangular grids graph of (w+1)*(h+1) nodes.
The problem is: write a program, say, test(rect(w, h), C))) to count the number C of (undirectred) paths which connects p(0,0) and p(w, h). As far as I know, world record
is for rect(20, 20), and it was about 10 years ago. As for my zdd library,
it can counts for only upto rect(11, 11). ( If remember correctly I happened to see the case test(rect(12,12), c) made success after two days computing on my M1 macbook pro. As I haven’t heard any such successes for the problem in Prolog programming yet, it might be a good result. But I am far from being satisfied with the current status. I believe still I am missing something basic, or
my codes have bugs which appear only when heavy usage of memory.

If you are interested in introducing truely robust zdd libray, write to me. I will give my idea, though it might be poor for you. If you share with me the goal of the world record for rect(w, h) in Prolog programming, you are most welcome.

Here is the log of query test(rect(H,W), C):
(The query log is deleted, which was wrongly copy & pasted by accident. )