With this program:
:- table bas/2.
bas --> [b].
bas --> bas, [a].
and this query:
8 ?- length(As,100 000),maplist(=(a),As), time(bas([b|As],A)).
Thread 1 (main): foreign predicate system:$tbl_wkl_work/8 did not clear exception:
error(resource_error(stack),stack_overflow{choicepoints:11,depth:22,environments
:18,globalused:2344,localused:3,stack:[frame(22,system: $tbl_wkl_work(2098596,_600292,_6
00294,_600296,_600298,_600300,_600302,_600304),[]),frame(21,$tabling:completion_step(209
8596),[]),frame(20,$tabling:completion_(3104412),[]),frame(19,$tabling:completion(310441
2),[]),frame(18,$tabling:run_leader(ret/1,<garbage_collected>,<trie>(0x56373ffb9610),310
4412,_600384),[])],stack_limit:1048576,trailused:0})
% 66 inferences, 0.069 CPU in 0.070 seconds (99% CPU, 951 Lips)
As = [a, a, a, a, a, a, a, a, a|...] .
with the latest source.