## A formal method for program slicing (2005)

Venue: | In 2005 Australian Software Engineering Conference (ASWEC’05 |

Citations: | 1 - 0 self |

### BibTeX

@INPROCEEDINGS{Zhang05aformal,

author = {Yingzhou Zhang and Baowen Xu and Jose Emilio and Labra Gayo},

title = {A formal method for program slicing},

booktitle = {In 2005 Australian Software Engineering Conference (ASWEC’05},

year = {2005},

pages = {140--148},

publisher = {IEEE Computer Society}

}

### OpenURL

### Abstract

Program slicing is a well-known program analysis technique that extracts the elements of a program related to a particular computation. Based on modular monadic semantics of a programming language, this paper presents a new formal method for slicing, called modular monadic slicing, by abstracting the computation of slicing as a slice monad transformer. With the use of slice transformer, the feature of program slicing can be combined in a modular way into semantic descriptions of the program analyzed. According to these, this paper gives both monadic dynamic and static slicing algorithms. They compute program slices directly on abstract syntax, without the needs to explicitly construct intermediate structures such as dependence graphs, or to record an execution history in dynamic slicing algorithm. 1.

### Citations

1280 |
Program Slicing
- WEISER
- 1981
(Show Context)
Citation Context ...e all code that contributes to the value of variables that might be part of a safety critical component. The original program slicing method was expressed as a sequence of data flow analysis problems =-=[5]-=-. An alternative approach relied on program dependence graphs (PDG) [6]. Most of the existing slicing methods were evolved from these two approaches. As the behavior of a program is determined by the ... |

731 | Notions of computation and monads
- Moggi
- 1991
(Show Context)
Citation Context ...[7-9]. Denotational semantics, however, lack modularity and reusability [10-14]. A practicable solution was to use monads [15] to structure denotational semantics, with the help of monad transformers =-=[10, 16, 17]-=- which can transform a given monad into a new one with new operations. S.Liang et al. used monads and monad transformers to specify the semantics of programming language and called it modular monadic ... |

634 | A survey of program slicing techniques
- Tip
- 1995
(Show Context)
Citation Context ... last instruction Var Labels n φ a φ i {3} s {4} Var Labels n φ a φ i {3} s {3, 4, 7, 8, 10} Var Labels n φ a φ i {3, 7, 11} Figure 10. Slices during execute instructions with INPUT READ 1 ds = [("n",=-=[1]-=-)] READ 2 ds = [("n",[1]),("a",[2])] ASSIGN 3 ds' = [("n",[1]),("a",[2]),("i",[3])] ASSIGN 4 ds' = [("n",[1]),("a",[2]),("i",[3]),("s",[4])] IF 5 ds = [("n",[1]),("a",[2]),("i",[3]),("s",[4])] WHILE 7... |

457 | Comprehending monads
- Wadler
- 1992
(Show Context)
Citation Context ...[7-9]. Denotational semantics, however, lack modularity and reusability [10-14]. A practicable solution was to use monads [15] to structure denotational semantics, with the help of monad transformers =-=[10, 16, 17]-=- which can transform a given monad into a new one with new operations. S.Liang et al. used monads and monad transformers to specify the semantics of programming language and called it modular monadic ... |

289 |
The Program Dependence Graph in a Software Development Environment
- Ottenstein, Ottenstein
(Show Context)
Citation Context ...t of a safety critical component. The original program slicing method was expressed as a sequence of data flow analysis problems [5]. An alternative approach relied on program dependence graphs (PDG) =-=[6]-=-. Most of the existing slicing methods were evolved from these two approaches. As the behavior of a program is determined by the semantics of the language, it is reasonable to expect an approach for p... |

165 |
An abstract view of programming languages
- Moggi
- 1990
(Show Context)
Citation Context ...ainly based on the standard denotational semantics, i.e. denotational slicing [7-9]. Denotational semantics, however, lack modularity and reusability [10-14]. A practicable solution was to use monads =-=[15]-=- to structure denotational semantics, with the help of monad transformers [10, 16, 17] which can transform a given monad into a new one with new operations. S.Liang et al. used monads and monad transf... |

116 | An overview of program slicing
- Harman, Hierons
- 2001
(Show Context)
Citation Context ...ices during execute instructions with INPUT READ 1 ds = [("n",[1])] READ 2 ds = [("n",[1]),("a",[2])] ASSIGN 3 ds' = [("n",[1]),("a",[2]),("i",[3])] ASSIGN 4 ds' = [("n",[1]),("a",[2]),("i",[3]),("s",=-=[4]-=-)] IF 5 ds = [("n",[1]),("a",[2]),("i",[3]),("s",[4])] WHILE 7 ds = [("n",[1]),("a",[2]),("i",[3]),("s",[4])] IF 8 ds = [("n",[1]),("a",[2]),("i",[3]),("s",[4])] ASSIGN 10 ds' = [("n",[1]),("a",[2]),(... |

97 |
The semantic approach to program slicing
- Venkatesh
- 1991
(Show Context)
Citation Context ...s Loc; rdEnv and inEnv, putValue and getValue are the basic operators of EnvT and IOT showed in Figure 1, respectively. To conveniently discuss program slices later, following G.A.Venkatesh’s idea in =-=[9]-=-, we define Syn(s, L) for language W in Figure 4, where s is a Wprogram analyzed, v the variable of interest in a slicing criterion, ε null result, and Refs(l.e) the set of variables occurring in expr... |

56 | Modular Denotational Semantics for Compiler Construction
- Liang, Hudak
- 1996
(Show Context)
Citation Context ...1]),("a",[2]),("i",[3]),("s",[4])] IF 8 ds = [("n",[1]),("a",[2]),("i",[3]),("s",[4])] ASSIGN 10 ds' = [("n",[1]),("a",[2]),("i",[3]),("s",[1,2,3,4,7,8,10])] ASSIGN 11 ds' = [("n",[1]),("a",[2]),("i",=-=[1,3,7,11]-=-),("s",[1,2,3,4,7,8,10])] WHILE 7 ds = [("n",[1]),("a",[2]),("i",[1,3,7,11]),("s",[1,2,3,4,7,8,10])] IF 8 ds = [("n",[1]),("a",[2]),("i",[1,3,7,11]),("s",[1,2,3,4,7,8,10])] ASSIGN 10 ds' = [("n",[1]),... |

37 | Semantic Lego
- Espinosa
- 1995
(Show Context)
Citation Context ...[7-9]. Denotational semantics, however, lack modularity and reusability [10-14]. A practicable solution was to use monads [15] to structure denotational semantics, with the help of monad transformers =-=[10, 16, 17]-=- which can transform a given monad into a new one with new operations. S.Liang et al. used monads and monad transformers to specify the semantics of programming language and called it modular monadic ... |

28 | Modular Monadic Semantics and Compilation
- Liang
- 1998
(Show Context)
Citation Context ...rm, the slice monad transformer is similar to the state monad transformer. So, the correctness proof of its definition can be obtained easily by following the proofs for transformer StateT in [12] or =-=[20]-=-. Slice monad transformer: type SliceT L m a = L → m (a, L) returnSliceT L m x = λL. returnm (x, L) m ‘bindSliceT L m’ f = λL. {(a, L′) ← m L; f a L′} m liftSliceT L m = λL. {a←m; return m (a, L)} m u... |

24 |
An Overview and Comparative Classification of Program Slicing
- Kamkar
- 1972
(Show Context)
Citation Context ..., 7, 8, 10} Var Labels n φ a φ i {3, 7, 11} Figure 10. Slices during execute instructions with INPUT READ 1 ds = [("n",[1])] READ 2 ds = [("n",[1]),("a",[2])] ASSIGN 3 ds' = [("n",[1]),("a",[2]),("i",=-=[3]-=-)] ASSIGN 4 ds' = [("n",[1]),("a",[2]),("i",[3]),("s",[4])] IF 5 ds = [("n",[1]),("a",[2]),("i",[3]),("s",[4])] WHILE 7 ds = [("n",[1]),("a",[2]),("i",[3]),("s",[4])] IF 8 ds = [("n",[1]),("a",[2]),("... |

22 | A Modular Monadic Action Semantics
- Wansbrough
- 1997
(Show Context)
Citation Context ... key of modular monadic semantics is the division of the monad m into a series of monad transformers, each representing a computation. What’s more, monad transformers can be designed once and for all =-=[12]-=-, because they are entirely independent of the language being described. Inspired by this, we try to abstract the computation of program slicing as a monad transformer. This will be discussed in next ... |

6 | R n - and G n -logics - Hintermeier, Kirchner, et al. - 1996 |

5 |
Monad Transformers and Modular
- Liang, Hudak, et al.
- 1995
(Show Context)
Citation Context ... transform a given monad into a new one with new operations. S.Liang et al. used monads and monad transformers to specify the semantics of programming language and called it modular monadic semantics =-=[18]-=-. Based on this, this paper proposes a first approach for program slicing based on modular monadic semantics, called modular monadic slicing. It can compute slices directly on abstract syntax, without... |

4 | Modularity in denotational semantics - Power - 1997 |

3 |
Cernuda del Rio, “Reusable Monadic Semantics of Object Oriented
- Gayo, Diez, et al.
- 2001
(Show Context)
Citation Context ...s, s) putvalue s = λ_. returnm (s, ()) Figure 1. Some common monad transformers Figure 2. Abstract syntax of WsFigure 1 describes some common monad transformers which are similar to the ones given in =-=[12, 15, 16, 18, 19]-=-. For the purpose of this paper, we will focus our attention on a simple imperative language W. Its abstract syntax is provided in Figure 2, where S ranges over statements Stmt, ide ranges over a set ... |

1 |
An Efficient Relevant Slicing Method for Debugging
- Tibor, István
- 1999
(Show Context)
Citation Context ... l.e = λL.{ v ← E l.e ; lkpSli ( r, getSli ) ; L′ ← {l} ∪ L ∪ U r∈Refs ( l.e ) loc ← lkpEnv(ide, rdEnv); updSto(loc, return v); xtdSli(ide, L′, getSli) } Similar to the way in forward dynamic slicing =-=[21]-=-, in our modular monadic approach, the program slices for associated variables of each statement are computed immediately after this statement is executed/analyzed. After the last statement is execute... |

1 |
Venkatesh, “Semantics of program slicing”, Bellcore TM-ARH-018561
- A
- 1990
(Show Context)
Citation Context ...E l.e ; L′ ← {l} ∪ L ∪ U r∈Refs ( l.e ) lkpSli ( r, getSli ) ; T ← getSli; T′ ← {f L′⋅ S L′; getSli}; mrgSli(T, T′) } ) The correctness proofs of our program slicing algorithm can refer to the way in =-=[9, 22]-=-. Informally, lkpSli ( r, getSli ) in the definition the term L and U r∈Refs ( l.e ) of L′ (see Equation (*)) can capture control dependences between statements and data dependences between variables,... |

1 |
A Modular Interpreter Built with Monad Transformers
- Kahl
- 2003
(Show Context)
Citation Context ... is still feasible, because there is a clear operational interpretation of modular monadic semantics, and some modular compilers/interpreters using monad transformers have already been constructed in =-=[11, 12, 18, 20, 23, 27]-=-. In respect of efficiency, our monadic algorithms are not less precise than PDG-based ones as shown from the example in Section 4. This is because the term L and lkpSli ( r, getSli ) in the definitio... |