I tried that a little while ago and couldn’t get it work (I still ended up with infinite loops, but gave up at that point rather than digging into it). But things might have changed, so I can re-try.
I noticed in Constraint Solving and Planning with Picat that there’s an “
nt” mode (Section 4.2, page 81 of the PDF):
The last mode, Mn , can be
nt, indicating that the corresponding argument will not be tabled.
It’s not clear to me why this can only be used for the last mode; perhaps it’s because the last argument is presumed to be a return value?