Enhancing Partial Deduction via Unfold/Fold Rules

نویسندگان

  • Alberto Pettorossi
  • Maurizio Proietti
  • Sophie Renault
چکیده

We show that sometimes partial deduction produces poor program specializations because of its limited ability in (i) dealing with conjunctions of recursively deened predicates, (ii) combining partial evaluations of alternative computations, and (iii) taking into account unii-cation failures. We propose to extend the standard partial deduction technique by using versions of the deenition rule and the folding rule which allow us to specialize predicates deened by disjunctions of conjunctions of goals. We also consider a case split rule to take into account uniication 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 rst example refers to the automatic derivation of the Knuth-Morris-Pratt string matching algorithm, and the second example refers to the construction of a parser for a given regular expression. In both examples, the specialized programs are derived starting from naive, non-deterministic initial programs , whereas standard partial deduction can derive similar specialized programs only when complex, deterministic initial programs are provided .

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Conceptual Embedding of Folding into Partial Deduction: Towards a Maximal Integration

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. Moreov...

متن کامل

Advanced Logic Program Specialisation

In first part of this course [28] we have laid the theoretical foundations for logic program specialisation, notably introducing the technique of partial deduction along with some basic techniques to automatically control it. In this part of the course we first present in Section 2 an advanced way of controlling polyvariance based upon characteristic trees. We then show in Section 3 how partial...

متن کامل

Logic program specialisation through partial deduction: Control issues

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 well-automated application of parts of the Burstall-Darlington unfold/fold ...

متن کامل

Unfold/Fold Transformations For Definite Clause Programs

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 gener...

متن کامل

Under consideration for publication in Theory and Practice of Logic Programming 1 Logic program specialisation through

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 well-automated application of parts of the Burstall-Darlington unfold/fold ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1996