]> hydra-www.ietfng.org Git - dyna2/commitdiff
first pass at dopeamine pretty printing.
authortimv <tim.f.vieira@gmail.com>
Mon, 10 Dec 2012 06:54:01 +0000 (01:54 -0500)
committertimv <tim.f.vieira@gmail.com>
Mon, 10 Dec 2012 06:54:01 +0000 (01:54 -0500)
src/Dyna/Analysis/RuleMode.hs

index 0ce62a4652dccb44f17e4c8f942d0bf3950c2140..71c1b3acb9d91a8a21985b628bff9be1b957bdb6 100644 (file)
@@ -10,9 +10,9 @@
 {-# LANGUAGE Rank2Types #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 
-module Dyna.Analysis.RuleMode (
+module Dyna.Analysis.RuleMode {-(
     Det(..), DOpAMine(..), detOfDop, planEachEval
-) where
+)-} where
 
 import           Control.Monad
 import qualified Data.ByteString.Char8      as BC
@@ -55,7 +55,7 @@ data ModedNT = MF DVar
  deriving (Eq,Ord,Show)
 
 modeOfMNT :: ModedNT -> Mode
-modeOfMNT (MF _) = MFree 
+modeOfMNT (MF _) = MFree
 modeOfMNT (MB _) = MBound
 
 ntvOfMNT :: ModedNT -> NTV
@@ -152,7 +152,7 @@ possible (f,is,o) = case f of
                     _   -> []
 
     -- Unification
-  CFUnif funct -> 
+  CFUnif funct ->
       case o of
         -- If the output is free, the only supported case is when all
         -- inputs are known.
@@ -177,7 +177,7 @@ possible (f,is,o) = case f of
           cis        = MA.catMaybes mcis
 
         MB _ -> []   -- XXX shouldn't happen
-          
+
     -- Backward-chainable mathematics (this is such a hack XXX)
   CFCall funct | isMath funct ->
       if not $ all isBound is
@@ -292,7 +292,7 @@ plan :: (Crux ModedNT -> [Action])
      -> ANFState
      -> Crux NTV
      -> Maybe (Cost, Action)
-plan st sc anf cr@(_,ci,co) = 
+plan st sc anf cr@(_,ci,co) =
   let cruxes =    eval_cruxes anf
                ++ unif_cruxes anf
       initPlan = PP { pp_cruxes = S.delete cr (S.fromList cruxes)
@@ -330,6 +330,6 @@ main = mapM_ (\(c,msp) -> do
        $ testPlanRule
        -- $ "fib(X) :- fib(X-1) + fib(X-2)"
        $ "path(pair(Y,Z),V) min= path(pair(X,Y),U) + cost(X,Y,Z,U,V)."
-       -- $ "goal += f(&pair(Y,Y))." -- 
+       -- $ "goal += f(&pair(Y,Y))." --
 
 ------------------------------------------------------------------------}}}