引用本文: | 王克朝,王甜甜,苏小红,马培军,童志祥.面向程序理解的系统依赖图构建算法[J].哈尔滨工业大学学报,2013,45(1):78.DOI:10.11918/j.issn.0367-6234.2013.01.015 |
| WANG Kechao,WANG Tiantian,SU Xiaohong,MA Peijun,TONG Zhixiang.Program comprehension oriented construction algorithm of system dependence graph[J].Journal of Harbin Institute of Technology,2013,45(1):78.DOI:10.11918/j.issn.0367-6234.2013.01.015 |
|
本文已被:浏览 2788次 下载 2499次 |
码上扫一扫! |
|
面向程序理解的系统依赖图构建算法 |
王克朝1,2, 王甜甜1, 苏小红1, 马培军1, 童志祥1
|
(1.哈尔滨工业大学 计算机科学与技术学院, 150001 哈尔滨; 2.哈尔滨学院 软件学院, 150086 哈尔滨);1.哈尔滨工业大学 计算机科学与技术学院, 150001 哈尔滨;2.哈尔滨学院 软件学院, 150086 哈尔滨
|
|
摘要: |
为降低程序理解中的程序标准化和程序匹配等复杂度,提出了面向程序理解的系统依赖图构建算法,将其划分为3个阶段:程序信息的提取、控制依赖子图的构建和数据依赖子图的构建.采取控制依赖和数据依赖分别求解,直接基于控制依赖子图分析数据流,无需额外的控制流图表示,并且可按需计算数据流,降低了算法复杂度;将选择语句和循环语句统一表示,并将表达式表示为抽象语法树,使之便于程序转换和分析.在编程题自动评分系统和程序识别中的应用中结果表明构建的系统依赖图为程序理解和分析提供了方便,降低了复杂度. |
关键词: 程序理解 系统依赖图 程序信息提取 控制依赖 数据依赖 |
DOI:10.11918/j.issn.0367-6234.2013.01.015 |
分类号:TP311 |
基金项目:国家自然科学基金资助项目(2,1);高等学校博士学科点专项科研基金资助项目(20112302120052);中央高校基本科研业务费专项资金资助项目(HIT.NSRIF.201178);黑龙江省高教学会“十二五”重点规划课题资助项目(HGJXH B1110957). |
|
Program comprehension oriented construction algorithm of system dependence graph |
WANG Kechao1,2, WANG Tiantian1, SU Xiaohong1, MA Peijun1, TONG Zhixiang1
|
(1.School of Computer Science and Technology, Harbin Institute of Technology, 150001 Harbin, China; 2.School of Software, Harbin University, 150086 Harbin, China);1.School of Computer Science and Technology, Harbin Institute of Technology, 150001 Harbin, China ;2.School of Software, Harbin University, 150086 Harbin, China
|
Abstract: |
To reduce the complexity of program comprehension such as program standardization and program matching, a program comprehension oriented construction algorithm of system dependence graph is proposed. This algorithm can be divided into three stages: program information extraction, control dependence sub-graph construction and data dependence sub-graph construction. Control dependency and data dependency are independently computed. Data flow is directly analyzed based on control dependent sub-graph without extra control flow graph, and computed on demand, which reduces the algorithm complexity. Selection statements and loop statements are uniformly represented, and expressions are represented as abstract syntax trees, which can facilitate program transformation and analysis. The system dependence graph has been used in automatic grading system of student programs and program recognition. Application results show that it can facilitate program comprehension and analysis and reduce the complexity of program comprehension and analysis. |
Key words: program comprehension system dependence graph program information extraction control dependence data dependence |