A satisfiability modulo theories approach to constraint programming