def is_independent_from_all(program, x, ys):
    """
    Returns true iff x is statistially independent from all ys, where x is from the current iteration and the ys
    are from the previous iteration.
    """
    if x not in program.ancestors[x]:
        return True

    for y in ys:
        if y in program.dependencies[x]:
            return False

    return True