Exploiting the deep structure of constraint problems