[organise imports/exports, doc, reduced warnings
martin.hofmann@uni-bamberg.de**20081208155042] hunk ./src/Data/CallDependencies.hs 12
-import Data.Graph.Inductive (Graph,Gr, Node, LNode, Path, LPath(..), lbft, noNodes, run_, insMapNodeM, insMapEdgesM, insMapEdgeM, delMapEdgeM)
+
+import Data.Graph.Inductive (
+    Graph, Gr, Node, LNode, LPath(..), 
+    lbft, noNodes, run_, insMapNodeM, 
+    insMapEdgeM, delMapEdgeM
+    )
hunk ./src/Data/CallDependencies.hs 19
+
hunk ./src/Data/CallDependencies.hs 52
-instance (Eq a, Eq b)   => Eq (Gr a b) where
-    (==) _ _  = True
-instance (Ord a, Ord b) => Ord (Gr a b) where
-    compare  _ _  = EQ
+
hunk ./src/Data/CallDependencies.hs 56
+newtype Calls = Calls{ unC :: (Gr Name Ordering)}
+     deriving (Show)
+instance Eq Calls where
+    (==) _ _ = True
+instance Ord Calls where
+    compare _ _ = EQ
+        
hunk ./src/Data/CallDependencies.hs 64
-    { callings :: Gr Name Ordering
+    { callings :: Calls
hunk ./src/Data/CallDependencies.hs 69
+    
hunk ./src/Data/CallDependencies.hs 71
-noCalls = CD G.empty M.empty
+noCalls = CD (Calls G.empty) M.empty
hunk ./src/Data/CallDependencies.hs 85
+{-
+ | Returns 'True' if the Call is admissible in the given CallDependencies,
+ | 'False' otherwise.
+-}
hunk ./src/Data/CallDependencies.hs 95
-        (Just (nf,ng)) -> dependencies ng nf cs
-        Nothing        -> []
+        (Just (nf,ng)) -> dependencies ng nf (unC cs)
+        Nothing       -> []
hunk ./src/Data/CallDependencies.hs 103
-    
+
+{- 
+ | Get a the node by a Name (if it is in the Map
+-}    
hunk ./src/Data/CallDependencies.hs 118
-    let (CD cs ns) = foldl (flip addFunUnsafe) cd [f1,f2] 
-    in CD (addEdge c cs) ns
+    let (CD (Calls cs) ns) = foldl (flip addFunUnsafe) cd [f1,f2] 
+    in CD (Calls (addEdge c cs)) ns
hunk ./src/Data/CallDependencies.hs 124
-addFunUnsafe n cd@(CD cs ns) = 
+addFunUnsafe n cd@(CD (Calls cs) ns) = 
hunk ./src/Data/CallDependencies.hs 129
-           in CD cs' ns'
+           in CD (Calls cs') ns'
hunk ./src/Data/Fragments.hs 18
-import Data.Rules (Rule, Rateable(..), rhs, lhs)
hunk ./src/Data/Fragments.hs 20
-import Data.Util
+
+import Data.Rules (Rule, Rateable(..), rhs, lhs)
+
hunk ./src/Data/Fragments.hs 24
+
hunk ./src/Data/Fragments.hs 26
-import qualified Data.Set as S (member, empty, fromList, toList, fold, map,size, null, insert, delete, union)
+import qualified Data.Set as S (empty, fromList, toList, map,size, null, insert, delete, union)
+
hunk ./src/Data/Fragments.hs 30
+import Data.Util
+
hunk ./src/Data/Fragments.hs 36
-
+-- | An open position is defined by an expression (which should be a variable)
+--   and a list of 'Position's in a term, which are open. 
+--   This only makes sense in combination with a 'Rule'
hunk ./src/Data/Fragments.hs 40
+
hunk ./src/Data/Fragments.hs 50
+
+instance Rateable RuleFrag where
+    rate = rate.frag
+
hunk ./src/Data/Fragments.hs 55
+ -- | A rule is open if it is not closed
hunk ./src/Data/Fragments.hs 57
-isOpen = not.P.null.opos
+isOpen = not.isClosed
+
+-- | A rule is closed if it does not have any open positions
+isClosed = P.null.opos
hunk ./src/Data/Fragments.hs 62
+-- | A simple constructor for a RuleFrag
hunk ./src/Data/Fragments.hs 66
+-- | Constructor for a RuleFrag
hunk ./src/Data/Fragments.hs 70
-instance Rateable RuleFrag where
-    rate = rate.frag
-
-
-
+-- |Returns a list with all free variables (as a list of expressions)
+--  in the given rule 
hunk ./src/Data/Fragments.hs 114
-
hunk ./src/Data/Fragments.hs 120
-insertM :: RuleFrag -> Maybe RuleFrags -> Maybe RuleFrags
-insertM  r rs   = rs >>= \rs' -> return $ insert r rs'
+-- *FIXME* necessary? 
+--insertM :: RuleFrag -> Maybe RuleFrags -> Maybe RuleFrags
+--insertM  r rs   = rs >>= \rs' -> return $ insert r rs'
hunk ./src/Data/Fragments.hs 127
-deleteM :: RuleFrag -> Maybe RuleFrags -> Maybe RuleFrags
-deleteM r rs = do
-    rs' <- rs
-    d   <- return $ delete r rs'
-    if null d
-      then return d
-      else fail ""
+-- *FIXME* necessary? 
+--deleteM :: RuleFrag -> Maybe RuleFrags -> Maybe RuleFrags
+--deleteM r rs = do
+--    rs' <- rs
+--    d   <- return $ delete r rs'
+--    if null d
+--      then return d
+--      else fail ""
hunk ./src/Data/Fragments.hs 143
-replaceM r1 r2 = (insertM r2).(deleteM r2)
+-- *FIXME* necessary? 
+--replaceM r1 r2 = (insertM r2).(deleteM r2)
hunk ./src/Data/Fragments.hs 151
-fromSet :: Set RuleFrag -> RuleFrags
-fromSet rs = RFS rs
+--fromSet :: Set RuleFrag -> RuleFrags
+--fromSet rs = RFS rs
hunk ./src/Data/HypoSpace.hs 16
-import Data.Fragments (RuleFrag, RuleFrags, ruleFrags)
+import Data.Fragments (RuleFrag, RuleFrags)
hunk ./src/Data/HypoSpace.hs 25
-import Control.Monad (liftM)
-import Data.Maybe (fromMaybe, mapMaybe, maybeToList, catMaybes)
+import Data.Maybe (mapMaybe)
hunk ./src/Data/HypoSpace.hs 29
-import Data.List (foldl', elem) 
+import Data.List (foldl') 
hunk ./src/Data/HypoSpace.hs 34
-import Data.Initialiser
-
-import qualified Data.Set as S
hunk ./src/Data/HypoSpace.hs 68
-getByRule :: RuleFrag -> HSpace -> [Hypo]   
-getByRule r hsp = 
-    let ids = case M.lookup r (ruleIdsMap hsp) of
-                Just i -> i
-                Nothing -> []
-    in mapMaybe ((flip getById) hsp) ids
-    
-getByRate :: RatingData -> HSpace -> [Hypo]   
-getByRate r hsp = 
-    let ids = case M.lookup r (rateIdsMap hsp) of
-                Just i -> i
-                Nothing -> []
-    in mapMaybe ((flip getById) hsp) ids
+-- FIXME: necessary?
+--getByRule :: RuleFrag -> HSpace -> [Hypo]   
+--getByRule r hsp = 
+--    let ids = case M.lookup r (ruleIdsMap hsp) of
+--                Just i -> i
+--                Nothing -> []
+--    in mapMaybe ((flip getById) hsp) ids
+--    
+--getByRate :: RatingData -> HSpace -> [Hypo]   
+--getByRate r hsp = 
+--    let ids = case M.lookup r (rateIdsMap hsp) of
+--                Just i -> i
+--                Nothing -> []
+--    in mapMaybe ((flip getById) hsp) ids
hunk ./src/Data/HypoSpace.hs 83
-alterRateIdsMap :: (Maybe [Integer] -> Maybe [Integer])
-                     -> Hypo
-                     -> HSpace
-                     -> HSpace
+alterRateIdsMap :: (Maybe [Integer] -> Maybe [Integer]) 
+                   -- ^alter with function
+                -> Hypo
+                   -- ^at 'Hypo'
+                -> HSpace
+                   -- ^in HypoSpace
+                -> HSpace
+                   -- ^yielding resulting HypoSpace
hunk ./src/Data/HypoSpace.hs 95
-alterRuleIdsMap :: (Maybe [Integer] -> Maybe [Integer])   -- ^alter with function
-                     -> Hypo                              -- ^at each ruleFrag in Hypo
-                     -> HSpace                            -- ^in HypoSpace
-                     -> HSpace                            -- ^yielding resulting HypoSpace
+alterRuleIdsMap :: (Maybe [Integer] -> Maybe [Integer])
+                   -- ^alter with function
+                -> Hypo
+                   -- ^at each ruleFrag in Hypo
+                -> HSpace
+                   -- ^in HypoSpace
+                -> HSpace
+                   -- ^yielding resulting HypoSpace
hunk ./src/Data/HypoSpace.hs 109
-                    -> Hypo
-                    -> HSpace
-                    -> HSpace
+                 -> Hypo
+                   -- ^at Hypo
+                 -> HSpace
+                   -- ^in HypoSpace
+                 -> HSpace
+                   -- ^yielding resulting HypoSpace
hunk ./src/Data/HypoSpace.hs 117
-    in  him `seq` hsp{hypoIdBimap = f h him} 
+    in  hsp{hypoIdBimap = f h him} 
hunk ./src/Data/HypoSpace.hs 142
-mbInsert i is = 
-    case is of
-        Just is' -> Just $ i:is'
-        Nothing  -> Just $ [i] 
-
+    mbInsert i is = 
+        case is of
+            Just is' -> Just $ i:is'
+            Nothing  -> Just $ [i] 
hunk ./src/Data/HypoSpace.hs 147
-
- -- | /O(log n)/, delete a hypothese from the search space   
+-- | /O(log n)/, delete a hypothese from the search space   
hunk ./src/Data/HypoSpace.hs 164
-    
+-- | /O(log n)/, try to replace a 'Hypo', if the second argument is 'Nothing' 
+--   the HypoSpace is returned unchanged.       
hunk ./src/Data/HypoSpace.hs 198
-
-
-    
+  
hunk ./src/Data/HypoSpace.hs 212
-
-
-revhsp0 = initHSpace hypor04
-revhsp1 = insert hypor04 revhsp0
-revhsp2 = insert hypor24 revhsp1
-revhsp3 = insert hypor34 revhsp2
-revhsp4 = insert hypor34 revhsp3
-
-test1 = propagate pd1424 $ propagate pd0414 revhsp4
-stack_overflow = S.fromList [fragai04,fragai14] --[hypor14,hypor14]
-hyposrevall = insert hypor44 $ insert hypor34 $ insert hypor24 $ insert hypor14 $  initHSpace hypor04
hunk ./src/Data/Hypotheses.hs 8
-    Hypos, hypos,  empty, singleton, null,
+    Hypos, hypos,  empty, singleton, null, size,
hunk ./src/Data/Hypotheses.hs 22
-import Terms
-import Control.Monad (foldM, liftM)
+import Language.Haskell.TH (Name)
+import Control.Monad (foldM)
hunk ./src/Data/Hypotheses.hs 32
-import Data.Rules (Rules, Rule, Rateable(..), rules)
-import qualified Data.Rules as R --(insert,delete, replace, map, fold, union)
+import Data.Rules (Rules, Rateable(..))
+import qualified Data.Rules as R 
hunk ./src/Data/Hypotheses.hs 35
-import Data.Fragments (RuleFrag, RuleFrags,name, frag, covr, opos)
+import Data.Fragments (RuleFrag, RuleFrags,name, frag, )
hunk ./src/Data/Hypotheses.hs 40
-import Data.Util
hunk ./src/Data/Hypotheses.hs 143
-hyposToSet = unHHs
+--hyposToSet = unHHs
hunk ./src/Data/IOData.hs 6
-import Data.Hypotheses ()
hunk ./src/Data/IOData.hs 8
-import Data.Map (Map)
-
hunk ./src/Data/IOData.hs 65
-
+-- |Retrieve all 'Rules' of a function with the provided 'Name' from the 
+--  background knowledge
hunk ./src/Data/IOData.hs 72
-        
+ 
+-- |Retrieve the ith 'Rule' of a function with the provided 'Name' from the 
+--  background knowledge (zero based)      
hunk ./src/Data/IOData.hs 77
-       
+
+
+-- |sRetrieve the specified 'Rules' of a function with the provided 'Name' from the 
+--  background knowledge (zero based)       
hunk ./src/Data/IOData.hs 83
-        
+
+-- |Access 'Rules' in the background knowledge by the 'Name' of a function        
hunk ./src/Data/IOData.hs 88
-
+-- |Access the 'Name' of a function in the background knowledge by its 'Rules'
hunk ./src/Data/IOData.hs 96
-{-
- | /O(log n)/ Insert the rules associated with the Name into the IOData. If either rules or
- | Name exists already in IOData, previous bindings are deleted. 
+{-|
+ /O(log n)/ Insert the rules associated with the Name into the IOData. If either rules or
+ Name exists already in IOData, previous bindings are deleted. 
hunk ./src/Data/IgorData.hs 4
-import Data.IOData (IOData, emptyIOData, getAll, getSpecifics)
+import Data.IOData (IOData, getAll, getSpecifics)
hunk ./src/Data/IgorData.hs 6
-import Language.Haskell.TH
---import qualified Data.IOData as I
hunk ./src/Data/IgorData.hs 9
-import qualified Data.Rules as R
+
hunk ./src/Data/IgorData.hs 12
+
hunk ./src/Data/IgorData.hs 15
+
hunk ./src/Data/Initialiser.hs 2
+-- | This module defines several functions to translate from/to TH datatypes
hunk ./src/Data/Initialiser.hs 14
---import Data.IOData
---import Data.HypoSpace
+
+
hunk ./src/Data/Initialiser.hs 52
-
+-------------------------------------------------
+-- Testing Data
+------------------------------------------------- 
hunk ./src/Data/Rules.hs 15
+    rulesFromList, rulesFromSet,
hunk ./src/Data/Rules.hs 25
-import qualified Data.Set as S (empty,fromList, toList, fold, map, null, insert, delete, union)
+import qualified Data.Set as S (empty, fromList, toList, map, null, insert, delete)
hunk ./src/Data/Rules.hs 128
-replaceM r1 r2 = (insertM r2).(deleteM r2)
+replaceM r1 r2 = (insertM r2).(deleteM r1)
hunk ./src/Data/Util.hs 12
-cpsfold f a [] = a
+cpsfold _ a [] = a
hunk ./src/IgorMonad.hs 81
---              advanceRule (chooseOneRule openrules) 
---              best <- bestHypos 
---              trace ("CurrentBEST: " ++ show best ) $ closeHypos best