def make_arc_consistent(Xj, Xk, csp):
    """Make arc between parent (Xj) and child (Xk) consistent under the csp's constraints,
    by removing the possible values of Xj that cause inconsistencies."""
    for val1 in csp.domains[Xj]:
        keep = False
        for val2 in csp.domains[Xk]:
            if csp.constraints(Xj, val1, Xk, val2):
                keep = True
                break
        if not keep:
            csp.prune(Xj, val1, None)
    return csp.curr_domains[Xj]
