A two-phase monadic approach is presented for monadically slicing programs with procedures. In the monadic slice algorithm for interprocedural programs, phase 1 initializes the slice table of formal parameters in a pr...A two-phase monadic approach is presented for monadically slicing programs with procedures. In the monadic slice algorithm for interprocedural programs, phase 1 initializes the slice table of formal parameters in a procedure with the given labels, and then captures the callees' influence on callers when analyzing call statements. Phase 2 captures the callees' dependence on callers by replacing all given labels appearing in the corresponding sets of formal parameters. By the introduction of given labels, this slice method can obtain similar summary information in system-dependence-graph(SDG)-based algorithms for addressing the calling-context problem. With the use of the slice monad transformer, this monadic slicing approach achieves a high level of modularity and flexibility. It shows that the monadic interprocedural algorithm has less complexity and it is not less precise than SDG algorithms.展开更多
基金The National Outstanding Young Scientist Foundation by NSFC(No.60703086,60503020)
文摘A two-phase monadic approach is presented for monadically slicing programs with procedures. In the monadic slice algorithm for interprocedural programs, phase 1 initializes the slice table of formal parameters in a procedure with the given labels, and then captures the callees' influence on callers when analyzing call statements. Phase 2 captures the callees' dependence on callers by replacing all given labels appearing in the corresponding sets of formal parameters. By the introduction of given labels, this slice method can obtain similar summary information in system-dependence-graph(SDG)-based algorithms for addressing the calling-context problem. With the use of the slice monad transformer, this monadic slicing approach achieves a high level of modularity and flexibility. It shows that the monadic interprocedural algorithm has less complexity and it is not less precise than SDG algorithms.