specialized Term.var_occurs, to use the groundness flag information