def check_all_constraints(csp) :
    """Return False if the problem's assigned values violate some constraint,
    otherwise True"""
    for a_name, a_value in csp.assigned_values.iteritems():
        for b_name, b_value in csp.assigned_values.iteritems():
            for constraint in csp.constraints_between(a_name, b_name):
                if not constraint.check(a_value, b_value):
                    return False

    return True