]> hydra-www.ietfng.org Git - dyna2/commitdiff
Generate update plans for backchained items
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Fri, 5 Jul 2013 18:12:04 +0000 (14:12 -0400)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Fri, 5 Jul 2013 18:17:37 +0000 (14:17 -0400)
This is necessary to allow retraction.

While here, wire up a backchain example into the test harness.

examples/expected/factorial-bc.py.out [new file with mode: 0644]
examples/factorial-bc.dyna [moved from examples/backchain.dyna with 100% similarity]
src/Dyna/Analysis/RuleMode.hs
src/Dyna/Backend/Python/Selftest.hs

diff --git a/examples/expected/factorial-bc.py.out b/examples/expected/factorial-bc.py.out
new file mode 100644 (file)
index 0000000..5d44b0e
--- /dev/null
@@ -0,0 +1,5 @@
+
+Solution
+========
+a = 24.
+
index 99de641a2a4e9ac2b974e05385a8e7a65becc7cf..dce455954833aa42d8644ebb2f54479172c2a63f 100644 (file)
@@ -604,10 +604,13 @@ planEachEval bp bc cs r  =
     -- Filter out non-constant evaluations
     --
     -- XXX This instead should look at the update modes of each evaluation
+    --
+    -- XXX Even if we do that, however, we need to be sure that retractable
+    -- items have the right modes.
   $ MA.mapMaybe (\ec -> case ec of
                           (n, CCall _ is f) -> let fa = (f,length is)
                                                in if    not (cs fa)
-                                                     && not (fa `S.member` bc)
+                                                     -- && not (fa `S.member` bc)
                                                    then Just (n, ec)
                                                    else Nothing
                           (n, CEval _ _   ) -> Just (n,ec))
index 45664a861308ccaae6ae4774ed0017550518f6db..652750c1dd27ae033f1ff47ffd46a97c8ab99238 100644 (file)
@@ -78,7 +78,7 @@ mkExample name =
 test_End_To_End :: [Test]
 test_End_To_End = map mkExample
   [ "simple", "equalities", "fib-limit", "dijkstra", "papa2", "matrixops"
-  , "geom", "lists", "dijkstra-backpointers" ]
+  , "factorial-bc", "geom", "lists", "dijkstra-backpointers" ]
 
 test_REPL :: [Test]
 test_REPL = map (\n -> testProgramRuns n ("./test/repl/"++n) [])