Abstract
When a model does not satisfy a given specification, a counterexample is produced by the model checker to demonstrate the failure. A user must then examine the counterexample trace, in order to visually identify the failure that it demonstrates. If the trace is long, or the specification is complex, finding the failure in the trace becomes a non-trivial task. In this paper, we address the problem of analyzing a counterexample trace and highlighting the failure that it demonstrates. Using the notion of causality introduced by Halpern and Pearl, we formally define a set of causes for the failure of the specification on the given counterexample trace. These causes are marked as red dots and presented to the user as a visual explanation of the failure. We study the complexity of computing the exact set of causes, and provide a polynomial-time algorithm that approximates it. We then analyze the output of the algorithm and compare it to the one expected by the definition. The algorithm is implemented as a feature in the IBM formal verification platform RuleBase PE, where the visual explanations are an integral part of every counterexample trace. Our approach is independent of the tool that produced the counterexample, and can be applied as a light-weight external layer to any model checking tool, or used to explain simulation traces.
Similar content being viewed by others
Notes
Red dots are used in IBM’S RuleBase PE for displaying counterexample explanations.
References
Prosyd: Property-based system design (2005). http://www.prosyd.org/
Ball T, Naik M, Rajamani S (2003) From symptom to cause: Localizing errors in counterexample traces. In: Principles of programming languages, pp 97–105
Ben-David S, Eisner C, Geist D, Wolfsthal Y (2003) Model checking at IBM. Form Methods Syst Des 22(2):101–108
Chechik M, Gurfinkel A (2005) A framework for counterexample generation and exploration. In: Proceedings of FASE’05, pp 217–233
Chockler H, Grumberg O, Yadgar A (2008) Efficient automatic STE refinement using responsibility. In: TACAS, pp 233–248
Chockler H, Halpern JY, Kupferman O (2008) What causes a system to satisfy a specification? ACM Trans Comput Log 9(3)
Clarke E, Emerson E (1981) Design and synthesis of synchronization skeletons using branching time temporal logic. In: Proc workshop on logic of programs, Lecture notes in computer science, vol 131. Springer, Berlin, pp 52–71
Clarke E, Grumberg O, McMillan K, Zhao X (1995) Efficient generation of counterexamples and witnesses in symbolic model checking. In: Proc 32nd design automation conference. IEEE Comput Soc, Los Alamitos, pp 427–432
Copty F, Irron A, Weissberg O, Kropp N, Kamhi G (2001) Efficient debugging in a formal verification environment. In: Proceedings of CHARME’01, pp 275–292
Dershowitz N, Hanna Z, Nadel A (2006) A scalable algorithm for minimal unsatisfiable core extraction. In: Proceedings of 9th international conference on theory and applications of satisfiability testing (SAT), pp 36–41
Dong Y, Ramakrishnan CR, Smolka SA (2003) Model checking and evidence exploration. In: IEEE conference and workshops on engineering computer based systems, IEEE, Huntsville, pp 214–223
Eisner C, Fisman D (2006) A practical introduction to PSL. Series on integrated circuits and systems. Springer, Berlin
Eisner C, Fisman D, Havlicek J, Lustig Y, McIsaac A, Campenhout DV (2003) Reasoning with temporal logic on truncated paths. In: Proc 15th intl conference on computer aided verification (CAV’03). Lect notes in comp sci, vol 2725. Springer, Boulder, pp 27–39
Eiter T, Lukasiewicz T (2001) Complexity results for structure-based causality. In: Proc 7th international joint conference on artificial intelligence, pp 35–40
Eiter T, Lukasiewicz T (2002) Causes and explanations in the structural-model approach: Tractable cases. In: Uncertainty in artificial intelligence: proceedings of the 18th conference (UAI-2002). Morgan Kaufmann, Edmonton
Griesmayer A, Staber S, Bloem R (2007) Automated fault localization for C programs. Electron Notes Theor Comput Sci 174(4):95–111
Groce A (2004) Error explanation with distance metrics. In: TACAS
Groce A, Chaki S, Kroening D, Strichman O (2006) Error explanation with distance metrics. STTT 8(3):229–247
Groce A, Kroening D (2004) Making the most of BMC counterexamples. In: SGSH
Hall N (2002) Two concepts of causation. In: Collins J, Hall N, Paul LA (eds) Causation and counterfactuals. MIT Press, Cambridge
Halpern J, Pearl J (2001) Causes and explanations: a structural-model approach—part 1: Causes. In: Uncertainty in artificial intelligence: proceedings of the seventeenth conference (UAI-2001). Morgan Kaufmann, San Francisco, pp 194–202
Halpern J, Pearl J (2005) Causes and explanations: a structural-model approach—part 1: Causes. Br J Philos Sci 56:843–887
Hume D (1939) A treatise of human nature. John Noon, London
Jin H, Ravi K, Somenzi F (2002) Fate and free will in error traces. In: TACAS02, pp 445–458
Kupferman O, Vardi M, Wolper P (2000) An automata-theoretic approach to branching-time model checking. J ACM 47(2):312–360
Manna Z, Pnueli A (1995) The temporal logic of reactive and concurrent systems: safety. Springer, New York
Pnueli A (1977) The temporal logic of programs. In: 18th IEEE symposium on foundation of computer science, pp 46–57
Quielle J, Sifakis J (1982) Specification and verification of concurrent systems in CESAR. In: 5th international symposium on programming
RuleBase PE Homepage. http://www.haifa.il.ibm.com/projects/verification/RB_Homepage
Shen S, Qin Y, Li S (2005) A faster counterexample minimization algorithm based on refutation analysis. In: DATE05, pp 672–677
Staber S, Bloem R (2007) Fault localization and correction with QBF. In: SAT, pp 355–368
Sülflow A, Fey G, Bloem R, Drechsler R (2008) Using unsatisfiable cores to debug multiple design errors. In: ACM great lakes symposium on VLSI, pp 77–82
Wang C, Yang Z, Ivancic F, Gupta A (2006) Whodunit? Causal analysis for counterexamples. In: ATVA, pp 82–95
Wolper P (1985) The tableau method for temporal logic: an overview. Log Anal 110–111:119–136
Acknowledgements
We thank Cindy Eisner for helpful discussions on the truncated semantics. Shoham Ben-David is grateful to the Azrieli Foundation for the award of an Azrieli Fellowship.
Author information
Authors and Affiliations
Corresponding author
Additional information
A preliminary version of the paper appeared in the proceedings of CAV 2009.
The research of S. Ben-David was supported in part by the Ontario Ministry of Research and Innovation and by the Azrieli Foundation.
The research of R. Trefler was supported in part by the Natural Sciences and Engineering Research Council of Canada.
Rights and permissions
About this article
Cite this article
Beer, I., Ben-David, S., Chockler, H. et al. Explaining counterexamples using causality. Form Methods Syst Des 40, 20–40 (2012). https://doi.org/10.1007/s10703-011-0132-2
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10703-011-0132-2