def find_parent_fnames(var):
    """
    Find full names of parents, recursively.

    These names will be forbidden in the subsequent resolution to make sure
    there's no back branch in the constructed DAG.
    """
    names = [var.fname]  # No self-referential
    if var.parent:
        names.append(var.parent.fname)
        names += find_parent_fnames(var.parent)
    return names