def is_final_id(id_path, pda, acceptance):
    """Helper for final_id
       ---
       If the id of id_path meets the acceptance criterion 
       that is passed in, then it is "final"; else not.
    """ 
    (id, path) = id_path
    (q, inp_str, stk_str) = id
    if (acceptance == "ACCEPT_F"):
        return (inp_str=="" and q in pda["F"])
    else:
        assert(acceptance == "ACCEPT_S")
        return (inp_str=="" and stk_str=="")