How to write good SMT code