Context-Sensitive Diagnosis of Discrete-Event Systems