From: Terrance S. <ts...@us...> - 2010-04-21 19:26:14
|
Update of /cvsroot/xsb/xsbtests/table_tests In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv15372 Modified Files: test.sh Added Files: incremental1.P incremental1_1.P incremental1_old Log Message: Added test of alternate incremental declarations. --- NEW FILE: incremental1.P --- /* This prevents a spurious error for executing incremental under the mt engine, which does not yet support incremental tabling. */ test:- (xsb_configuration(engine_mode,'multi-threading') -> load_dync(incremental1_old), (incr(X),write(incr(X)),writeln('.'),fail ; true) ; [incremental1_1],test_seq). --- NEW FILE: incremental1_1.P --- :- import incr_assert/1,incr_retractall/1,incr_assert_inval/1, incr_table_update/0,incr_retract_inval/1 from increval. test_seq:- test1,fail. test_seq:- test2. % direct dependency test1:- p(X,Y),incr_writeln(first_p(X,Y)),fail. test1:- incr_assert(q(d,4)),fail. test1:- p(X,Y),incr_writeln(second_p(X,Y)),fail. test1:- incr_retractall(q(a,_X)),fail. test1:- p(X,Y),incr_writeln(third_p(X,Y)),fail. test1:- incr_retract_inval(q(b,_X)),fail. test1:- get_residual(p(X,Y),_),incr_writeln(fourth_p(X,Y)),fail. test1:- incr_table_update,get_residual(p(X,Y),_),incr_writeln(fifth_p(X,Y)),fail. test1:- incr_assert_inval(q(e,2)),fail. test1:- get_residual(p(X,Y),_),incr_writeln(sixth_p(X,Y)),fail. test1:- incr_table_update,get_residual(p(X,Y),_),incr_writeln(seventh_p(X,Y)),fail. test1. % transitive dependency test2:- n(X,Y),incr_writeln(first_n(X,Y)),fail. test2:- incr_assert(q(f,4)),fail. test2:- n(X,Y),incr_writeln(second_n(X,Y)),fail. test2:- incr_retractall(q(d,_X)),fail. test2:- n(X,Y),incr_writeln(third_n(X,Y)),fail. test2:- incr_retract_inval(q(e,_X)),fail. test2:- get_residual(n(X,Y),_),incr_writeln(fourth_n(X,Y)),fail. test2:- incr_table_update,get_residual(n(X,Y),_),incr_writeln(fifth_n(X,Y)),fail. test2:- incr_assert_inval(q(g,2)),fail. test2:- get_residual(n(X,Y),_),incr_writeln(sixth_n(X,Y)),fail. test2:- incr_table_update,get_residual(n(X,Y),_),incr_writeln(seventh_n(X,Y)),fail. test2. incr_writeln(Term):- write(incr(Term)),writeln('.'). :- table p/2 as incremental. p(X,Y) :- q(X,Y),Y =< 5. :- table n/2 as incremental. n(X,Y) :- p(X,Y),Y < 5. %:- use_incremental_dynamic q/2. %:- dynamic q/2. :- dynamic q/2 as incremental. q(a,1). q(b,3). q(c,5). q(d,7). end_of_file. --- NEW FILE: incremental1_old --- incr(fifth_n(f,4)). incr(fifth_p(c,5)). incr(fifth_p(d,4)). incr(first_n(d,4)). incr(first_n(e,2)). incr(first_p(a,1)). incr(first_p(b,3)). incr(first_p(c,5)). incr(fourth_n(e,2)). incr(fourth_n(f,4)). incr(fourth_p(b,3)). incr(fourth_p(c,5)). incr(fourth_p(d,4)). incr(second_n(d,4)). incr(second_n(e,2)). incr(second_n(f,4)). incr(second_p(a,1)). incr(second_p(b,3)). incr(second_p(c,5)). incr(second_p(d,4)). incr(seventh_n(f,4)). incr(seventh_n(g,2)). incr(seventh_p(c,5)). incr(seventh_p(d,4)). incr(seventh_p(e,2)). incr(sixth_n(f,4)). incr(sixth_p(c,5)). incr(sixth_p(d,4)). incr(third_n(e,2)). incr(third_n(f,4)). incr(third_p(b,3)). incr(third_p(c,5)). incr(third_p(d,4)). Index: test.sh =================================================================== RCS file: /cvsroot/xsb/xsbtests/table_tests/test.sh,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- test.sh 19 Mar 2010 18:41:17 -0000 1.29 +++ test.sh 21 Apr 2010 19:26:04 -0000 1.30 @@ -101,8 +101,10 @@ ../gentest.sh "$XEMU $options" bulk_trie_test "test". #------------------------------------------------- ../gentest.sh "$XEMU $options" test_intern_seq "test". -#------------------------------------------------- % very simple -- needs more cases. +#------------------------------------------------- general incremental tests ../gentest.sh "$XEMU $options" incremental "test". +#------------------------------------------------- same as above, but with changed decls. +../gentest.sh "$XEMU $options" incremental1 "test". #------------------------------------------------- ../gentest.sh "$XEMU -l $options" aggregs_test_2 "test." #-------------------------------------------------- |