[bugs in para intro fixed
martin.hofmann@uni-bamberg.de**20100810135821
 mediaitng functions of para must not call their caller EQ, forced it to be LT under those circumstances
] hunk ./src/Igor2/Data/CallDependencies.hs 6
-        admissible, allowedMaxCall, cycles, loops, annexCandidates
+        admissible, allowedMaxCall, cycles, loops, annexCandidates,
+        calledBy
hunk ./src/Igor2/Data/CallDependencies.hs 161
+-- given a function anem, return the names of all functions, which _directly_
+-- this function    
+calledBy :: Name -> CallDep -> [Name]
+calledBy n  cdp = 
+    case asNode n (nodes cdp) of
+         (Just node) -> (mapMaybe $ flip fromNode (nodes cdp)) . (map caller) . (filter ((node==) . callee)) . labEdges . unC . callings $ cdp
+         Nothing -> []
+    where
+      caller (c,_,_) = c
+      callee (_,c,_) = c
hunk ./src/Igor2/RuleDevelopment/Cata.hs 86
+    hasCtor n (TListE l  _)      = if null l then isNil n else isCons n
hunk ./src/Igor2/RuleDevelopment/Cata.hs 90
-    hasCtor n  _                 = False  
+    hasCtor n  c                 = (ts $ "XXX " ++ (showp n) ++ " "++  (showp c)) $ False  
hunk ./src/Igor2/RuleDevelopment/Cata.hs 123
-           (groupBy ((((all $ uncurry equal) . ) . zip) `on` lhs))
+           (groupBy ((((all $ uncurry equal) . ) . zip) `on` lhs)) .(tp "XXX")
hunk ./src/Igor2/RuleDevelopment/Cata.hs 184
-    (tyMorphIdcs cr >>= gmsg >>= oneOrNone (genericPara cr))
+    (tyMorphIdcs cr >>= return . ((lstCataArgIs cr)++) >>= gmsg >>= oneOrNone (genericPara cr))
hunk ./src/Igor2/RuleDevelopment/Cata.hs 219
-     ios  <- mapM (abduceIOs i) parts
+     ios  <- mapM (abduceParaIOs i) parts
hunk ./src/Igor2/RuleDevelopment/Cata.hs 262
-paraEx =  TConE ('cata) $ 
+paraEx =  TConE ('para) $ 
hunk ./src/Igor2/RuleDevelopment/Matching.hs 24
-
-    let scope     = allowedMaxCall (name cr) cd
+    p <- usePara
+    let scope     = allowedMaxCall (name cr) $ cd
hunk ./src/Igor2/RuleDevelopment/Matching.hs 27
-    let bgkcalls  = map (flip (,) (Just GT)) bknames
-    -- call sto background knowledge
-    let tgtcalls  = map (flip (,) (Just LT)) ((name cr):tgtnames)
+    let bgkcalls  = tag (Just GT) bknames
+    -- calls to background knowledge
+    let tgtcalls  = tag (Just LT) ((name cr):tgtnames)
hunk ./src/Igor2/RuleDevelopment/Matching.hs 31
-    let allcalls  =  M.toList $ foldl (flip $ uncurry M.insert) scope (tgtcalls ++ bgkcalls)
-    -- bkgcalls and tgtcalls may overwrite calls in scope,
+    let paracalls = if p then tag (Just LT) $ calledBy (name cr) cd else []
+    -- if we use paramorphisms, the mediating function should not match against their caller, because thios is trivial.
+    let allcalls  =  M.toList $ insertAll scope (tgtcalls ++ bgkcalls)
+    -- bkgcalls, tgtcalls, and paracalls may overwrite calls in scope, as well as each other
hunk ./src/Igor2/RuleDevelopment/Matching.hs 45
+    where
+      insertAll = foldl (flip $ uncurry M.insert)
+      tag t = map (flip (,) t)
hunk ./src/Igor2/UI/UIStarter.hs 426
-    , ("greedySplt",           "enable rapid rule-splittinge",
+    , ("greedySplt",           "enable greedy rule-splittinge",