move flattenTermsTwo before AddK2SMtLib