Charles Explorer logo
🇬🇧

Automatic Source Code Reduction

Publication at Faculty of Mathematics and Physics |
2010

Abstract

The aim of this paper is to introduce Reductor, a program that automatically removes unused parts of the source code of valid programs written in the Mercury language. Reductor implements two main kinds of reductions: statical reduction and dynamical reduction.

In the statical reduction, Reductor exploits semantic analysis of the Melbourne Mercury Compiler to nd routines which can be removed from the program. Dynamical reduction of routines additionally uses Mercury Deep Profiler and some sample input data for the program to remove unused contents of the program routines.

Reductor modifies the sources of the program in a way, which keeps the formatting of the original program source so that the reduced code is further editable.