Infeasible Code Detection
- 638 Downloads
A piece of code in a computer program is infeasible if it cannot be part of any normally-terminating execution of the program. We develop an algorithm for the automatic detection of all infeasible code in a program. We first translate the task of determining all infeasible code into the problem of finding all statements that can be covered by a feasible path. We prove that in order to identify all coverable statements, it is sufficient to find all coverable statements within a certain minimal subset. For this, our algorithm repeatedly queries an oracle, asking for the infeasibility of specific sets of control-flow paths.
We present a sound implementation of the proposed algorithm on top of the Boogie program verifier utilizing a theorem prover to provide the oracle required by the algorithm. We show experimentally a drastic decrease in the number of theorem prover queries compared to existing approaches, resulting in an overall speedup of the entire computation.
KeywordsTheorem Prover Feasible Path Feasible Statement Path Cover Back Edge
Unable to display preview. Download preview PDF.
- 1.Barnett, M., Leino, K.R.M.: Weakest-precondition of unstructured programs. In: Proceedings of the 6th ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, PASTE 2005, pp. 82–87. ACM, New York (2005)Google Scholar
- 2.Bertolini, C., Schäf, M., Schweitzer, P.: Infeasible code detection. Technical Report 455, United Nations University, IIST (November 2011)Google Scholar
- 10.Grigore, R., Charles, J., Fairmichael, F., Kiniry, J.: Strongest postcondition of unstructured programs. In: Proceedings of the 11th International Workshop on Formal Techniques for Java-like Programs, FTfJP 2009, pp. 6:1–6:7. ACM, New York (2009)Google Scholar
- 14.Janota, M., Grigore, R., Moskal, M.: Reachability analysis for annotated code. In: Proceedings of the 2007 Conference on Specification and Verification of Component-Based Systems: 6th Joint Meeting of the European Conference on Software Engineering and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, SAVCBS 2007, pp. 23–30. ACM, New York (2007)Google Scholar