Solving constraint satisfaction problems with SAT modulo theories