Abstract:When analyzing real-world programs, it is often necessary to analyze the function calls in the program, and interprocedural analysis is generally used to achieve full program analysis. Function inlining is one of the most accurate and easily achievable methods for interprocedural analysis. Function inlining allows existing intraprocedural analysis methods and tools to support the analysis of programs that contain function calls. However, the size of the code increases dramatically after function inlining, and a large number of intermediate variables will be generated, which increases the variable dimension of program analysis and causes the process of program analysis to consume a lot of memory and time. This study considers some shortcomings of interprocedural analysis of function inlining based on the abstract interpretation framework and proposes a corresponding optimization method. Program analysis based on abstract interpretation is concerned with automatically deriving invariant constraint relations among program variables, so the size of the program environment constituted by program variables (i.e., the set of relevant variables to be considered at each program point) has an important impact on the time and space overhead of the analysis. In order to reduce the overhead of program analysis after function inlining, this study proposes a program environment reduction optimization method for inline function blocks. The method analyzes the program code after inlining functions to determine the program environment (i.e., set of related variables) to be maintained at different program points, instead of sharing the same global program environment at all program points, so as to realize the dimensionality reduction of the program state. The architecture, modules, and algorithm details of the tool DRIP (dimension reduction for analyzing function inlined program) implemented based on this method are described in detail. The results show that DRIP achieves sound results in variable elimination, even reducing more than half of the variables in some test suites, and the time and space spent is also reduced to a certain extent.