Lecture Notes in Computer Science

Similar documents
Lecture Notes in Computer Science

Lecture Notes in Computer Science

Lecture Notes in Computer Science Edited by G. Goos, J. Hartmanis and J. van Leeuwen

Lecture Notes in Computer Science

Lecture Notes in Computer Science. Edited by G. Goos, J. Hartmanis and J. van Leeuwen

Lecture Notes in Computer Science

Lecture Notes in Artificial Intelligence. Lecture Notes in Computer Science

Lecture Notes in Computer Science

Lecture Notes in Computer Science 2599 Edited by G. Goos, J. Hartmanis, and J. van Leeuwen

Lecture Notes in Computer Science

Lecture Notes in Computer Science

WORKSHOPS IN COMPUTING. Series edited by C: J. van Rijsbergen

WORKSHOPS IN COMPUTING Series edited by C. J. van Rijsbergen

Lecture Notes in Computer Science 2500 Edited by G. Goos, J. Hartmanis, and J. van Leeuwen

Lecture Notes in Computer Science. Edited by G. Goos, J. Hartmanis and J. van Leeuwen

Lecture Notes in Computer Science. Edited by G. Goos and J. Hartmanis Advisory Board: W. Brauer D. Gries J. Stoer

Lecture Notes in Computer Science 2006 Edited by G. Goos, J. Hartmanis and J. van Leeuwen

Data Assimilation: Tools for Modelling the Ocean in a Global Change Perspective

Lecture Notes in Computer Science

Lecture Notes in Computer Science 1096 Edited by G. Goos, J. Hartmanis and J. van Leeuwen

Modeling Manufacturing Systems. From Aggregate Planning to Real-Time Control

Lecture Notes in Computer Science Edited by G. Goos, J. Hartmanis and J. van Leeuwen

Architecture Design and Validation Methods

Lecture Notes in Artificial Intelligence

Lecture Notes in Computer Science

Future-Oriented Technology Analysis

Lecture Notes in Control and Information Sciences 283. Editors: M. Thoma M. Morari

Lecture Notes in Computer Science 1924 Edited by G. Goos, J. Hartmanis and J. van Leeuwen

TECHNOLOGY, INNOVATION, and POLICY 3. Series of the Fraunhofer Institute for Systems and Innovation Research (lsi)

Lecture Notes in Computer Science 1946 Edited by G. Goos, J. Hartmanis and J. van Leeuwen

Lecture Notes in Artificial Intelligence

Lecture Notes in Artificial Intelligence

Communications in Computer and Information Science 85

ZEW Economic Studies. Publication Series of the Centre for European Economic Research (ZEW), Mannheim, Germany

Lecture Notes in Control and Information Sciences

Lecture Notes in Computer Science 1500 Edited by G. Goos, J. Hartmanis and J. van Leeuwen

StraBer Wahl Graphics and Robotics

Cognitive Systems Monographs

Foreword. Imperial College London

Design for Innovative Value Towards a Sustainable Society

Lecture Notes in Economics and Mathematical Systems

Spatio-Temporal Image Processing

Lecture Notes in Artificial Intelligence

Handbook of Engineering Acoustics

Enabling Manufacturing Competitiveness and Economic Sustainability

Requirements Engineering for Digital Health

Simulation by Bondgraphs

SpringerBriefs in Space Development

Lecture Notes in Artificial Intelligence 2922

Better Business Regulation in a Risk Society

Lecture Notes in Computer Science

Studies in Empirical Economics

Computer-Aided Production Management

Founding Editor Martin Campbell-Kelly, University of Warwick, Coventry, UK

146 Advances in Polymer Science

MATLAB Guide to Finite Elements

Testing Safety-Related Software

Advances in Modern Tourism Research

Lecture Notes in Artificial Intelligence

Lecture Notes in Artificial Intelligence 3396

Lecture Notes in Computer Science

ACHIEVEMENT AND ASSURANCE OF SAFETY

Lecture Notes in Computer Science

Lecture Notes in Control and Information Sciences 198. Editor: M. Thoma

U. Lindemann (Ed.) Human Behaviour in Design

Advances in Behavioral Economics

Matthias Pilz Susanne Berger Roy Canning (Eds.) Fit for Business. Pre-Vocational Education in European Schools RESEARCH

NO MORE MUDDLING THROUGH

Health Information Technology Standards. Series Editor: Tim Benson

2 Forensic Science Progress

Lecture Notes in Computer Science 2013 Edited by G. Goos, J. Hartmanis and J. van Leeuwen

Pierre-Yves Henin (Ed.) Advances in Business Cycle Research

Applied Technology and Innovation Management

3 Forensic Science Progress

Risk-Based Ship Design

Lecture Notes in Economics and Mathematical Systems

Acoustic Emission Testing

Sergey Ablameyko and Tony Pridmore. Machine Interpretation of Line Drawing Images. Technical Drawings, Maps and Diagrams.

Broadband Networks, Smart Grids and Climate Change

ANALOG CIRCUITS AND SIGNAL PROCESSING

Programming Methodology

.. Algorithms and Combinatorics 17

Cost Analysis and Estimating

Lecture Notes in Artificial Intelligence

Innovation Policy in a Knowledge-Based Economy

Technology Roadmapping for Strategy and Innovation

Hierarchy Process. The Analytic. Bruce L. Golden Edward A. Wasil Patrick T. Harker (Eds.) Applications and Studies

COOP 2016: Proceedings of the 12th International Conference on the Design of Cooperative Systems, May 2016, Trento, Italy

Scientific Data Mining and Knowledge Discovery

Future Trends of TAPSOFT

The Future of Civil Litigation

Lecture Notes in Computer Science 3081

Statistics and Computing Series Editors: J. Chambers D. Hand W. Härdle

Inside the Smart Home

Studies in Economic Ethics and Philosophy

Lecture Notes in Computer Science 1885 Edited by G. Goos, J. Hartmanis, and J. van Leeuwen

Application of Evolutionary Algorithms for Multi-objective Optimization in VLSI and Embedded Systems

Human-Computer Interaction Series

Representations of Integers as Sums of Squares

Dao Companion to the Analects

Transcription:

Lecture Notes in Computer Science Edited by G. Goos, J. Hartmanis and J. van Leeuwen 1048 Advisory Board: W. Brauer D. Gries J. Stoer

Maurizio Proietti (Ed.) Logic Program Synthesis and Transformation 5th International Workshop, LOPSTR' 95 Utrecht, The Netherlands September 20-22, 1995 Proceedings Springer

Series Editors Gerhard Goos, Karlsruhe University, Germany Juris Hartmanis, Cornell University, NY, USA Jan van Leeuwen, Utrecht University, The Netherlands Volume Editor Maurizio Proietti IASI-CNR Viale Manzoni 30, 1-00185 Rome, Italy Cataloging-in-Publication data applied for Die Deutsche Bibliothek - CIP-Einheitsaufnahme Logic program synthesis and transformation 9 5th international workshop ; proceedings / LOPSTR '95, Utrecht, The Netherlands, September 20-22, 1995. Maurizio Proietti (ed.). - Berlin ; Heidelberg ; New York ; Barcelona ; Budapest ; Hong Kong ; London ; Milan ; Paris ; Santa Clara ; Singapore ; Tokyo : Springer, 1996 (Lecture notes in computer science ; Vol. 1048) ISBN 3-540-60939-3 NE: Proietti, Maurizio [Hrsg.]; LOPSTR <5, 1995, Utrecht>; GT CR Subject Classification (1991): D.1.2, 1.2.2, D,1.6,E4.1, F.3.1 ISBN 3-540-60939-3 Springer-Verlag Berlin Heidelberg New York This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, re-use of illustrations, recitation, broadcasting, reproduction on microfilms or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permission for use must always be obtained from Springer -Verlag. Violations are liable for prosecution under the German Copyright Law. 9 Springer-Verlag Berlin Heidelberg 1996 Printed in Germany Typesetting: Camera-ready by author SPIN 10512651 06/3142-5 4 3 2 1 0 Printed on acid-free paper

Foreword Program transformation is a very powerful methodology for the development of correct and efficient programs. In applying this methodology one usually assumes that an initial program version (or a program specification) is given and it is required to derive a new program (or an implementation of the given specification). Since program specifications are often given as formulas in a logical theory, it is particularly important to study the transformation methodology in the case of logic programming. The field of program derivation by transformation is very closely related to the field of program synthesis. In these fields, in fact, similar techniques of formula manipulation are used. For this reason it is appropriate to study the techniques for Logic Program Synthesis and Transformation as a single set of related methodologies. This is the aim of the LoPSTr workshops. During the past years, these workshops have been very fruitful and stimulating. Their success also shows the importance and the relevance of the synthesis and transformation of logic programs within the area of theoretical computer science and its practical applications. Other areas of artificial intelligence and programming methodologies are connected to logic program synthesis and transformation. Papers from these areas have been presented and discussed in previous LoPSTr workshops and in LoP- STr'95 as well. Among these areas I would like to mention: i) Constructive type theory, by which one may synthesize programs from a constructive proof of the existence of an element of a given type, ii) Inductive logic programming, which studies the problem of synthesizing logic programs from examples and counterexamples, iii) Abstract interpretation and program analysis, which aims at proving properties of programs by interpreting the concrete operations of the programs in some given abstract domains, iv) Partial evaluation (or partial deduction), by which one derives new and more efficient programs by exploiting some information on the values of the input variables, and v) Theorem proving, which studies the different techniques of making proofs within various logical theories. Now I would like to list some desirable properties of the derivation steps which support the development of logic programs. These properties should be taken into account when designing a system for logic program synthesis and/or transformation. I will list those properties with reference to the program transformation process, but I think that they are of great importance also in the case of program synthesis. 1. First of all, it is desirable that every derivation step be constructive, that is, program Pi+l should be derived from program Pi by the application of a constructive transformation rule. I will not formally specify here the notion of constructive rule. It will be enough to say that rewriting rules of the kind one uses in rewriting systems, that is, rules which are based on: i) syntactic matching, and ii) rewriting of old expressions by new expressions, are

VI constructive. Thus, for instance, the usual schema-based program transformation rules are considered to be constructive. By contrast, non-constructive rules are, for instance, those whose application needs the solution of a problem which is undecidable. 2. Some derivation steps can be lemmatic. The meaning of this property is that when performing transformation steps, we allow ourselves to use lemmas, and these lemmas can be proved off-line (possibly, by taking advantage of some ad hoc theorem provers). This feature of the program derivation process is of major importance, because it is often the case that only by the use of lemmas can one derive very efficient programs. Indeed, for instance, linear running time algorithms for the evaluation of linear recurrence relations can be derived from given exponential running time algorithms, only if the functionality of some relevant predicates is proved. 3. Some derivation steps should allow substitutivity. The meaning of this property is that when a subformula, say 9, of a given program, say P~, is shown (using i0rogram Pi) to be equivalent to a formula r then we may get a new program Pi+l by replacing ~ by r within Pi. This substitution should preserve the semantics of Pi, and it is performed for changing the behaviour of Pi so that, for instance, the computations evoked by Pi+l are more efficient than those evoked by Pi. (Here we assume that new programs are derived from old programs with the aim of improving efficiency.) Notice also that, although the equivalence of ~ and r is derived from Pi, the replacement of ~ by r within Pi may change the semantics of Pi. For instance, from the simple formula (or program) a ~-* b, obviously one may derive the equivalence a ~ b. Thus, by replacing within a ~ b the expression b by the equivalent expression a, we get the new program a ~ a which is not equivalent to the original program. Finally, the reader should notice that constructive, lemmatic, and substitutive derivation steps allow for machine assistance. This is important, in particular, when the size of the programs to be derived becomes considerably large, and indeed, such mechanization makes it possible to propose the derivation methodology as a valuable technique for real-life programming. l~me January 1996 Alberto Pettorossi

Preface This volume contains the 19 papers presented at the Fifth International Workshop on Logic Program Synthesis and Transformation, LoPSTr'95, held near Utrecht (The Netherlands), September 20-22, 1995. Previous LoPSTr workshops were held in Manchester, U.K. (1991 and 1992), Louvain-la-Neuve, Belgium (1993), and Pisa, Italy (1994). The aim of the LoPSTr workshops is to stimulate new ideas and research in the field of machine-assisted development of logic programs. The main topics of interest are: program synthesis, program transformation, and program specialization. The papers presented at LoPSTr'95 give an up-to-date overview of the current research on these topics, as well as related topics in the field of program development, such as: automated deduction, constructive type theory, implementation techniques, inductive logic programming, meta-languages, program analysis, program specification, program verification, and software engineering. LoPSTr'95 was organized in parallel with PLILP'95 (Seventh Symposium on Programming Languages: Implementations, Logics, and Programs). The overall attendance at the two meetings was about 110 people from 21 countries. Out of 40 submissions, the Program Committee selected 19 papers for presentation. After the workshop, 17 papers were submitted in their revised versions which took into account the discussion at the workshop and the comments by the referees. These papers underwent a second refereeing process and they were further revised. The two remaining presentations are recorded in these proceedings as abstracts. Most submissions, the referee reports, and the discussion among the members of the Program Committee were done by electronic mail. Several hundred electronic mail messages concerning LoPSTr'95 have been delivered to my mailbox. LoPSTr'95 and PLILP'95 shared three invited lectures which were given by Mark Jones (Nottingham, U.K.), Oege de Moor (Oxford, U.K.), and Kim Marriott (Melbourne, Australia). The papers presented by the invited lecturers appear in the PLILP'95 proceedings (Lecture Notes in Computer Science, Vol. 982, Springer-Verlag). I would hike to thank all those who contributed to making LoPSTr'95 a successful and fruitful event. In particular, my gratitude goes to the researchers who submitted the papers, the referees, the members of the Program Committee, and the various agencies which provided financial support. Special thanks go to Prof. Doaitse Swierstra and his colleagues of Utrecht University for their invaluable work which allowed the workshop to run very smoothly and in a pleasant environment. I also would like to thank Alberto Pettorossi for his continuous advice and help. Finally, I would like to give my warmest thanks to all participants who contributed, by means of lively discussions, to making LoPSTr'95 a very stimulating event. Rome January 1996 Maurizio Proietti

viii Program Committee A. Bossi D. Boulanger S. Debray Y. Deville L. Fribourg N. Fuchs J. Gallagher T. Mogensen M. Proietti It. Seki P, Tarau G. Wiggins (Universits della Calabria, Rende, Italy) (Katholieke Universiteit Leuven, Belgium) (University of Arizona, Tucson, USA) (Universit@ Catholique de Louvain, Belgium) (LIENS-CNRS, Paris, France) (University of Zurich, Switzerland) (University of Bristol, U.K.) (University of Copenhagen, Denmark) (IASI-CNR, Roma, Italy, chair) (NIT, Nagoya, Japan) (University of Moncton, Canada) (University of Edinburgh, U.K.) Organizing Committee Jeroen Fokker, Erik Meijer, Margje Punt, Doaitse Swierstra Sponsors (of LoPSTr'95 and PLILP'95) European Commission - ESPRIT Basic Research (CompuLog-Net) Royal Dutch Academy of Sciences (KNAW) The Netherlands Computer Science Research Foundation (SION) The Association of Logic Programming IASI-CNR (National Research Council of Italy) Universiteit Utrecht List of Referees The following people helped the Program Committee in refereeing the papers submitted to LoPSTr'95: Michel Bidoit, Michele Bugliesi, Nicoletta Cocco, Livio Colussi, Sandro Etalle, Gilberto Fil@, Robert Gliick, Neil Jones, Vincent Lombart, Tadashi Kawamura, Alberto Pettorossi, Jakob Rehof, Taisuke Sato, Morten Heine Sorensen, Wamberto Vasconcelos.

Table of Contents Ecological Partial Deduction: Preserving Characteristic Trees Without Constraints... 1 Michael Leuschel Memoing Evaluation by Source-to-Source Transformation... 17 Jens E. Wunderwald Transformation of Left Terminating Programs: The Reordering Problem... 33 Annalisa Bossi, Nicoletta Cocco, and Sandro Etalle Derivation of Concurrent Algorithms in Tempo... 46 Steve Gregory An Argumentation-Theoretic Approach to Logic Program Transformation... 61 Francesca Toni and Robert A. Kowalski Complexity of Horn Programs... 76 Erik Aarts Studying the Cost of Logic Languages in an Abstract Interpretation Framework for Granularity Analysis... 91 M.M. Gallardo and J.M. Troya Towards Automatic Control for CLP(x) Programs... 106 Fred Mesnard Ideal Refinement of Datalog Programs... 120 Giovanni Semeraro, Floriana Esposito, and Donato Malerba Guiding Program Development Systems by a Connection Based Proof Strategy... 137 Cristoph I(reitz, Jens Otten, and Stephan Schmitt Towards an Object-Oriented Methodology for Deductive Synthesis of Logic Programs... 152 Kung-Kiu Lau and Mario Ornaghi Logic Program Synthesis by Induction over Horn Clauses... 170 Andrew J. Parkes and Geraint A. Wiggins Logic Program Transformation Through Generalization Schemata... 171 Pierre Flener and Yves Deville

An Opportunistic Approach for Logic Program Analysis and Optimisation Using Enhanced Schema-Based Transformations... 174 Wamberto W. Vasconcelos and Norberr E. Fuchs Solving Deductive Planning Problems Using Program AnMysis and Transformation... 189 D.A. de Waal and M. Thielscher Towards a Complete Proof Procedure to Prove Properties of Normal Logic Programs Under the Completion... 204 Sophie Renault Termination of Logic Programs Using Semantic Unification... 219 Thomas Arts and Hans Zantema On the Mechanics of Metasystem Hierarchies in Program Transformation... 234 Robert Gliick Efficient Translation of Lazy Functional Logic Programs into Prolog... 252 Michael Hanus Author Index... 267