['matchLhss' added to Rules.hs, 'numberOfPartitions' added to Rateable.hs
martin.hofmann@uni-bamberg.de**20090126142203] hunk ./src/Data/Rules.hs 7
-    freeVars, hasFreeVars, openPositions, antiunifyRules,
+    freeVars, hasFreeVars, openPositions, antiunifyRules,matchLhss, 
hunk ./src/Data/Rules.hs 27
+import Terms.Unifier
hunk ./src/Data/Rules.hs 38
+ 
+
hunk ./src/Data/Rules.hs 115
-        
+
+matchLhss :: Rule -> Rule -> LM Bool
+matchLhss r1 r2 
+    | length ls1 == length ls2 = 
+        (liftM and) $ mapM (uncurry matches) (zip ls1 ls2)
+    | otherwise                    = return False
+    where  
+    ls1 = lhs r1
+    ls2 = lhs r2
+             
hunk ./src/Rating/Rateable.hs 12
+import Terms.Unifier
+import Logging
hunk ./src/Rating/Rateable.hs 49
---noOfPartitions                 
+numberOfPartitions :: Hypo -> RatingData
+numberOfPartitions h =  length $ foldl' leastPatterns [] $ S.toList $ allRules h
+    where
+    leastPatterns [] p = [p]
+    leastPatterns (p1:ps) p2
+        | unLM (matchLhss p1 p2) = p2:ps
+        | unLM (matchLhss p2 p1) = p1:ps
+        | otherwise            = p1:(leastPatterns ps p2)
+                     
hunk ./src/Terms/Class.hs 18
---import Language.Haskell.TH ( Dec (FunD)
---                           , Clause (Clause)
---                           , Body (NormalB)
---                           , Exp (VarE, ConE, LitE, ListE, TupE, InfixE, AppE, CondE)
---                           , Pat (VarP, ConP, LitP, ListP, TupP, InfixP) 
---                           , Q(..)
---                           , Name, mkName)
-import Language.Haskell.TH
+import Language.Haskell.TH ( Dec (FunD)
+                           , Clause (Clause)
+                           , Body (NormalB)
+                           , Exp (VarE, ConE, LitE, ListE, TupE, InfixE, AppE, CondE)
+                           , Pat (VarP, ConP, LitP, ListP, TupP, InfixP) 
+                           , Q(..)
+                           , Name, mkName)