constraint solving