it checks if all_consts is consistent; ie all constants belong to only one name