preMinimize :: [Term] -> [Term]
preMinimize patterns = filter (not . isMatched) patterns
  where isMatched p = any (matches' p) patterns
        matches' p q = not (matches p q) && matches q p
preMinimize :: [Term] -> [Term]
preMinimize patterns = filter (not . isMatched) patterns
  where isMatched p = any (matches' p) patterns
        matches' p q = not (matches p q) && matches q p
preMinimize patterns = filter (not . isMatched) patterns
  where isMatched p = any (matches' p) patterns
        matches' p q = not (matches p q) && matches q p