## Refactoring for Comprehension

### BibTeX

@MISC{Villavicencio_refactoringfor,

author = {Gustavo Villavicencio and Facultad De Matemática Aplicada},

title = {Refactoring for Comprehension},

year = {}

}

### OpenURL

### Abstract

Functional programming is well suited for equational reasoning on programs. In this paper, we are trying to use this capability for program comprehension purposes. Specifically, in a program understanding process, higher-order operators can work like abstract schemes in which we can fit formal specifications calculated from the source code. Such specifications are calculated by a transformational process which we call reverse program calculation that operates on both notations: pointwise and pointfree. Once a specification matches an abstract schema, a new refactoring phase leading to a clearer source code takes place. At the same time, an unambiguous behavioural understanding is reached because we give a mathematical description of the abstract schemes. To provide a more complete and realistic perspective of the approach, we use recursive operators that can handle side effects.

### Citations

546 |
Reverse engineering and design recovery: A taxonomy
- Chikofsky, C
- 1990
(Show Context)
Citation Context ...on (the differences are irrelevant for our purpose) is the process by which usually starting from the source code, one can create representations of a software system at a higher level of abstraction =-=[2]-=-. This process is activated when maintenance activities are performed on poorly documented systems or on systems whose design has been lost through years of maintenance. In previous works [20, 24] we ... |

468 | Comprehending monads
- Wadler
- 1990
(Show Context)
Citation Context ...roperties. So, an automatic assistant for analysts would be necessary during real working conditions. Regarding theoretical aspects, we have also focused on solving cases involving monad combinations =-=[13, 15]-=-. Specifically, we are trying to solve situations where we are using monad transformers [17], and studying alternative mechanisms to compose monads such as co-products [7]. A first challenge on these ... |

250 | Monad Transformers and Modular Interpreters
- Liang, Hudak, et al.
(Show Context)
Citation Context ...ions. Regarding theoretical aspects, we have also focused on solving cases involving monad combinations [13, 15]. Specifically, we are trying to solve situations where we are using monad transformers =-=[17]-=-, and studying alternative mechanisms to compose monads such as co-products [7]. A first challenge on these issues would be to construct abstract schemes, i.e. monadic recursive operators as we have a... |

208 | Toposes, Triples and Theories
- Barr, Wells
(Show Context)
Citation Context ...A −→ M(FB). The construction of �F requires the application of a natural transformation δ F : FM ⇒ MF that distributes a monad over a functor. This natural transformation is called a distribution law =-=[1, 22]-=-. In order to show how the distribution law for the list functor is calculated, which will be used afterward, we introduce the concept of strength. It is a natural transformation τ induced by the stre... |

72 | Composing Monads
- Jones, Duponcheel
- 1993
(Show Context)
Citation Context ...roperties. So, an automatic assistant for analysts would be necessary during real working conditions. Regarding theoretical aspects, we have also focused on solving cases involving monad combinations =-=[13, 15]-=-. Specifically, we are trying to solve situations where we are using monad transformers [17], and studying alternative mechanisms to compose monads such as co-products [7]. A first challenge on these ... |

56 | Tool Support for Refactoring Functional Programs
- Huiqing, Reinke, et al.
- 2003
(Show Context)
Citation Context ...lready said, the source-to-source transformations are not guided by any pre-existent rule or transformational schema. We argue also that they are far from being supported by automatic tools like HaRe =-=[16]-=-. However, there seems to be an alternative way to overcome this problem. Specifically, in the context of VIII–13sthe PURe Project (http://lmf.di.uminho.pt/wiki/bin/view/PURe/WebHome) some work [3] is... |

24 | Composing Monads Using Coproducts
- Lüth, Ghani
- 2002
(Show Context)
Citation Context ...ving monad combinations [13, 15]. Specifically, we are trying to solve situations where we are using monad transformers [17], and studying alternative mechanisms to compose monads such as co-products =-=[7]-=-. A first challenge on these issues would be to construct abstract schemes, i.e. monadic recursive operators as we have applied here, but involving monad combinations according the different mechanism... |

19 | Monadic Maps and Folds for Arbitrary Datatypes
- Fokkinga
- 1994
(Show Context)
Citation Context ... homomorphism to any monadic algebra f : B −→ MB). In a diagram VIII–6sMµF �� � inF FµF 〈| f |〉 �F〈| f �� ∗ |〉 �� M B M F B f ∗ �� h = 〈| f |〉 ⇐⇒ h • � inF = f • �Fh (7) So, the monadic fold operator =-=[6]-=-, 〈| f |〉 M F : µF −→ M B is then defined as the least homomorphism between �in and f [22]. Using the fact that h • inF � = h · inF and �Fh = δF B · F h, we can rewrite (7) as µF 〈| f |〉 �� �� in FµF ... |

11 |
A pointless derivation of radixsort
- Gibbons
- 1999
(Show Context)
Citation Context ... from imperative source code we obtain the corresponding slices on a functional setting, and for each of them, we calculate a specifications support expressed as a set of equations in pointfree style =-=[4, 10, 21]-=-. Following the same way of program understanding on the functional setting, Gibbons [11] shows how to use the reverse of fusion, i.e. a fission process, to recover the lost design. In this paper, we ... |

7 |
An introduction to the Bird-Meertens Formalism
- Gibbons
- 1994
(Show Context)
Citation Context ...1) (2) g · ( f × id) = g · f (3) The other properties mentioned as much product and coproduct as exponential will not be developed here, and the reader will have to consult the appropriate literature =-=[9, 18]-=- et al. 2.2 The State Monad In imperative programming the state is the collection of all global variables and it is passed from one function to another in a sequential way. Therefore, if we have funct... |

6 | Pointwise Relational Programming
- Moor, Gibbons
- 2000
(Show Context)
Citation Context ...1) �� Subsidiary pointfree notation �� �� ✄ � Solution pointwise notation ✂ ✁ (3) (2) Solution pointfree notation FIGURE 1. Laplace approach applied to RPC process Starting from pointwise expressions =-=[5]-=-, usually written in HASKELL [14] or VDM-SL [12], we try to obtain an equivalent pointfree expression. To reach this target, successive transformation steps are performed on the pointwise expressions.... |

2 |
Fission for program comprehesion
- Gibbons
- 2006
(Show Context)
Citation Context ... each of them, we calculate a specifications support expressed as a set of equations in pointfree style [4, 10, 21]. Following the same way of program understanding on the functional setting, Gibbons =-=[11]-=- shows how to use the reverse of fusion, i.e. a fission process, to recover the lost design. In this paper, we investigate a complementary view of the process outlined in [20, 24], exploiting the supp... |

2 |
Category Theory for Program Construction by Calculation. Lecture Notes for ESSLLI'95
- Meertens
- 1995
(Show Context)
Citation Context ...1) (2) g · ( f × id) = g · f (3) The other properties mentioned as much product and coproduct as exponential will not be developed here, and the reader will have to consult the appropriate literature =-=[9, 18]-=- et al. 2.2 The State Monad In imperative programming the state is the collection of all global variables and it is passed from one function to another in a sequential way. Therefore, if we have funct... |

1 | Point-free programming with hylomorphisms
- Cunha
- 2004
(Show Context)
Citation Context ...e [16]. However, there seems to be an alternative way to overcome this problem. Specifically, in the context of VIII–13sthe PURe Project (http://lmf.di.uminho.pt/wiki/bin/view/PURe/WebHome) some work =-=[3]-=- is carried out in order to translate a pointwise expression into its pointfree equivalent. If this technology were available (monadic transformations are not covered by that work yet), the whole calc... |

1 | Making the point-free calculus less pointless
- Cunha, Pinto
- 2004
(Show Context)
Citation Context ... from imperative source code we obtain the corresponding slices on a functional setting, and for each of them, we calculate a specifications support expressed as a set of equations in pointfree style =-=[4, 10, 21]-=-. Following the same way of program understanding on the functional setting, Gibbons [11] shows how to use the reverse of fusion, i.e. a fission process, to recover the lost design. In this paper, we ... |

1 |
Design patters as higher-order datatype generic programs
- Gibbons
(Show Context)
Citation Context ... experiments carried out so far involve only the computational patterns mentioned. Nevertheless, the approach might scale up to more abstract schemes, which can be calculated and reused. For example, =-=[8]-=- proposes the construction of datatype-generic patterns of computation by parametrizing the shape of the data they manipulate. To abridge the conclusions: 1. We can calculate abstract schemes to work ... |