Linguistic Knowledge and Reasoning for Error Diagnosis and Feedback Generation