Principles of Distributed Diagnosis of Discrete-event Systems