DAInfer: Inferring API Aliasing Specifications from Library Documentation via Neurosymbolic Optimization
Open Access
- 12 July 2024
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 1 (FSE) , 2469-2492
Abstract
Modern software systems heavily rely on various libraries, necessitating understanding API semantics in static analysis. However, summarizing API semantics remains challenging due to complex implementations or the unavailability of library code. This paper presents DAInfer , a novel approach for inferring API aliasing specifications from library documentation. Specifically, we employ Natural Language Processing (NLP) models to interpret informal semantic information provided by the documentation, which enables us to reduce the specification inference to an optimization problem. Furthermore, we propose a new technique called neurosymbolic optimization to efficiently solve the optimization problem, yielding the desired API aliasing specifications. We have implemented DAInfer as a tool and evaluated it upon Java classes from several popular libraries. The results indicate that DAInfer infers the API aliasing specifications with a precision of 79.78% and a recall of 82.29%, averagely consuming 5.35 seconds per class. These obtained aliasing specifications further facilitate alias analysis, revealing 80.05% more alias facts for API return values in 15 Java projects. Additionally, the tool supports taint analysis, identifying 85 more taint flows in 23 Android apps. These results demonstrate the practical value of DAInfer in library-aware static analysis.Keywords
Funding Information
- Natural Science Foundation of China (62272400)
- Hong Kong Innovation and Technology Commission (ITS\/440\/18FP)
This publication has 36 references indexed in Scilit:
- Automatically Generating Precise Oracles from Structured Natural Language Specifications2019
- Learning Commutativity Specifications2015
- A Survey of the Forms of Java Reference Names2015
- νZ - An Optimizing SMT Solver2015
- On the naturalness of software2012
- Inferring method specifications from natural language API descriptions2012
- A relational approach to interprocedural shape analysisACM Transactions on Programming Languages and Systems, 2010
- Inferring Resource Specifications from Natural Language API Documentation2009
- Z3: An Efficient SMT Solver2008
- Static specification mining using automata-based abstractions2007