change is_reduced_gram to use definition