Program Analysis Using Function Summaries to Avoid Code Inlining
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing program analysis methods face challenges such as exponential code size due to inlining function calls, difficulty in building a complete monolithic software representation, lack of source code for library functions, noise from false positives, and providing inter-procedural counter-examples, which hinder effective analysis.
Innovation Solution
A computer-implemented method that uses summaries to analyze programs by determining input and output variable assignments to reach a predefined state, refining summaries using SMT or SAT solvers, and storing narrowed summaries to avoid inlining functions, enabling parallel processing and reducing false positives.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If function calls are inlined to analyze program code, then analysis completeness is improved, but code size becomes exponential in the number of nested function calls
Solution Approach 1:
The patent divides the program analysis into separate function analysis units, where each function is analyzed independently using summaries rather than inlining the entire function body. This segmentation allows analysis of large programs without exponential code expansion, as summaries provide compact representations of function behavior.
Solution Approach 2:
The patent introduces summaries as intermediary representations between function calls and function bodies. These summaries act as mediators that capture essential function behavior without requiring full inlining, thus maintaining analysis completeness while avoiding exponential code size growth.
2Reliability
If pessimistic summaries are used to find error conditions, then error detection capability is improved, but false positives increase
Solution Approach 1:
The patent implements feedback loops where analysis results from pessimistic summaries are used to refine and narrow the summaries iteratively. This feedback mechanism reduces false positives by continuously improving summary accuracy based on actual program behavior observations while maintaining initial error detection capability.
Data Source
AI summary
This disclosure relates to the analysis of a program based on source code where the source code comprises a call to a function associated with a function implementation. A processor determines, based on a summary that over-approximates the function, an assignment of an input variable and an output variable of the function call to reach a predefined state. The processor then determines, based on the implementation of the function whether the assignment of the input variable results in the assignment of the output variable. If it does not, the processor determines a narrowed summary for the function such that the narrowed summary over-approximates the function and excludes the assignment of the input variable and the output variable. Finally, the processor stores the narrowed summary on a datastore. Inlining of function code and unfolding of loops is avoided and parallel processing of multiple functions is possible.


