scispace - formally typeset
Search or ask a question
Topic

Program transformation

About: Program transformation is a research topic. Over the lifetime, 2468 publications have been published within this topic receiving 73415 citations.


Papers
More filters
Book ChapterDOI
24 Sep 1996
TL;DR: The aim of this paper is to define a theory of transformations of concurrent programs based on Unfold/Fold based transformations for the concurrent calculus CCS and to prove it correct.
Abstract: Program transformation is a technique for obtaining, starting from a program P, a semantically equivalent one, which is ”better” than P with respect to a particular goal. Traditionally, the main goal of program transformation was obtaining more efficient programs, but, in general, this technique can be used to produce programs written in a syntactic form satisfying some properties. Program transformation techniques have been extensively studied in the framework of functional and logic languages, where they were applied mainly to obtain more efficient and readable programs. All these works are based on the Unfold/Fold program transformation method developed by Burstall and Darlington in the context of their recursive equational language. The use of Unfold/Fold based transformations for concurrent languages is a relevant issue that has not yet received an adequate attention. In fact the existing proposals of transformations of concurrent programs are not based on a general Unfold/Fold transformation theory. The aim of this paper is to define such a theory for the concurrent calculus CCS and to prove it correct.

12 citations

Posted Content
TL;DR: A semantics is given that enables quantitative reasoning about a large class of approximate program transformations in a local, composable way and is based on a notion of distance between programs that defines what it means for an approximate transformation to be correct up to an error bound.
Abstract: An approximate program transformation is a transformation that can change the semantics of a program within a specified empirical error bound. Such transformations have wide applications: they can decrease computation time, power consumption, and memory usage, and can, in some cases, allow implementations of incomputable operations. Correctness proofs of approximate program transformations are by definition quantitative. Unfortunately, unlike with standard program transformations, there is as of yet no modular way to prove correctness of an approximate transformation itself. Error bounds must be proved for each transformed program individually, and must be re-proved each time a program is modified or a different set of approximations are applied. In this paper, we give a semantics that enables quantitative reasoning about a large class of approximate program transformations in a local, composable way. Our semantics is based on a notion of distance between programs that defines what it means for an approximate transformation to be correct up to an error bound. The key insight is that distances between programs cannot in general be formulated in terms of metric spaces and real numbers. Instead, our semantics admits natural notions of distance for each type construct; for example, numbers are used as distances for numerical data, functions are used as distances for functional data, an polymorphic lambda-terms are used as distances for polymorphic data. We then show how our semantics applies to two example approximations: replacing reals with floating-point numbers, and loop perforation.

12 citations

Journal ArticleDOI
TL;DR: It is proved that termination and satisfiability for append -like programs are undecidable, and an equivalent of the Bohm-Jacopini theorem for logic programming is proposed, which confirms the expressiveness of logic programming.
Abstract: The simplest nontrivial program pattern in logic programming is the following where fact, goal, left , and right are arbitrary terms. Because the well-known append program matches this pattern, we will denote such programs “ append -like.” In spite of their simple appearance, we prove in this paper that termination and satisfiability (i.e., the existence of answer-substitutions, called the emptiness problem) for append -like programs are undecidable. We also study some subcases depending on the number of occurrences of variables in fact, goal, left , or right . Moreover, we prove that the computational power of append -like programs is equivalent to the one of Turing machines; we show that there exists an append -like universal program. Thus, we propose an equivalent of the Bohm-Jacopini theorem for logic programming. This result confirms the expressiveness of logic programming. The proofs are based on program transformations and encoding of problems, unpredictable iterations within number theory defined by J. H. Conway, or the Post correspondence problem.

12 citations

Journal Article
TL;DR: This article partitions the call graph of the source program into strongly connected components, based on the simple observation that all functions in each component need the same extra parameters and thus a transitive closure is not needed, and reduces the time complexity of lambda-lifting from O(n3 log n) to O( n2 log n), where n is the size of the program.
Abstract: Lambda-lifting is a program transformation used in compilers and in partial evaluators and that operates in cubic time. In this article, we show how to reduce this complexity to quadratic time.Lambda-lifting transforms a block-structured program into a set of recursive equations, one for each local function in the source program. Each equation carries extra parameters to account for the free variables of the corresponding local function and of all its callees. It is the search for these extra parameters that yields the cubic factor in the traditional formulation of lambda-lifting, which is due to Johnsson. This search is carried out by a transitive closure.Instead, we partition the call graph of the source program into strongly connected components, based on the simple observation that all functions in each component need the same extra parameters and thus a transitive closure is not needed. We therefore simplify the search for extra parameters by treating each strongly connected component instead of each function as a unit, thereby reducing the time complexity of lambda-lifting from O(n3 log n) to O(n2 log n), where n is the size of the program.Since a lambda-lifter can output programs of size O(n2), we believe that our algorithm is close to optimal.

12 citations

Journal ArticleDOI
TL;DR: The list introduction strategy overcomes some of the limitations of the tuplings strategy and makes it possible to transform general recursive programs into linear recursive ones also in cases when this transformation cannot be performed by the tupling strategy.
Abstract: We present a new program transformation strategy based on the introduction of lists. This strategy is an extension of the tupling strategy which is based on the introduction of tuples of fixed length. The list introduction strategy overcomes some of the limitations of the tupling strategy and, in particular, it makes it possible to transform general recursive programs into linear recursive ones also in cases when this transformation cannot be performed by the tupling strategy. The linear recursive programs we derive by applying the list introduction strategy have in most cases very good time and space performance because they avoid repeated evaluations of goals and unnecessary constructions of data structures.

12 citations


Network Information
Related Topics (5)
Model checking
16.9K papers, 451.6K citations
92% related
Compiler
26.3K papers, 578.5K citations
88% related
Programming paradigm
18.7K papers, 467.9K citations
87% related
Executable
24K papers, 391.1K citations
86% related
Component-based software engineering
24.2K papers, 461.9K citations
86% related
Performance
Metrics
No. of papers in the topic in previous years
YearPapers
20234
202218
202126
202042
201956
201836