def all_equiv_sat(mas, agents, states):
    """
    Return the subset of states such that all states indistinguishable
    from s by agents are in states.
    
    mas -- a multi-agents system;
    agents -- a subset of agents of mas (as a list);
    states -- a subset of states of mas.
    
    """
    equiv_sat = states
    missing = ~states & mas.bddEnc.statesInputsMask
    for agent in agents:
        equiv_sat &= ~mas.equivalent_states(missing & mas.reachable_states,
            {agent}) & states
    return equiv_sat
