Localizing Bugs in Program Executions with Graphical Models