From: Tim Vieira Date: Sun, 28 Jul 2013 18:43:54 +0000 (-0400) Subject: added test case for issue #66 X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=d12e1ca0cb6db99f1cc316287ca19805fd2f13a8;p=dyna2 added test case for issue #66 --- diff --git a/test/repl/add-bc.dynadoc b/test/repl/add-bc.dynadoc new file mode 100644 index 0000000..08586da --- /dev/null +++ b/test/repl/add-bc.dynadoc @@ -0,0 +1,27 @@ +% stale backchaining memos when new rules are added (#66) + +> :- backchain sum/1. +> sum(N) += K for K in range(N). +> query sum(10) + +sum(10) = 45. + +> sum(N) += 10000. + +> query sum(10) + +sum(10) = 10045. + +> query sum(11) + +sum(11) = 10055. + +> query sum(9) + +sum(9) = 10036. + +% Also, sum(9) would have been memoized wrong as well (from during the stale +% sum(10) computation) if we'd defined like this: + +% sum(0) += 0. +% sum(N) += N + sum(N_1) for N > 0. \ No newline at end of file