Results 11 - 20
of
28
Transforming Acyclic Programs
- ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS
, 1993
"... An Unfold/Fold transformation system is a source-to-source rewriting methodology devised to improve the efficiency of a program. Any such transformation should preserve the main properties of the initial program: among them, termination. To this end, in the field of logic programming, the class of ..."
Abstract
-
Cited by 10 (3 self)
- Add to MetaCart
An Unfold/Fold transformation system is a source-to-source rewriting methodology devised to improve the efficiency of a program. Any such transformation should preserve the main properties of the initial program: among them, termination. To this end, in the field of logic programming, the class of acyclic programs plays an important role, as it is closely related to the one of terminating programs. The two classes coincide when negation is not allowed in the bodies of the clauses. In this paper it is proven that the Unfold/Fold transformation system defined by Tamaki and Sato preserves the acyclicity of the initial program. As corollaries, it follows that when the transformation is applied to an acyclic program, then finite failure set for definite programs is preserved; in the case of normal programs, all major declarative and operational semantics are preserved as well. These results cannot be extended to the class of left terminating programs without modifying the definitio...
Unfold/fold transformations preserving termination properties. To appear as a technical report from DAIMI
, 1992
"... Abstract. The unfold/fold framework constitutes the spine of many program transformation strategies. However, by unrestricted use of folding the target program may terminate less often than the source program. Several authors have investigated the problem of setting up conditions of syntactic nature ..."
Abstract
-
Cited by 9 (1 self)
- Add to MetaCart
Abstract. The unfold/fold framework constitutes the spine of many program transformation strategies. However, by unrestricted use of folding the target program may terminate less often than the source program. Several authors have investigated the problem of setting up conditions of syntactic nature, i.e. not based on some well-founded ordering of the arguments, which guarantee preservation of termination properties. These conditions are typically formulated in a way which makes it hard to grasp the basic intuition why they work, and in a way which makes it hard to give elegant proofs of correctness. The aim of this paper will be to give a more unified treatment by setting up a model which enables us to reason about termination preservation in a cleaner and more algebraic fashion. The model resembles a logic language and is parametrized with respect to evaluation order, but it should not be too difficult to transfer the ideas to other languages. 1
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.
Beyond Tamaki-Sato Style Unfold/Fold Transformations for Normal Logic Programs
- IN ASIAN, LNCS 1742
, 1999
"... Unfold/fold transformation systems for logic programs have been extensively investigated. Existing unfold/fold transformation systems for normal logic programs allow only Tamaki-Sato style folding using clauses from a previous program in the transformation sequence: i.e., they fold using a singl ..."
Abstract
-
Cited by 8 (3 self)
- Add to MetaCart
Unfold/fold transformation systems for logic programs have been extensively investigated. Existing unfold/fold transformation systems for normal logic programs allow only Tamaki-Sato style folding using clauses from a previous program in the transformation sequence: i.e., they fold using a single, non-recursive clause. In this paper we present a transformation system that permits folding in the presence of recursion, disjunction, as well as negation. We show that the transformations are correct with respect to various semantics of negation including the well-founded model and stable model semantics.
Enhancing Partial Deduction via Unfold/Fold Rules
- Proc. LoPSTr '96
, 1996
"... We show that sometimes partial deduction produces poor program specializations because of its limited ability in (i) dealing with conjunctions of recursively defined predicates, (ii) combining partial evaluations of alternative computations, and (iii) taking into account unification failures. We pro ..."
Abstract
-
Cited by 7 (4 self)
- Add to MetaCart
We show that sometimes partial deduction produces poor program specializations because of its limited ability in (i) dealing with conjunctions of recursively defined predicates, (ii) combining partial evaluations of alternative computations, and (iii) taking into account unification failures. We propose to extend the standard partial deduction technique by using versions of the definition rule and the folding rule which allow us to specialize predicates defined by disjunctions of conjunctions of goals. We also consider a case split rule to take into account unification failures. Moreover, in order to perform program specialization via partial deduction in an automatic way, we propose a transformation strategy which takes as parameters suitable substrategies for directing the application of every transformation rule. Finally, we show through two examples that our partial deduction technique is superior to standard partial deduction. The first example refers to the automatic derivation...
A transformation tool for pure Prolog programs - the algebraic specification -
, 1996
"... This technical report contains the complete annotated algebraic specification of `TransLog', a transformation tool for pure Prolog programs. TransLog supports the interactive transformation of (a part of) a program by means of buttons representing transformation steps. As much as possible, pure Prol ..."
Abstract
-
Cited by 7 (1 self)
- Add to MetaCart
This technical report contains the complete annotated algebraic specification of `TransLog', a transformation tool for pure Prolog programs. TransLog supports the interactive transformation of (a part of) a program by means of buttons representing transformation steps. As much as possible, pure Prolog semantics are preserved. The choice of pure Prolog semantics induces a number of conditions that have to be satisfied before a particular transformation step is to be applied. Keywords: logic programming, program transformation, algebraic specification. 1 Introduction In this report we present the complete algebraic specification of TransLog, a tool for transformation of pure Prolog programs. The report does not contain an introduction to the theory of (logic) program transformation, nor a description of how the TransLog tool relates to the various theoretical considerations. For the first subject the reader is referred to [TS84], [Sek91] or [PP94]. For the second subject, see [Bru96]. ...
Transformation of Left Terminating Programs
- PROCEEDINGS OF THE NINTH INTERNATIONAL WORKSHOP ON LOGIC-BASED PROGRAM SYNTHESIS, LOPSTR'99
, 2000
"... We propose an unfold-fold transformation system which preserves left termination for definite programs besides its declarative semantics. The system extends our previous proposal in [BCE95] by allowing to switch the atoms in the clause bodies when a specific applicability condition is satisfied. The ..."
Abstract
-
Cited by 3 (1 self)
- Add to MetaCart
We propose an unfold-fold transformation system which preserves left termination for definite programs besides its declarative semantics. The system extends our previous proposal in [BCE95] by allowing to switch the atoms in the clause bodies when a specific applicability condition is satisfied. The applicability condition is very simple to verify, yet very common in practice. We also discuss how to verify such condition by exploiting mode information.
TransLog, an interactive tool for transformation of logic programs
, 1995
"... This report describes `TransLog', a prototype of a transformation tool for logic programs. The tool has been developed with the ASF+SDF Meta--environment, a programming environment generator tool based on algebraic specification. TransLog supports the interactive transformation of (a part of) a prog ..."
Abstract
-
Cited by 2 (0 self)
- Add to MetaCart
This report describes `TransLog', a prototype of a transformation tool for logic programs. The tool has been developed with the ASF+SDF Meta--environment, a programming environment generator tool based on algebraic specification. TransLog supports the interactive transformation of (a part of) a program by means of buttons representing transformation rules. This report contains the complete annotated algebraic specification of TransLog. Keywords: logic programming, algebraic specification, program transformations. 1 Introduction The subject of program transformation deals with transforming a simple-but-inefficient program into a more efficient program. An initial program P 0 is modified by applying a sequence of well-defined transformation rules, resulting in a program sequence P 0 : : : P k . As much as possible, the semantic properties of a program are maintained during a transformation sequence. Program transformations have been studied since the seventies. We refer to the work of...
Reasoning about Stable Models (and Other Unstable Semantics)
- Technical Report, IBM Thomas J. Watson Research
, 1990
"... The well-founded semantics and stable model semantics have proven popular semantics for logic programs. However, these semantics (and others) are not directly amenable to logical reasoning since logically equivalent logic programs may have different stable or well-founded models. Many natural simpli ..."
Abstract
-
Cited by 2 (1 self)
- Add to MetaCart
The well-founded semantics and stable model semantics have proven popular semantics for logic programs. However, these semantics (and others) are not directly amenable to logical reasoning since logically equivalent logic programs may have different stable or well-founded models. Many natural simplifications are not universally valid. Furthermore, in some semantics -- including the stable model semantics -- the definition of a new predicate in terms of old predicates can affect the semantics of the old predicates. We provide valid transformation systems for the well-founded, stable model and Clark-completion semantics. We give restrictions on the application of the simplifications which make them valid, and restrictions on the form of new definitions which avoid unwelcome side-effects on other predicates. The resulting transformation systems form a basis for reasoning in these unstable semantics.
Developing Correct and Efficient Logic Programs by Transformation
- Knowledge Engineering Review
, 1996
"... this paper, from formal specifications one may obtain executable, efficient programs by using techniques for transforming logic programs. This is, indeed, one of the reasons that makes logic programming very attractive for program construction. During this final step from specifications to programs, ..."
Abstract
-
Cited by 2 (0 self)
- Add to MetaCart
this paper, from formal specifications one may obtain executable, efficient programs by using techniques for transforming logic programs. This is, indeed, one of the reasons that makes logic programming very attractive for program construction. During this final step from specifications to programs, in order to improve efficiency one may want to use program transformation for avoiding multiple visits of data structures, or replacing complex forms of recursion by tail recursion, or reducing nondeterminism of procedures. This paper is structured as follows. In Section 2 we present the rule-based approach to program transformation and its use for the derivation and synthesis of logic programs from specifications. In Section 3 we consider the schema-based transformation technique for the development of efficient programs. In Section 4 we consider the partial evaluation technique and its use for the specialization of logic programs when the input data are partially known at compile time. In the final section we discuss some of the achievements and challanges of program transformation as a tool for logic-based software engineering. For simplicity reasons in this paper we will only consider definite logic programs, although most of the techniques we will describe can be applied also in the case of general logic programs. We refer to [35, 41] for all notions concerning logic programming and logic program transformation which are not explicitly presented here.

