ractorGroups st k@ returns all the distractor groups for @k@
--   in the discourse history.
--
--   A distractor is defined (here) as something that has the the same class
--   as @k@ but a different index, basically anything that might be confused
--   for the object in question
distractorGroups :: RefHistory -> RefKey -> [DiscourseUnit]
distractorGroups st (c, i) =
    filter distracting (Map.keys (rhCount st))
  where
    distracting = not . safe
    safe (Node rg2 _) = c /= rgClass rg2 -- different classes (OK)
                     || i `Set.member` rgIdxes rg2 -- includes me (OK)
                     || isClasswide rg2 -- classes aren't instances (OK)

-- | @hasSupersetMention st g@ returns whether or not the discourse history
--   contains a group that includes all members of @g@
--
--   Note that if a group has already occured in the discourse history, this
--   returns a True (ie. not a strict superset)
hasSupers
distractorGroups :: RefHistory -> RefKey -> [DiscourseUnit]
distractorGroups st (c, i) =
    filter distracting (Map.keys (rhCount st))
  where
    distracting = not . safe
    safe (Node rg2 _) = c /= rgClass rg2 -- different classes (OK)
                     || i `Set.member` rgIdxes rg2 -- includes me (OK)
                     || isClasswide rg2 -- classes aren't instances (OK)

-- | @hasSupersetMention st g@ returns whether or not the discourse history
--   contains a group that includes all members of @g@
--
--   Note that if a group has already occured in the discourse history, this
--   returns a True (ie. not a strict superset)
distractorGroups st (c, i) =
    filter distracting (Map.keys (rhCount st))
  where
    distracting = not . safe
    safe (Node rg2 _) = c /= rgClass rg2 -- different classes (OK)
                     || i `Set.member` rgIdxes rg2 -- includes me (OK)
                     || isClasswide rg2 -- classes aren't instances (OK)

-- | @hasSupersetMention st g@ returns whether or not the discourse history
--   contains a group that includes all members of @g@
--
--   Note that if a group has already occured in the discourse history, this
--   returns a True (ie. not a strict superset)