Results 1  10
of
20
Rules and Strategies for Transforming Functional and Logic Programs
 ACM Computing Surveys
, 1996
"... We present an overview of the program transformation methodology, focusing our attention on the socalled `rules + strategies' approach in the case of functional and logic programs. The paper is intended to offer an introduction to the subject. The various techniques we present are illustrated ..."
Abstract

Cited by 85 (5 self)
 Add to MetaCart
We present an overview of the program transformation methodology, focusing our attention on the socalled `rules + strategies' approach in the case of functional and logic programs. The paper is intended to offer an introduction to the subject. The various techniques we present are illustrated via simple examples. A preliminary version of this report has been published in: Moller, B., Partsch, H., and Schuman, S. (eds.): Formal Program Development. Lecture Notes in Computer Science 755, Springer Verlag (1993) 263304. Also published in: ACM Computing Surveys, Vol 28, No. 2, June 1996. 3 1 Introduction The program transformation approach to the development of programs has first been advocated by [BurstallDarlington 77], although the basic ideas were already presented in previous papers by the same authors [Darlington 72, BurstallDarlington 75]. In that approach the task of writing a correct and efficient program is realized in two phases: the first phase consists in writing an in...
Total Correctness by Local Improvement in the Transformation of Functional Programs
 ACM Transactions on Programming Languages and Systems
, 1996
"... ion. A common form of transformation, which is easily justified by appealing to reversibility, is abstraction. The abstraction transformation lifts some instances of subexpressions from the righthand sides of a set of definitions and replaces them with function calls for some new functions. The ab ..."
Abstract

Cited by 68 (6 self)
 Add to MetaCart
(Show Context)
ion. A common form of transformation, which is easily justified by appealing to reversibility, is abstraction. The abstraction transformation lifts some instances of subexpressions from the righthand sides of a set of definitions and replaces them with function calls for some new functions. The abstraction process can be used in conjunction with a callbyneed implementation to avoid repeated evaluation of subexpressions. A wellknown example is Hughes' supercombinator abstraction [Hughes 1982]. Another form of abstraction which is common in program transformation is syntactic generalization in which an expression e is replaced by a function call g e 1 : : : e n , where g is a new function defined by g x 1 : : : xn \Delta = e 0 , such that e j e 0 f e 1 : : : e n= x 1 : : : xn g. General statements about abstractions and their correctness are notationally rather complex. In practice we have found it is easier to appeal to a reversibility argument on a casebycase basis than...
Transformation of Logic Programs
 Handbook of Logic in Artificial Intelligence and Logic Programming
, 1998
"... Program transformation is a methodology for deriving correct and efficient programs from specifications. In this chapter, we will look at the so called 'rules + strategies' approach, and we will report on the main techniques which have been introduced in the literature for that approach, i ..."
Abstract

Cited by 40 (4 self)
 Add to MetaCart
Program transformation is a methodology for deriving correct and efficient programs from specifications. In this chapter, we will look at the so called 'rules + strategies' approach, and we will report on the main techniques which have been introduced in the literature for that approach, in the case of logic programs. We will also present some examples of program transformation, and we hope that through those examples the reader may acquire some familiarity with the techniques we will describe.
Transformation Rules for Locally Stratified Constraint Logic Programs
, 2004
"... We propose a set of transformation rules for constraint logic programs with negation. We assume that every program is locally strati ed and, thus, it has a unique perfect model. We give sucient conditions which ensure that the proposed set of transformation rules preserves the perfect model of ..."
Abstract

Cited by 22 (19 self)
 Add to MetaCart
(Show Context)
We propose a set of transformation rules for constraint logic programs with negation. We assume that every program is locally strati ed and, thus, it has a unique perfect model. We give sucient conditions which ensure that the proposed set of transformation rules preserves the perfect model of the programs. Our rules extend in some respects the rules for logic programs and constraint logic programs already considered in the literature and, in particular, they include a rule for unfolding a clause with respect to a negative literal.
Total Correctness by Local Improvement in Program Transformation
 In Proceedings of the 22nd Annual ACM SIGPLANSIGACT Symposium on Principles of Programming Languages (POPL
, 1995
"... The goal of program transformation is to improve efficiency while preserving meaning. One of the best known transformation techniques is Burstall and Darlington's unfoldfold method. Unfortunately the unfoldfold method itself guarantees neither improvement in efficiency nor totalcorrectness. ..."
Abstract

Cited by 20 (3 self)
 Add to MetaCart
(Show Context)
The goal of program transformation is to improve efficiency while preserving meaning. One of the best known transformation techniques is Burstall and Darlington's unfoldfold method. Unfortunately the unfoldfold method itself guarantees neither improvement in efficiency nor totalcorrectness. The correctness problem for unfoldfold is an instance of a strictly more general problem: transformation by locally equivalencepreserving steps does not necessarily preserve (global) equivalence. This paper presents a condition for the total correctness of transformations on recursive programs, which, for the first time, deals with higherorder functional languages (both strict and nonstrict) including lazy data structures. The main technical result is an improvement theorem which says that if the local transformation steps are guided by certain optimisation concerns (a fairly natural condition for a transformation), then correctness of the transformation follows. The improvement theorem make...
A transformation system for definite programs based on termination analysis
 Proceedings of LOPSTR'94 and META'94, Pisa, Italy, LNCS 883
, 1994
"... Abstract. We present a goal replacement rule whose main applicability condition is based on termination properties of the resulting transformed program. The goal replacement rule together with a multistep unfolding rule forms a powerful and elegant transformation system for definite programs. It al ..."
Abstract

Cited by 14 (0 self)
 Add to MetaCart
(Show Context)
Abstract. We present a goal replacement rule whose main applicability condition is based on termination properties of the resulting transformed program. The goal replacement rule together with a multistep unfolding rule forms a powerful and elegant transformation system for definite programs. It also sheds new light on the relationship between folding and goal replacement, and between different folding rules. Our explicit termination condition contrasts with other transformation systems in the literature, which contain conditions on folding and goal replacement, often rather complex, in order to avoid “introducing a loop ” into a program. We prove that the goal replacement rule preserves the success set of a definite program. We define an extended version of goal replacement that also preserves the finite failure set. A powerful folding rule can be constructed as a special case of goal replacement, allowing folding with recursive rules, with no distinction between old and new predicates. A proof that Seki’s transformation system preserves recurrence, an important termination property, is outlined. 1
Simultaneous Replacement in Normal Programs
, 1993
"... The simultaneous replacement transformation operation, is here defined and studied wrt normal programs. We give applicability conditions able to ensure the correctness of the operation wrt the set of logical consequences of the completed database. We consider separately the cases in which the underl ..."
Abstract

Cited by 13 (5 self)
 Add to MetaCart
(Show Context)
The simultaneous replacement transformation operation, is here defined and studied wrt normal programs. We give applicability conditions able to ensure the correctness of the operation wrt the set of logical consequences of the completed database. We consider separately the cases in which the underlying language is infinite and finite; in this latter case we also distinguish according to the kind of domain closure axioms adopted. As corollaries we obtain results for Fitting's and Kunen's semantics. We also show how simultaneous replacement can mimic other transformation operations such as thinning, fattening and folding, thus producing applicability conditions for them too.
Replacement Can Preserve Termination
"... We consider the replacement transformation operation, a very general and powerful transformation, and study under which conditions it preserves universal termination besides computed answer substitutions. With this safe replacement we can significantly extend the safe unfold/fold transformation sequ ..."
Abstract

Cited by 9 (3 self)
 Add to MetaCart
We consider the replacement transformation operation, a very general and powerful transformation, and study under which conditions it preserves universal termination besides computed answer substitutions. With this safe replacement we can significantly extend the safe unfold/fold transformation sequence presented in [11]. By exploiting typing information, more useful conditions can be defined and we may deal with some special cases of replacement very common in practice, namely switching two atoms in the body of a clause and the associativity of a predicate. This is a first step in the direction of exploiting a Pre/Post specification on the intended use of the program to be transformed. Such specification can restrict the instances of queries and clauses to be considered and then relax the applicability conditions on the transformation operations.
HigherOrder Expression Procedures
 In Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and SemanticsBased Program Manipulation (PEPM
, 1995
"... We investigate the soundness of a specialisation technique due to Scherlis, expression procedures, in the context of a higherorder nonstrict functional language. An expression procedure is a generalised procedure construct providing a contextually specialised definition. The addition of expression ..."
Abstract

Cited by 7 (2 self)
 Add to MetaCart
(Show Context)
We investigate the soundness of a specialisation technique due to Scherlis, expression procedures, in the context of a higherorder nonstrict functional language. An expression procedure is a generalised procedure construct providing a contextually specialised definition. The addition of expression procedures thereby facilitates the manipulation and specialisation of programs. In the expression procedure approach, programs thus generalised are transformed by means of three key transformation rules: composition, application and abstraction. Arguably, the most notable, yet most overlooked feature of the expression procedure approach to transformation, is that the transformation rules always preserve the meaning of programs. This is in contrast to the unfoldfold transformation rules of Burstall and Darlington. In Scherlis' thesis, this distinguishing property was shown to hold for a strict firstorder language. Rules for callbyname evaluation order were stated but not proved correct....