Results 1  10
of
40
Logic program specialisation through partial deduction: Control issues
 THEORY AND PRACTICE OF LOGIC PROGRAMMING
, 2002
"... Program specialisation aims at improving the overall performance of programs by performing source to source transformations. A common approach within functional and logic programming, known respectively as partial evaluation and partial deduction, is to exploit partial knowledge about the input. It ..."
Abstract

Cited by 66 (13 self)
 Add to MetaCart
Program specialisation aims at improving the overall performance of programs by performing source to source transformations. A common approach within functional and logic programming, known respectively as partial evaluation and partial deduction, is to exploit partial knowledge about the input. It is achieved through a wellautomated application of parts of the BurstallDarlington unfold/fold transformation framework. The main challenge in developing systems is to design automatic control that ensures correctness, efficiency, and termination. This survey and tutorial presents the main developments in controlling partial deduction over the past 10 years and analyses their respective merits and shortcomings. It ends with an assessment of current achievements and sketches some remaining research challenges.
Controlling generalisation and polyvariance in partial deduction of normal logic programs
, 1996
"... In this paper, we further elaborate global control for partial deduction: For which atoms, among possibly innitely many, should partial deductions be produced, meanwhile guaranteeing correctness as well as termination, and providing ample opportunities for negrained polyvariance? Our solution is b ..."
Abstract

Cited by 60 (40 self)
 Add to MetaCart
(Show Context)
In this paper, we further elaborate global control for partial deduction: For which atoms, among possibly innitely many, should partial deductions be produced, meanwhile guaranteeing correctness as well as termination, and providing ample opportunities for negrained polyvariance? Our solution is based on two ingredients. First, we use the wellknown concept of a characteristic tree to guide abstraction (or generalisation) and polyvariance, and aim for producing one specialised procedure per characteristic tree generated. Previous work along this line failed to provide abstraction correctly dealing with characteristic trees. We show how this can be rectied in an elegant way. Secondly, we structure combinations of atoms and associated characteristic trees in global trees registering \causal " relationships among such pairs. This will allow us to spot looming nontermination and consequently perform proper generalisation in order to avert the danger, without having to impose a depth bound on characteristic trees. Leaving unspecied the specic local control one may wish to plug in, the resulting global control strategy enables partial deduction that always terminates in an elegant, non ad hoc way, while providing excellent specialisation as well as negrained (but reasonable) polyvariance.
Tupling Calculation Eliminates Multiple Data Traversals
 In ACM SIGPLAN International Conference on Functional Programming
, 1997
"... Tupling is a wellknown transformation tactic to obtain new efficient recursive functions by grouping some recursive functions into a tuple. It may be applied to eliminate multiple traversals over the common data structure. The major difficulty in tupling transformation is to find what functions are ..."
Abstract

Cited by 38 (20 self)
 Add to MetaCart
Tupling is a wellknown transformation tactic to obtain new efficient recursive functions by grouping some recursive functions into a tuple. It may be applied to eliminate multiple traversals over the common data structure. The major difficulty in tupling transformation is to find what functions are to be tupled and how to transform the tupled function into an efficient one. Previous approaches to tupling transformation are essentially based on fold/unfold transformation. Though general, they suffer from the high cost of keeping track of function calls to avoid infinite unfolding, which prevents them from being used in a compiler. To remedy this situation, we propose a new method to expose recursive structures in recursive definitions and show how this structural information can be explored for calculating out efficient programs by means of tupling. Our new tupling calculation algorithm can eliminate most of multiple data traversals and is easy to be implemented. 1 Introduction Tupli...
Logic Program Specialisation: How To Be More Specific
 Proceedings of the International Symposium on Programming Languages, Implementations, Logics and Programs (PLILP'96), LNCS 1140
, 1996
"... Standard partial deduction suffers from several drawbacks when compared to topdown abstract interpretation schemes. Conjunctive partial deduction, an extension of standard partial deduction, remedies one of those, namely the lack of sideways information passing. But two other problems remain: the l ..."
Abstract

Cited by 38 (24 self)
 Add to MetaCart
Standard partial deduction suffers from several drawbacks when compared to topdown abstract interpretation schemes. Conjunctive partial deduction, an extension of standard partial deduction, remedies one of those, namely the lack of sideways information passing. But two other problems remain: the lack of successpropagation as well as the lack of inference of global successinformation. We illustrate these drawbacks and show how they can be remedied by combining conjunctive partial deduction with an abstract interpretation technique known as more specific program construction. We present a simple, as well as a more refined integration of these methods. Finally we illustrate the practical relevance of this approach for some advanced applications, like proving functionality or specialising certain metaprograms written in the ground representation, where it surpasses the precision of current abstract interpretation techniques. 1 Introduction The heart of any technique for partial deduc...
Reducing Nondeterminism while Specializing Logic Programs
, 1997
"... Program specialization is a collection of program transformation techniques for improving program efficiency by exploiting some information available at compiletime about the input data. We show that current techniques for program specialization based on partial evaluation do not perform well on non ..."
Abstract

Cited by 27 (15 self)
 Add to MetaCart
Program specialization is a collection of program transformation techniques for improving program efficiency by exploiting some information available at compiletime about the input data. We show that current techniques for program specialization based on partial evaluation do not perform well on nondeterministic logic programs. We then consider a set of transformation rules which extend the ones used for partial evaluation, and we propose a strategy to direct the application of these extended rules so to derive very efficient specialized programs. The efficiency improvements which may even be exponential, are achieved because the derived programs are semideterministic and the operations which are performed by the initial programs in different branches of the computation trees, are performed in the specialized programs within single branches. We also make use of mode information to guide the unfolding process and to reduce nondeterminism. To exemplify our technique, we show that we can...
A conceptual embedding of folding into partial deduction: Towards a maximal integration
, 1996
"... The relation between partial deduction and the unfold/fold approach has been a matter of intense discussion. In this paper we consolidate the advantages of the two approaches and provide an extended partial deduction framework in which most of the tupling and deforestation transformations of the fol ..."
Abstract

Cited by 25 (13 self)
 Add to MetaCart
(Show Context)
The relation between partial deduction and the unfold/fold approach has been a matter of intense discussion. In this paper we consolidate the advantages of the two approaches and provide an extended partial deduction framework in which most of the tupling and deforestation transformations of the fold/unfold approach, as well the current partial deduction transformations, can be achieved. Moreover, most of the advantages of partial deduction, e.g. lower complexity and a more detailed understanding of control issues, are preserved. We build on welldefined concepts in partial deduction and present a conceptual embedding of folding into partial deduction, called conjunctive partial deduction. Two minimal extensions to partial deduction are proposed: using conjunctions of atoms instead of atoms as the principle specialisation entity and also renaming conjunctions of atoms instead of individual atoms. Correctness results for the extended framework (with respect to computed answer semantics and finite failure semantics) are given. Experiments with a prototype implementation are presented, showing that, somewhat to our surprise, conjunctive partial deduction not only handles the removal of unnecessary variables, but also leads to substantial improvements in specialisation for standard partial deduction examples. 1
Unfold/Fold Transformations For Definite Clause Programs
 In Proceedings of PLILP, LNCS 844
, 1994
"... . An unfold/fold program transformation system which extends the unfold/fold transformations of H. Tamaki and T. Sato is presented in this paper. The system consists of unfolding, simultaneous folding, and generalization + equality introduction rules. The simultaneous folding rule permits the foldin ..."
Abstract

Cited by 23 (5 self)
 Add to MetaCart
. An unfold/fold program transformation system which extends the unfold/fold transformations of H. Tamaki and T. Sato is presented in this paper. The system consists of unfolding, simultaneous folding, and generalization + equality introduction rules. The simultaneous folding rule permits the folding of a set of folded clauses into a single clause, using a set of folding clauses, while the generalization + equality introduction rule facilitates the application of the simultaneous folding rule by performing appropriate abstractions. A proof of the correctness of the proposed transformations in the sense of the least Herbrand model semantics of the program is also presented. 1 Introduction Unfold/fold transformations were first proposed by R. Burstall and J. Darlington [BD77] in the context of a functional language. In the context of logic programming, H. Tamaki and T. Sato [TS84, TS86] formulated unfold/fold transformations for definite clause programs so as to preserve the equivalence...
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.
Perfect Model Checking via Unfold/Fold Transformations
 In Computational Logic, LNCS 1861
, 2000
"... We show how program transformation rules and strategies may be used for proving the satisfiability of first order formulas in some classes of models. In particular, we propose a technique for showing that a closed first order formula ' holds in the perfect model M(P ) of a logic program P with ..."
Abstract

Cited by 11 (8 self)
 Add to MetaCart
(Show Context)
We show how program transformation rules and strategies may be used for proving the satisfiability of first order formulas in some classes of models. In particular, we propose a technique for showing that a closed first order formula ' holds in the perfect model M(P ) of a logic program P with locally stratified negation. This property is denoted by M(P ) j= '. For this purpose we consider a new version of the unfold/fold transformation rules and we show that this version preserves the perfect model semantics. Our proof method, called unfold/fold proof method, shows M(P ) j= ' by: (i) introducing a new predicate symbol f and constructing a conjunction F (f ; ') of clauses such that M(P ) j= ' i M(P ^ F (f ; ')) j= f , and then (ii) transforming the program P ^F (f ; ') into a new program of the form Q^f , for some conjunction Q of clauses. We also present a strategy for applying our unfold/fold rules in a semiautomatic way. Our strategy may or may not terminate, depending on t...