Prints warning messages for every node that has both a value and a
    longest_prefix.

def warn_prefix_values(trie):
    '''
    Prints warning messages for every node that has both a value and a
    longest_prefix.
    '''
    for current, _parent in trie.dfs():
        if current.has_value and current.longest_prefix is not None:
            LOGGER.warn(('pattern {} (value {}) is a superstring of pattern '
                         '{} (value {}) and will never be matched').format(
                             current.prefix, current.value,
                             current.longest_prefix.prefix, current.longest_prefix.value))