Hello everybody,
I have an issue with Ciao’s tabling: When I try to call abolish_all_tables, I get an error. Here is an example:
I have a prolog file ‘foo.pl’ with the following contents: ================= BEGIN ================= :- use_package(library(tabling)). :- data edge/2. :- table tc/2.
edge(a, b). edge(b, c).
%Left-recursive transitive closure. tc(X, Y) :- edge(X, Y). tc(X, Y) :- tc(X, Z), edge(Z, Y). ================= END =================
I load this file in the ciao repl and have the following interactions: ================= BEGIN ================= ?- ensure_loaded(foo).
yes ?- tc(a, b).
yes ?- tc(a, c).
yes ?- tc(c, a).
no ?- asserta_fact(edge(c,a)).
yes ?- tc(c, a).
no ?- abolish_all_tables. {ERROR: user:abolish_all_tables/0 - existence error: procedure:user:abolish_all_tables/0 does not exist}
no ================= END =================
My problem is that the truth of `tc(c,a)` changes due to me asserting the fact `edge(c,a)`. Since I already evaluated `tc(c,a)` once, and tc is declared as tabled, ciao gives me the tabled, now incorrect, value instead of performing a new computation. I would therefore like to abolish all tables to force ciao to evaluate the query anew. What is it that I am doing wrong?
Thank you for your help!
Lorenz
PS: I am using the current development version of ciao (1.15-1781-g328b907). During the configuration stage of the build I explicitly enabled tabling support.
Hi. abolish_all_tables/0 is defined in the package 'tabling', and it's not automatically made visible in the toplevel when you load another module which uses it (this is particular for tabling, is a general rule of the module system). Bottom line, if you do
?- use_package(library(tabling)).
in the toplevel, it should work fine.
"Breidenbach Lorenz" <lorenzb(a)student.ethz.ch> writes:
Hello everybody,
I have an issue with Ciao’s tabling: When I try to call abolish_all_tables, I get an error. Here is an example:
I have a prolog file ‘foo.pl’ with the following contents: ================= BEGIN ================= :- use_package(library(tabling)). :- data edge/2. :- table tc/2.
edge(a, b). edge(b, c).
%Left-recursive transitive closure. tc(X, Y) :- edge(X, Y). tc(X, Y) :- tc(X, Z), edge(Z, Y). ================= END =================
I load this file in the ciao repl and have the following interactions: ================= BEGIN ================= ?- ensure_loaded(foo).
yes ?- tc(a, b).
yes ?- tc(a, c).
yes ?- tc(c, a).
no ?- asserta_fact(edge(c,a)).
yes ?- tc(c, a).
no ?- abolish_all_tables. {ERROR: user:abolish_all_tables/0 - existence error: procedure:user:abolish_all_tables/0 does not exist}
no ================= END =================
My problem is that the truth of `tc(c,a)` changes due to me asserting the fact `edge(c,a)`. Since I already evaluated `tc(c,a)` once, and tc is declared as tabled, ciao gives me the tabled, now incorrect, value instead of performing a new computation. I would therefore like to abolish all tables to force ciao to evaluate the query anew. What is it that I am doing wrong?
Thank you for your help!
Lorenz
PS: I am using the current development version of ciao (1.15-1781-g328b907). During the configuration stage of the build I explicitly enabled tabling support. _______________________________________________ Ciao-users mailing list Ciao-users(a)clip.dia.fi.upm.es http://clip.dia.fi.upm.es/cgi-bin/mailman/listinfo/ciao-users
Best,