[don't consider rules when figuring out loopbreakers
John Meacham <john@repetae.net>**20060430061013] hunk ./E/SSimplify.hs 192
-collectBinding :: Bind -> OM Bind
+collectBinding :: Bind -> OM (Bind,OMap)
hunk ./E/SSimplify.hs 196
-    tell (OMap $ fmap (const Many) rvars, singleton (tvrIdent t))
-    return (t,e')
+        romap = OMap $ fmap (const Many) rvars
+    return ((t,e'),romap)
hunk ./E/SSimplify.hs 205
-    let graph = newGraph ds' (\ ((t,_),_) -> tvrIdent t) (\ (_,fv) -> mkeys fv)
-        rds = reachable graph (mkeys fve ++ [ tvrIdent t | (t,_) <- ds, getProperty prop_EXPORTED t || (tvrIdent t `member` exp)])
-        graph' = newGraph rds (\ ((t,_),_) -> tvrIdent t) (\ (_,fv) -> mkeys fv)
-        (lb,ds'') =  findLoopBreakers (\ ((t,e),_) -> loopFunc t e) (const True) graph'
+    let graph = newGraph ds' (\ (((t,_),_),_) -> tvrIdent t) (\ ((_,rv),fv) -> mkeys (fv `mappend` rv))
+        rds = reachable graph (mkeys fve ++ [ tvrIdent t | (t,_) <- ds,  (tvrIdent t `member` exp)])
+        -- ignore rules when calculating loopbreakers
+        -- we must not simplify the expanded body of a rule without recalculating occurance info.
+        graph' = newGraph rds (\ (((t,_),_),_) -> tvrIdent t) (\ (_,fv) -> mkeys fv)
+        (lb,lbds) =  findLoopBreakers (\ (((t,e),_),_) -> loopFunc t e) (const True) graph'
+        ds'' = map ( \ ((t,rv),rv') -> (t,rv `mappend` rv') ) lbds
hunk ./E/SSimplify.hs 214
-        cycNodes = (fromList $ [ tvrIdent v | ((v,_),_) <- cyclicNodes graph'] :: IdSet)
+        cycNodes = (fromList $ [ tvrIdent v | (((v,_),_),_) <- cyclicNodes graph'] :: IdSet)
hunk ./E/SSimplify.hs 219
-        lup t = case tvrIdent t `elem` [ tvrIdent t | ((t,_),_) <- lb] of
+        lup t = case tvrIdent t `elem` [ tvrIdent t | (((t,_),_),_) <- lb] of
hunk ./E/SSimplify.hs 221
-            False -> case getProperty prop_EXPORTED t || (tvrIdent t `member` exp) of
+            False -> case  (tvrIdent t `member` exp) of