On the diagnosability of a class of hierarchical state machines