A Lightweight Approach to Program Specialization (original) (raw)

Program Specialization Based on Dynamic Slicing

2004

Within the imperative programming paradigm, program slicing has been widely used as a basis to solve many software engineering problems, like program understanding, debugging, testing, differencing, specialization, and merging. In this work, we present a lightweight approach to program slicing in lazy functional logic languages and discuss its potential applications in the context of pervasive systems where resources are limited. In particular, we show how program slicing can be used to achieve a form of program specialization that cannot be achieved with other, related techniques like partial evaluation.

Lightweight program specialization via dynamic slicing

Proceedings of the 2005 ACM SIGPLAN workshop on Curry and functional logic programming - WCFLP '05, 2005

Program slicing is a well-known technique that extracts from a program those statements which are relevant to a particular criterion. While static slicing does not consider any input data, dynamic slices are computed from a particular program execution. Thus, dynamic slicers are usually easier to design and implement.

Higher-Order Lazy Functional Slicing

Journal of Universal Computer Science, 2007

Program slicing is a well known family of techniques intended to identify and isolate code fragments which depend on, or are depended upon, specific program entities. This is particularly useful in the areas of reverse engineering, program understanding, testing and software maintenance. Most slicing methods, and corresponding tools, target either the imperative or the object oriented paradigms, where program slices are computed with respect to a variable or a program statement.

Dynamic slicing of lazy functional programs based on redex trails

Higher-Order and Symbolic Computation, 2008

Tracing computations is a widely used methodology for program debugging. Lazy languages, however, pose new demands on tracing techniques because following the actual trace of a computation is generally useless. Typically, tracers for lazy languages rely on the construction of a redex trail, a graph that stores the reductions performed in a computation. While tracing provides a significant help for locating bugs, the task still remains complex. A well-known debugging technique for imperative programs is based on dynamic slicing, a method for finding the program statements that influence the computation of a value for a specific program input.

Forward slicing of functional logic programs by partial evaluation

2007

Program slicing has been mainly studied in the context of imperative languages, where it has been applied to a wide variety of software engineering tasks, like program understanding, maintenance, debugging, testing, code reuse, etc. This work introduces the first forward slicing technique for declarative multi-paradigm programs which integrate features from functional and logic programming. Basically, given a program and a slicing criterion (a function call in our setting), the computed forward slice contains those parts of the original program which are reachable from the slicing criterion. Our approach to program slicing is based on an extension of (online) partial evaluation. Therefore, it provides a simple way to develop program slicing tools from existing partial evaluators and helps to clarify the relation between both methodologies. A slicing tool for the multi-paradigm language Curry, which demonstrates the usefulness of our approach, has been implemented in Curry itself.

A Formal Method for Program Slicing

2005 Australian Software Engineering Conference, 2005

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.

Slicing functional programs by calculation

2005

Abstract Program slicing is a well known family of techniques used to identify code fragments which depend on or are depended upon specific program entities. They are particularly useful in the areas of reverse engineering, program understanding, testing and software maintenance. Most slicing methods, usually targeting either the imperative or the object oriented paradigms, are based on some sort of graph structure representing program dependencies.

Abstract program slicing: From theory towards an implementation

Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 2010

In this paper we extend the formal framework proposed by Binkley et al. for representing and comparing forms of program slicing. This framework describes many well-known forms of slicing in a unique formal structure based on (abstract) projections of state trajectories. We use this formal framework for defining a new technique of slicing, called abstract slicing, which aims to slice programs with respect to properties of variables. In this way we are able to extend the original work with three forms of abstract slicing, static, dynamic and conditioned, we show that all existing forms are instantiations of their corresponding abstract forms and we enrich the existing slicing technique hierarchy by inserting these abstract forms of slicing. Furthermore, we provide an algorithmic approach for extracting abstract slices. The algorithm is split into two modules: the simple approach, used for abstract static slicing, and the extended approach, composed of several applications of the simple one, which is used for abstract conditioned slicing.