move resolveListOfK before FlattenTerms in symbolic backend