Towards a logical framework for diagnostic reasoning