arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1802.07779cs.SE
收藏

基于路径的函数嵌入及其在规范挖掘中的应用

Path-Based Function Embedding and its Application to Specification Mining

Daniel DeFreez, Aditya V. Thakur, Cindy Rubio-González

摘要:

识别程序元素之间的关系对于程序理解、调试和分析是有用的。其中一种关系是同义关系。函数同义词是在代码中扮演类似角色的函数,例如为不同设备驱动程序执行初始化的函数,或实现不同密钥加密方案的函数。函数同义词在语义上不一定等同,在语法上也可能不同;因此,不能使用识别代码克隆或功能等同的方法来识别它们。本文介绍了func 2 vec,一个算法,每个函数映射到一个向量空间中的向量,使功能同义词分组在一起。我们计算的函数嵌入训练神经网络的随机行走产生的句子编码的程序作为一个标记的下推系统(L-PDS)。我们证明,func 2 vec是有效的识别功能同义词在Linux内核中。此外,我们将展示函数同义词如何在Linux文件系统和驱动程序中实现高度支持的挖掘错误处理规范。

英文摘要:

Identifying the relationships among program elements is useful for program understanding, debugging, and analysis. One such relationship is synonymy. Function synonyms are functions that play a similar role in code, e.g. functions that perform initialization for different device drivers, or functions that implement different symmetric-key encryption schemes. Function synonyms are not necessarily semantically equivalent and can be syntactically dissimilar; consequently, approaches for identifying code clones or functional equivalence cannot be used to identify them. This paper presents func2vec, an algorithm that maps each function to a vector in a vector space such that function synonyms are grouped together. We compute the function embedding by training a neural network on sentences generated from random walks over an encoding of the program as a labeled pushdown system (l-PDS). We demonstrate that func2vec is effective at identifying function synonyms in the Linux kernel. Furthermore, we show how function synonyms enable mining error-handling specifications with high support in Linux file systems and drivers.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑