def __check_epsilon_productions(cnf_variables, cnf_productions, cfg_productions):
    """
    Check whether all reachable epsilon productions from
    Context Free Grammar are present in Chomsky Normal Form productions.
    """

    cfg_epsilon_productions = set(
        filter(
            lambda prod: prod.head in cnf_variables and not prod.body,
            cfg_productions,
        )
    )

    cnf_epsilon_productions = set(filter(lambda prod: not prod.body, cnf_productions))

    for epsilon_production in cfg_epsilon_productions:
        if epsilon_production not in cnf_epsilon_productions:
            return False

    return True