Symbolic optimization with SMT solvers