From: David W. <wa...@cs...> - 2007-06-08 17:36:32
|
Terrance Swift writes: > ---------- Forwarded message ---------- > Date: Fri, 8 Jun 2007 11:52:51 +0200 > From: Sven Kloppenburg <klo...@st...> > To: ts...@us... > Subject: incremental tabling > > Hi, > > > I am working with the incremental tabling feature of XSB. > It seems to be broken. When I try the example from the manual: > > p(X,Y) :- q(X,Y),Y =< 5. > :- dynamic q/2 as incremental. > :- use_incremental_dynamic q/2. > q(a,1). > q(b,3). > q(c,5). > q(d,7). > > :- p(X,Y),writeln([X,Y]),fail. > :- incr_assert(q(d,4)). > :- writeln('where is the 4?'). > :- p(X,Y),writeln([X,Y]),fail. > :- writeln('strange.'). > :- p(X,4),writeln([X,Y]),fail. > > the following is written to stdout: > > [c,5] > [b,3] > [a,1] > where is the 4? > [c,5] > [b,3] > [a,1] > strange. > [d,_h3923] > > > so, XSB knows, what char corresponds to p(A,4), but does not know, > that p(_,4) > exists. After a "abolish_all_tables" the 4 is returned, but then the > incremental tabling is not incremental. > > > What am I doing wrong? > > BTW: > my XSB is a recent CVS checkout (from tonight) and I am on MacosX: > > XSB Version 3.0.1+ (CVS (Sagres)) of August 7, 2006 > [i686-apple-darwin8.9.1; mode: optimal; engine: slg-wam; gc: > indirection; scheduling: local] When I run it on my system (current CVS plus a few minor changes completely unrelated to incremental tabling), under Windows with cygwin, I get: bash-3.1$ xsb [xsb_configuration loaded] [sysinitrc loaded] XSB Version 3.0.1+ (CVS (Sagres)) of August 7, 2006 [i686-pc-cygwin; mode: optimal; engine: slg-wam; gc: indirection; scheduling: local] | ?- [incr_tabling_bug_sven]. [Compiling .\incr_tabling_bug_sven] [incr_tabling_bug_sven compiled, cpu time used: 0.0470 seconds] [incr_tabling_bug_sven loaded] [a,1] [b,3] [c,5] where is the 4? [a,1] [b,3] [c,5] [d,4] strange. [d,_h3874] yes | ?- So I do get the 4. (I did have to import incr_assert/1 from increval.) And I also get the same result when running the MSVC-compiled version. So I can't reproduce your problem. I'm wondering if there could be a difference on the Mac? Terry, can you see what result you get? %%%% program p(X,Y) :- q(X,Y),Y =< 5. :- dynamic q/2 as incremental. :- use_incremental_dynamic q/2. q(a,1). q(b,3). q(c,5). q(d,7). :- import incr_assert/1 from increval. :- p(X,Y),writeln([X,Y]),fail. :- incr_assert(q(d,4)). :- writeln('where is the 4?'). :- p(X,Y),writeln([X,Y]),fail. :- writeln('strange.'). :- p(X,4),writeln([X,Y]),fail. %%%% program Thanks, -David |