[Consequently used ArgList and FunList throughout Matching.hs, and removed some dead code.
tobias@goedderz.info**20150311150101
 Ignore-this: f037c5c80971ecd43cfe82f25a789d48
] hunk ./src/Igor2/RuleDevelopment/Matching.hs 66
+{-
+    All ArgLists have the same length (during one call from indirectCalls),
+    namely the number of arguments of the target function (callee); the ith
+    list entry always corresponds to the ith argument.
+
+    A FunList is a collection of io examples which will be used to create a new
+    function via addIO (in mkIndirectCall).
+-}
+type ArgList a = [a]
+type FunList = [Rule]
+
hunk ./src/Igor2/RuleDevelopment/Matching.hs 124
-allMatchings :: [[(Ordering, [Rule])]] -> [(Ordering, [[Rule]])]
+allMatchings :: [[(Ordering, ArgList Rule)]] -> [(Ordering, ArgList FunList)]
hunk ./src/Igor2/RuleDevelopment/Matching.hs 127
-{-| Works like 'allMatchings', but returns only values of '(Ordering, [[Rule]])'
-    with a maximum number of closed lggs (of the inner '[Rule]'s).
+{-| Works like 'allMatchings', but returns only those list entries with
+    a maximum number of closed lggs (of the inner 'FunList's).
hunk ./src/Igor2/RuleDevelopment/Matching.hs 130
-bestMatchings :: Context -> [[(Ordering, [Rule])]] -> [(Ordering, [[Rule]])]
+bestMatchings :: Context -> [[(Ordering, ArgList Rule)]] -> [(Ordering, ArgList FunList)]
hunk ./src/Igor2/RuleDevelopment/Matching.hs 154
-                        nlggs <- nextLgg lggs rs
+                        nlggs <- nextLggs lggs rs
hunk ./src/Igor2/RuleDevelopment/Matching.hs 185
-{- This holds a *lower bound* on the maximum number of closed rules in
- - bestMatchings'.
- -}
-type StateMinClosedRules = StateT Int
-
-{-
-    All ArgLists have the same length (during one call from bestMatchings),
-    namely the number of arguments of the target function (callee); the ith
-    list entry always corresponds to the ith argument.
-
-    A FunList is a collection of io examples which will be used to create a new
-    function via addIO (in mkIndirectCall).
--}
-type ArgList a = [a]
-type FunList = [Rule]
-bestMatchings' :: (Ordering, ArgList FunList)
-               -> ArgList Rule
-               -> [[(Ordering, ArgList Rule)]]
-               -> StateMinClosedRules (C MatchingErrorMonad) [(Ordering, ArgList FunList)]
-bestMatchings' hist lggs [] =
-    do let numClosedRules = length $ filter Rules.isClosed lggs
-       -- Set the state to numClosedRules if numClosedRules is larger.
-       modify (max numClosedRules)
-       return [hist]
-bestMatchings' hist lggs (xs:xxs) =
-    concatMapM (\(o, rs) ->
-        do let nhist = (max o *** multiCons rs) hist
-           nlggs <- lift $ nextLgg lggs rs
-           let maxNumClosedRules = length $ filter Rules.isClosed nlggs
-           violatesLowerBound <- gets (> maxNumClosedRules)
-           if violatesLowerBound
-             then return []
-             else bestMatchings' nhist nlggs xxs
-    ) xs
-
-numClosedRulesOf :: ArgList FunList -> C MatchingErrorMonad Int
-numClosedRulesOf = liftM length . filterM (liftM Rules.isClosed . lggRules)
-
-{-| multiCons is a helper function for bestMatchings'.
+{-| multiCons is a helper function for bestMatchingsBnb.
hunk ./src/Igor2/RuleDevelopment/Matching.hs 200
-{-| nextLgg is a helper function for bestMatchings'.
+{-| nextLggs is a helper function for bestMatchingsBnb.
hunk ./src/Igor2/RuleDevelopment/Matching.hs 203
-    during anti-unification, bestMatchings just passes an empty list of lggs,
-    and nextLgg handles this case by just returning its second argument.
+    during anti-unification, bestMatchingsBnb just passes an empty list of lggs,
+    and nextLggs handles this case by just returning its second argument.
hunk ./src/Igor2/RuleDevelopment/Matching.hs 206
-nextLgg :: [Rule] -> [Rule] -> C MatchingErrorMonad [Rule]
-nextLgg []   rs = return rs
-nextLgg lggs rs = zipWithM (\x y -> lggRules [x, y]) rs lggs
+nextLggs :: ArgList Rule -> ArgList Rule -> C MatchingErrorMonad (ArgList Rule)
+nextLggs []   rs = return rs
+nextLggs lggs rs = zipWithM (\x y -> lggRules [x, y]) rs lggs
hunk ./src/Igor2/RuleDevelopment/Matching.hs 280
-mkIndirectCall :: CovrRule -> Name -> (Ordering, [[Rule]]) -> IM (CovrRules,[Call])
+mkIndirectCall :: CovrRule -> Name -> (Ordering, ArgList FunList) -> IM (CovrRules,[Call])
hunk ./src/Igor2/RuleDevelopment/Matching.hs 316
-makeIOMatrix :: [CovrRule] -> Ordering -> [CovrRule] -> IM [[(Ordering, [Rule])]]
+makeIOMatrix :: [CovrRule] -> Ordering -> [CovrRule] -> IM [[(Ordering, ArgList Rule)]]
hunk ./src/Igor2/RuleDevelopment/Matching.hs 328
-abduceIO :: CovrRule -> Ordering -> CovrRule -> IM (Maybe (Ordering, [Rule]))
+abduceIO :: CovrRule -> Ordering -> CovrRule -> IM (Maybe (Ordering, ArgList Rule))