Constraint logic programming for qualitative and quantitative constraint satisfaction problems