Diagnostic reasoning based on structure and behavior