Diagnostic Problem Solving via Planning with Ontic and Epistemic Goals