Hierarchical arc consistency: exploiting structured domains in constraint satisfaction problems