getRestrictionTerms function

Get index of restricted terms for Wald test