National Natural Science Foundation of China (No.61402222, No.61632015);National Key Research and Development Program of China (No.2016YFB1000802);Research Fund for the Doctoral Program of Higher Education of Ministry of Education of China (No.20110091120058);Industry-University-research Project of Jiangsu Province (No.BY2014126-03)
Loop is an important program structure in computer.Many applications need to estimate the maximum iteration number of loops in programs by loop bound analysis.Existing loop bound analysis uses conservative methods to derive outer loop bounds
which estimates the bounds higher than the real ones.In this paper
we propose an automatic inner bound analysis
which generates bounds slightly lower than the real ones.When users combine the inner bound analysis with traditional outer bound analysis
they can restrict every real loop bound in an interval and get more information about the loops.We implement the inner bound analysis by a scope-condition guided symbolic execution.The insight of our technique is that when symbolic execution substitutes program inputs by symbols in its derivation
it generates loop bounds for all valid inputs and generates corresponding test cases that make the inner bounds feasible.We optimize the technique and evaluate it on several benchmarks.The results show that the analysis is precise and efficient.