Hi Jan,
Sorry to bother you again, but I found the following problem:
Program
:- table p/1 as incremental.
p(X) :- tnot(q(X)), r(X), tnot(p(X)).
p(X) :- r(X).
:- table q/1 as incremental.
q(X) :- tnot(r(X)).
:- table r/1 as incremental.
r(X) :- r1(X).
:- dynamic r1/1 as incremental.
r1(1).
Execution
?- p(1).
true.
?- retract(r1(1)).
true.
?- p(1).
ERROR: Type error: `worklist' expected, found `invalid' (an atom)
ERROR: In:
ERROR: [38] '$tbl_wkl_negative'(invalid)
ERROR: [37] negation_suspend(user:q(1),ret,invalid) at /usr/local/lib/swipl/boot/tabling.pl:892
ERROR: [35] p(1) at /media/sf_WumpusWorld/test11.pl:3
ERROR: [34] call(system:<closure>(p/1)(1)) at /usr/local/lib/swipl/boot/init.pl:484
ERROR: [33] reset(system:call(...),_46230,_46232) at /usr/local/lib/swipl/boot/init.pl:572
ERROR: [32] delim(ret,system:call(...),139959898508016,[]) at /usr/local/lib/swipl/boot/tabling.pl:606
ERROR: [31] activate(ret,system:call(...),139959898508016) at /usr/local/lib/swipl/boot/tabling.pl:584
ERROR: [30] run_leader(ret,system:call(...),fresh(139959902516752,139959898508016),_46350,_46352) at /usr/local/lib/swipl/boot/tabling.pl:570
ERROR: [29] setup_call_catcher_cleanup('$tabling':'$idg_set_current'(_46408,<trie>(0x7f4af44bfe40)),'$tabling':run_leader(ret,...,...,_46426,_46428),_46396,'$tabling':finished_leader(_46438,_46440,...,...)) at /usr/local/lib/swipl/boot/init.pl:646
ERROR: [28] create_table(<trie>(0x7f4af44bfe40),fresh(139959902516752,139959898508016),ret,user:p(1),system:call(...)) at /usr/local/lib/swipl/boot/tabling.pl:384
ERROR: [27] catch('$tabling':create_table(<trie>(0x7f4af44bfe40),...,ret,...,...),deadlock,'$tabling':restart_tabling(<closure>(p/1),...,...)) at /usr/local/lib/swipl/boot/init.pl:546
ERROR: [23] ignore(user:p(1)) at /usr/local/lib/swipl/boot/init.pl:529
ERROR: [22] setup_call_catcher_cleanup('$tabling':nb_setval('$tbl_reeval',true),'$tabling':ignore(...),_46624,'$tabling':nb_delete('$tbl_reeval')) at /usr/local/lib/swipl/boot/init.pl:646
ERROR: [20] reeval_node(<trie>(0x7f4af44bfe40)) at /usr/local/lib/swipl/boot/tabling.pl:1999
ERROR: [19] reeval_heads([[<trie>(0x7f4af44bfe40)]],<trie>(0x7f4af44bfe40),_46710) at /usr/local/lib/swipl/boot/tabling.pl:1931
ERROR: [16] reeval_paths([[<trie>(0x7f4af43b5f70)|...],...|...],<trie>(0x7f4af44bfe40)) at /usr/local/lib/swipl/boot/tabling.pl:1917
ERROR: [15] try_reeval(<trie>(0x7f4af44bfe40),user:p(1),ret) at /usr/local/lib/swipl/boot/tabling.pl:1868
ERROR: [14] catch('$tabling':try_reeval(<trie>(0x7f4af44bfe40),...,ret),deadlock,'$tabling':retry_reeval(<trie>(0x7f4af44bfe40),...)) at /usr/local/lib/swipl/boot/init.pl:546
ERROR: [9] toplevel_call(user:user: ...) at /usr/local/lib/swipl/boot/toplevel.pl:1116
ERROR:
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.
Exception: (35) p(1) ?