[print rating with hypothesis
martin.hofmann@uni-bamberg.de**20091012150804] hunk ./src/Data/Hypotheses.hs 30
+import Data.Function (on)
+
hunk ./src/Data/Hypotheses.hs 35
-import Data.CallDependencies (CallDep, Call, tryAddCall, noCalls)
+import Data.CallDependencies (CallDep, Call, tryAddCall, noCalls, cycles)
hunk ./src/Data/Hypotheses.hs 37
+import Rating.Rateable
hunk ./src/Data/Hypotheses.hs 67
-	pretty h@(HH o c cs) = text "Hypo:" <+> 
-                         (align $ vcat $ map (pretty) (rules2decs . allBindings $ h))
+	pretty h@(HH o c cs) = text "Hypo" <+> 
+                         (align $ vcat $ ((pretty . rate $ h)<> colon) : (map (pretty) (rules2decs . allBindings $ h)))
hunk ./src/Data/Hypotheses.hs 126
-    | otherwise    = h{clsd = M.alter (deleteM (crul rf)) (name rf) cs}
+    | otherwise  = h{clsd = M.alter (deleteM (crul rf)) (name rf) cs}
hunk ./src/Data/Hypotheses.hs 211
+
+--------------------------------------------------------------------------------
+-- Rate a Hypothese
+--------------------------------------------------------------------------------
+instance Rateable Hypo where
+    rate h       = 
+     let numPartitions  = numberOfPartitions h
+         numClosedPartitions  = numberOfClosedPartitions h
+         numOpenRules   = numberOfOpenRules h
+         numFreeVars    = numberOfFreeVars h
+         numTotalRules   = numberOfTotalRules h
+         numCycles = cycles . callings $ h
+         numFVarPerRule  = if (numOpenRules == 0) then 0.0 else on (/) fromIntegral numFreeVars numOpenRules
+     in ( mkRatingData
+          --numPartitions + numCycles + numOpenRules
+          numPartitions
+         -- numCycles
+         -- numOpenRules
+          numFreeVars
+          numTotalRules
+          numFVarPerRule
+        )
+
+-- count the number of open 'Rule's in a hypothese
+numberOfOpenRules :: Hypo -> Int                 
+numberOfOpenRules = S.size.openRules 
+
+-- count the number of all rules in a hypothese
+numberOfTotalRules :: Hypo -> Int 
+numberOfTotalRules =  S.size.allRules 
+
+
+numberOfFreeVars :: Hypo -> Int
+numberOfFreeVars h = 
+    foldl1 (+) $ map (length.freeVars) (S.toList $ allRules h)
+
+numberOfPartitions :: Hypo -> Int
+numberOfPartitions = length . (foldl' leastPatterns []) . (filter (not . hasHO)) . S.toList . allRules 
+    where
+    leastPatterns [] p = [p]
+    leastPatterns (p1:ps) p2
+        | matchLhss p1 p2 = p1:ps
+        | matchLhss p2 p1 = p2:ps
+        | otherwise       = p1:(leastPatterns ps p2)
+        
+numberOfClosedPartitions :: Hypo -> Int
+numberOfClosedPartitions = length . (foldl' leastPatterns []) . (filter (not . hasHO)) . S.toList . closedRules 
+    where
+    leastPatterns [] p = [p]
+    leastPatterns (p1:ps) p2
+        | matchLhss p1 p2 = p1:ps
+        | matchLhss p2 p1 = p2:ps
+        | otherwise       = p1:(leastPatterns ps p2)
hunk ./src/Rating/Rateable.hs 4
-    Rateable(..), RatingData,
+    Rateable(..), RatingData, mkRatingData
hunk ./src/Rating/Rateable.hs 9
-import Data.Hypotheses
-import Data.Rules
hunk ./src/Rating/Rateable.hs 28
+
+mkRatingData = RD
hunk ./src/Rating/Rateable.hs 45
---------------------------------------------------------------------------------
--- Rate a Hypothese
---------------------------------------------------------------------------------
-instance Rateable Hypo where
-    rate h       = 
-     let numPartitions  = numberOfPartitions h
-         numClosedPartitions  = numberOfClosedPartitions h
-         numOpenRules   = numberOfOpenRules h
-         numFreeVars    = numberOfFreeVars h
-         numTotalRules   = numberOfTotalRules h
-         numCycles = cycles . callings $ h
-         numFVarPerRule  = if (numOpenRules == 0) then 0.0 else on (/) fromIntegral numFreeVars numOpenRules
-     in ( RD
-          --numPartitions + numCycles + numOpenRules
-          numPartitions
-         -- numCycles
-         -- numOpenRules
-          numFreeVars
-          numTotalRules
-          numFVarPerRule
-        )
-
--- count the number of open 'Rule's in a hypothese
-numberOfOpenRules :: Hypo -> Int                 
-numberOfOpenRules = S.size.openRules 
hunk ./src/Rating/Rateable.hs 46
--- count the number of all rules in a hypothese
-numberOfTotalRules :: Hypo -> Int 
-numberOfTotalRules =  S.size.allRules 
-
-
-numberOfFreeVars :: Hypo -> Int
-numberOfFreeVars h = 
-    foldl1 (+) $ map (length.freeVars) (S.toList $ allRules h)
-
-numberOfPartitions :: Hypo -> Int
-numberOfPartitions = length . (foldl' leastPatterns []) . (filter (not . hasHO)) . S.toList . allRules 
-    where
-    leastPatterns [] p = [p]
-    leastPatterns (p1:ps) p2
-        | matchLhss p1 p2 = p1:ps
-        | matchLhss p2 p1 = p2:ps
-        | otherwise       = p1:(leastPatterns ps p2)
-        
-numberOfClosedPartitions :: Hypo -> Int
-numberOfClosedPartitions = length . (foldl' leastPatterns []) . (filter (not . hasHO)) . S.toList . closedRules 
-    where
-    leastPatterns [] p = [p]
-    leastPatterns (p1:ps) p2
-        | matchLhss p1 p2 = p1:ps
-        | matchLhss p2 p1 = p2:ps
-        | otherwise       = p1:(leastPatterns ps p2)