The API is getting cleaner and cleaner, I like it.
In the meanwhile, I found another issue. The following code works fine for monotonic tabling, but doesn’t work, if I add “shared” option:
:- table a/2 as (monotonic,shared).
a(X, b) :-
a(c, X).
a(X, a) :-
a(X, b).
Instead I get an exception:
?- a(a, _).
ERROR: Unhandled exception: Type error: `trie' expected, found `fail' (an atom)
ERROR: In:
ERROR: [31] '$idg_add_monotonic_dep'(fail,dependency(ret,_418,call_continuation(...),ret),<trie>(0x7ff48dc1bf20))
ERROR: [29] delim(ret,'<garbage_collected>',140688327032784,[]) at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/tabling.pl:606
ERROR: [28] activate(ret,'<garbage_collected>',140688327032784) at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/tabling.pl:584
ERROR: [27] run_leader(ret,'<garbage_collected>','<garbage_collected>',_514,_516) at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/tabling.pl:570
ERROR: [26] setup_call_catcher_cleanup('$tabling':'$idg_set_current'(<trie>(0x7ff48fb50380),<trie>(0x7ff48dc1bf20)),'$tabling':run_leader(ret,...,...,_574,_576),_544,'$tabling':finished_leader(<trie>(0x7ff48fb50380),_588,...,...)) at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/init.pl:646
ERROR: [25] create_table(<trie>(0x7ff48dc1bf20),fresh(140688327435904,140688327032784),ret,'<garbage_collected>','<garbage_collected>') at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/tabling.pl:384
ERROR: [24] catch('$tabling':create_table(<trie>(0x7ff48dc1bf20),...,ret,...,...),deadlock,'$tabling':restart_tabling(<closure>(a/2),...,...)) at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/init.pl:546
ERROR: [21] call_continuation('<garbage_collected>') at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/init.pl:601
ERROR: [20] reset('<garbage_collected>',_740,_742) at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/init.pl:572
ERROR: [19] delim(ret(a),'<garbage_collected>',140688359752944,[]) at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/tabling.pl:606
ERROR: [17] activate('<garbage_collected>','<garbage_collected>',140688359752944) at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/tabling.pl:584
ERROR: [16] run_leader(ret(a),'<garbage_collected>','<garbage_collected>',_834,_836) at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/tabling.pl:570
ERROR: [15] setup_call_catcher_cleanup('$tabling':'$idg_set_current'(_880,<trie>(0x7ff48fb50380)),'$tabling':run_leader(...,...,...,_898,_900),_868,'$tabling':finished_leader(_910,_912,...,...)) at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/init.pl:646
ERROR: [14] create_table(<trie>(0x7ff48fb50380),fresh(140688359752864,140688359752944),ret(a),'<garbage_collected>','<garbage_collected>') at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/tabling.pl:384
ERROR: [13] catch('$tabling':create_table(<trie>(0x7ff48fb50380),...,...,...,...),deadlock,'$tabling':restart_tabling(<closure>(a/2),...,...)) at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/init.pl:546
ERROR: [12] start_tabling_2(<closure>(a/2),'<garbage_collected>','<garbage_collected>','<garbage_collected>','<garbage_collected>','<garbage_collected>') at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/tabling.pl:370
ERROR: [10] '$wrap$a'(a,'<garbage_collected>')1-st clause of '$wrap$a'/2 <no source>
ERROR: [9] toplevel_call('<garbage_collected>') at /usr/local/Cellar/swipl/HEAD-2589a45/libexec/lib/swipl/boot/toplevel.pl:1113