传统的程序切片方法一般基于程序依赖图(PDG)和系统依赖图(SDG)的可达性算法,但是在建立PDG和SDG的过程中会计算一些与切片无关的数据依赖,造成时空资源的浪费及切片效率的降低。提出了一种基于程序逆向流的切片算法,它事先建立逆向程序流,再从切片点开始沿逆向程序流扫描程序以获得程序切片,只计算与切片相关的数据依赖,从而提高了切片计算的时空效率。通过实验发现该算法具有一定的可行性和实用性。本算法适用于包括Fortran、C等编程语言在内的命令式程序的切片生成。
The traditional method of program slicing was based on reachability algorithm of program dependence graph(PDG) and system dependence graph(SDG).However,to construct PDG and SDG,some data dependenced which were irrelevant to the slicing may be computed.The redundant computing wasted time and memory,and reduced slicing efficiency.To address this problem,this paper presented a slicing algorithm based on reverse program flow.It firstly constructed reverse flow of the program,then scaned the program along revers...