def check_consistency_names_grounding_dict(grounding_dict, names_map):
    """Check that a grounding dict and names map have consistent names
    """
    groundings = {grounding for grounding_map in grounding_dict.values()
                  for grounding in grounding_map.values()
                  if grounding != 'ungrounded'}
    return groundings == set(names_map.keys())