kpointer :: RefHistory -> DiscourseUnit -> Bool
hasTidyBackpointer st du@(Node rg _) =
    not (any (hasDistractorGroup st) keys) -- (tidy) nothing to confuse w du
    && lastMentions st du == 0  -- (tidy) first time we mentioned du
    && hasSupersetMention st du -- (backpointer) but we already mentioned
                                -- a group that includes all members of du
  where
    -- keys are just class/idx tuples ('a', '3') for example
    keys = Set.toList (refKeys rg)

-- | @isTheOther st k@ returns whether or not there is a two-member group in
--   the discourse history which @k@ is a member of such that the other
--   member has already been mentioned as a part of a singleton group.
--
--   The idea is that if you have said "one of the X", you will want to say
--   "the other X" for the other member of that group
isTheOthe
hasTidyBackpointer :: RefHistory -> DiscourseUnit -> Bool
hasTidyBackpointer st du@(Node rg _) =
    not (any (hasDistractorGroup st) keys) -- (tidy) nothing to confuse w du
    && lastMentions st du == 0  -- (tidy) first time we mentioned du
    && hasSupersetMention st du -- (backpointer) but we already mentioned
                                -- a group that includes all members of du
  where
    -- keys are just class/idx tuples ('a', '3') for example
    keys = Set.toList (refKeys rg)

-- | @isTheOther st k@ returns whether or not there is a two-member group in
--   the discourse history which @k@ is a member of such that the other
--   member has already been mentioned as a part of a singleton group.
--
--   The idea is that if you have said "one of the X", you will want to say
--   "the other X" for the other member of that group
hasTidyBackpointer st du@(Node rg _) =
    not (any (hasDistractorGroup st) keys) -- (tidy) nothing to confuse w du
    && lastMentions st du == 0  -- (tidy) first time we mentioned du
    && hasSupersetMention st du -- (backpointer) but we already mentioned
                                -- a group that includes all members of du
  where
    -- keys are just class/idx tuples ('a', '3') for example
    keys = Set.toList (refKeys rg)

-- | @isTheOther st k@ returns whether or not there is a two-member group in
--   the discourse history which @k@ is a member of such that the other
--   member has already been mentioned as a part of a singleton group.
--
--   The idea is that if you have said "one of the X", you will want to say
--   "the other X" for the other member of that group