def nd(fsm, group, phi):
    """
    Return the set of states of fsm satisfying nD<group> phi
    
    fsm -- a MAS representing the system
    group -- a non-empty list of (str) names of agents of fsm
    phi -- a BDD representing the set of states of fsm satisfying phi
    """
    return fsm.equivalent_states(phi & fsm.reachable_states, frozenset(group)
        ) & fsm.reachable_states
