Returns a DFA that accepts any word but he ones accepted
    by the input DFA.

    Let A be a completed DFA, :math:`Ā = (Σ, S, s_0 , ρ, S − F )`
    is the DFA that runs A but accepts whatever word A does not.

    :param dict dfa: input DFA.
    :return: *(dict)* representing the complement of the input DFA.

def dfa_complementation(dfa: dict) -> dict:
    """ Returns a DFA that accepts any word but he ones accepted
    by the input DFA.

    Let A be a completed DFA, :math:`Ā = (Σ, S, s_0 , ρ, S − F )`
    is the DFA that runs A but accepts whatever word A does not.

    :param dict dfa: input DFA.
    :return: *(dict)* representing the complement of the input DFA.
    """
    dfa_complement = dfa_completion(deepcopy(dfa))
    dfa_complement['accepting_states'] = \
        dfa_complement['states'].difference(dfa_complement['accepting_states'])
    return dfa_complement