How could Neural Networks understand Programs?

计算机科学 语义学(计算机科学) 操作语义 人工智能 启发式 有根据的语义学 程序设计语言 理论计算机科学 指称语义学 自然语言处理
作者
Dinglan Peng,Shuxin Zheng,Yatao Li,Guolin Ke,Di He,Tie-Yan Liu
出处
期刊:Cornell University - arXiv 被引量:2
标识
DOI:10.48550/arxiv.2105.04297
摘要

Semantic understanding of programs is a fundamental problem for programming language processing (PLP). Recent works that learn representations of code based on pre-training techniques in NLP have pushed the frontiers in this direction. However, the semantics of PL and NL have essential differences. These being ignored, we believe it is difficult to build a model to better understand programs, by either directly applying off-the-shelf NLP pre-training techniques to the source code, or adding features to the model by the heuristic. In fact, the semantics of a program can be rigorously defined by formal semantics in PL theory. For example, the operational semantics, describes the meaning of a valid program as updating the environment (i.e., the memory address-value function) through fundamental operations, such as memory I/O and conditional branching. Inspired by this, we propose a novel program semantics learning paradigm, that the model should learn from information composed of (1) the representations which align well with the fundamental operations in operational semantics, and (2) the information of environment transition, which is indispensable for program understanding. To validate our proposal, we present a hierarchical Transformer-based pre-training model called OSCAR to better facilitate the understanding of programs. OSCAR learns from intermediate representation (IR) and an encoded representation derived from static analysis, which are used for representing the fundamental operations and approximating the environment transitions respectively. OSCAR empirically shows the outstanding capability of program semantics understanding on many practical software engineering tasks.

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
刚刚
Aai完成签到,获得积分10
1秒前
2秒前
Owen应助Luotenglong采纳,获得10
4秒前
和谐的tang发布了新的文献求助10
4秒前
Aai发布了新的文献求助10
6秒前
细腻的莫茗完成签到,获得积分10
6秒前
lizishu应助自信的爆米花采纳,获得10
7秒前
zyq发布了新的文献求助10
7秒前
小轩发布了新的文献求助10
7秒前
8秒前
十六完成签到,获得积分10
9秒前
MP应助shaonianzu采纳,获得30
9秒前
11秒前
12秒前
ll关闭了ll文献求助
12秒前
WEN完成签到,获得积分10
12秒前
专注的明轩完成签到 ,获得积分10
12秒前
13秒前
李爱国应助廖翰彬采纳,获得10
14秒前
15秒前
XX完成签到,获得积分10
16秒前
16秒前
tianshanfeihe完成签到 ,获得积分10
17秒前
嘉嘉sone发布了新的文献求助10
17秒前
张正友完成签到 ,获得积分10
17秒前
17秒前
18秒前
马仔猴完成签到 ,获得积分10
18秒前
彭于晏应助桃之夭夭采纳,获得10
19秒前
儒雅晓霜发布了新的文献求助10
19秒前
流风发布了新的文献求助10
19秒前
橙子abcy完成签到,获得积分10
20秒前
小轩完成签到,获得积分20
20秒前
烟里戏发布了新的文献求助20
20秒前
小小鱼发布了新的文献求助10
21秒前
23秒前
23秒前
YANG完成签到,获得积分10
23秒前
小陈应助和谐的tang采纳,获得10
24秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
The Organometallic Chemistry of the Transition Metals 800
Chemistry and Physics of Carbon Volume 18 800
The Organometallic Chemistry of the Transition Metals 800
Leading Academic-Practice Partnerships in Nursing and Healthcare: A Paradigm for Change 800
The formation of Australian attitudes towards China, 1918-1941 640
Signals, Systems, and Signal Processing 610
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 物理 内科学 复合材料 催化作用 物理化学 光电子学 电极 细胞生物学 基因 无机化学
热门帖子
关注 科研通微信公众号,转发送积分 6435023
求助须知:如何正确求助?哪些是违规求助? 8249958
关于积分的说明 17547091
捐赠科研通 5493423
什么是DOI,文献DOI怎么找? 2897564
邀请新用户注册赠送积分活动 1874112
关于科研通互助平台的介绍 1715239