C I N (cid:1)(cid:2)(cid:3)(cid:4)(cid:5)(cid:6)(cid:2)(cid:4)(cid:5)(cid:7)(cid:8)(cid:9)(cid:10)(cid:11)(cid:4)(cid:4)(cid:5)(cid:12)(cid:4)(cid:13)(cid:14)(cid:15)(cid:14)(cid:9)(cid:14)(cid:8)(cid:5)(cid:16)(cid:2)(cid:17)(cid:5)(cid:18)(cid:2)(cid:10)(cid:19)(cid:9)(cid:14)(cid:15)(cid:4)(cid:20) s e g a Publication Series of the u Jörg Striegnitz, Kei Davis, g John von Neumann Institute for Computing (NIC) n a Yannis Smaragdakis (Eds.) L d The John von Neumann Institute for Computing was established in 1998 e t by the Research Centre Jülich and the German Electron Synchrotron n e Foundation DESY in order to support supercomputer-aided scientific and ri Multiparadigm O engineering research and development in Germany with the following tasks: - t c Programming with e j • Nationwide provision of supercomputer capacity for projects in science, b O Object-Oriented Languages research, and industry. h t i w • Supercomputer-oriented research and development by research groups g n of competence in supercomputing applications. i m m • Education and training in the fields of supercomputing by symposia, a r g workshops, summer schools, seminars, and courses. o r P m g i d a r a p i t l u M s ki a d g a r a m S Y. s, vi a D K. z, Proceedings Deutsches nit Forschungszentrum Jülich g e Elektronen-Synchrotron ri in der Helmholtz-Gemeinschaft St J. NIC Series Volume 13 ISBN 3-00-009099-1 13 Central Institute for Applied Mathematics Publication Series of the John von Neumann Institute for Computing (NIC) NICSeries Volume13 John von Neumann Institute for Computing (NIC) Jo¤rg Striegnitz, Kei Davis, Yannis Smaragdakis (Eds.) Multiparadigm Programming with Object-Oriented Languages (MPOOL) 2nd International Workshop, 11 June 2002 Malaga, Spain Proceedings organizedby JohnvonNeumannInstituteforComputing incooperationwith LosAlamosNationalLaboratory,NewMexico,USA GeorgiaInstituteofTechnology,Georgia,USA NIC Series Volume13 ISBN3-00-009099-1 Die Deutsche Bibliothek (cid:150) CIP-Cataloguing-in-Publication-Data A catalogue record for this publication is available from Die Deutsche Bibliothek. Publisher: NIC-Directors Distributor: NIC-Secretariat Research Centre Ju¤lich 52425 Ju¤lich Germany Internet: www.fz-juelich.de/nic Printer: Graphische Betriebe, Forschungszentrum Ju¤lich (cid:13)c 2002 by John von Neumann Institute for Computing Permission to make digital or hard copies of portions of this work for personal or classroom use is granted provided that the copies arenotmadeordistributed forpro(cid:2)torcommercialadvantage and thatcopiesbearthisnoticeandthefullcitationonthe(cid:2)rstpage.To copy otherwise requires prior speci(cid:2)c permission by the publisher mentioned above. NIC Series Volume 13 ISBN 3-00-009099-1 Preface This volume contains the proceedings of the International Workshop on Multi- paradigm Programming(MPOOL’02),held in Malaga,Spain on June 11, 2002. Althoughtheideaofcombiningprogrammingparadigmsandlanguagesgoes backtothelatesixties,whenalotofresearche(cid:11)ortwasspentonthedevelopment and investigation of extensible programming languages, this approach has lost neither its importance, nor its elegance. Programming languages and paradigms are thought models. Their distin- guishing concepts have a great in(cid:13)uence on how programmers approach the di(cid:11)erent stages of the software development process. With respect to software quality,itisthereforedesirabletolettheproblemdomaindeterminethechoiceof the programmingparadigm. Especially for largersoftware projects, this implies the need for languages and tools that support the simultaneous use of di(cid:11)erent programmingparadigms. Today the object oriented programming paradigm is dominant and ubiqui- tously employed for design, implementation and even conceptualization and a huge set of tools has been developed and successfully applied over the last two decades.MPOOLtriestobringtogetherpeoplewhoaretryingtobuildabridge from OO-centered tools to a toolset that permits free choice of paradigms. Lastyear’sMPOOLgaveevidencethatthereexistsalargercommunitywork- ing in this emerging area. The extended diversity of topics of this year’s work- shop shows that there is an ongoing advance in programming languages, tools, concepts and methodologies to support multiparadigm programming. One of the main goals of the workshop (and the reason of publishing this proceedingsvolume)istopromoteandexposeworkthatcombinesprogramming paradigms in the framework of OO languages. Building a consensus about the standard background work, the interesting problems, and the future directions is the way to form a community. Acknowledgment. We wish to heartily thank all the authors for writing very interesting papers and all the members of the Programme Committee for their invaluable help in compiling the program. June 2002 Kei Davis Yannis Smaragdakis Jo(cid:127)rg Striegnitz Workshop Organizers Kei Davis, Los Alamos National Laboratories, New Mexico, USA Yannis Smaragdakis,Georgia Institute of Technology, Georgia, USA Jo(cid:127)rg Striegnitz, John von Neumann Institute for Computing, Germany Programme Committee Gerald Baumgartner, Ohio State University, Ohio, USA Kei Davis, Los Alamos National Laboratory,New Mexico, USA JaakkoJa(cid:127)rvi, Indiana University, Indiana, USA Peter Van Roy, Universite catholique de Louvain, Belgium Yannis Smaragdakis,Georgia Institute of Technology, Georgia, USA Jo(cid:127)rg Striegnitz, John von Neumann Institute for Computing, Germany Table of Contents Object Programmingin a Rule-Based Language with Strategies:::::::::: 1 Hubert Dubois, H(cid:19)el(cid:18)ene Kirchner Modelica - A Declarative Object Oriented Multi-Paradigm Language.::::: 27 Peter Fritzson, Peter Bunus The Return of Jensen’s Device::::::::::::::::::::::::::::::::::::::: 45 Timothy A. Budd TowardsLinguisticSymbiosisofanObject-OrientedandaLogicProgram- ming Language :::::::::::::::::::::::::::::::::::::::::::::::::::: 65 Johan Brichau, Kris Gybels, Roel Wuyts Replacing Re(cid:12)nement or Re(cid:12)ning Replacement? ::::::::::::::::::::::: 79 Sibylle Schupp Java-Style Variable Binding in C++:::::::::::::::::::::::::::::::::: 97 Thomas Becker Dynamic Inheritance for a Prototype-basedLanguage :::::::::::::::::: 109 Koji Kagawa A case in Multiparadigm Programming : User Interfaces by means of Declarative Meta Programming ::::::::::::::::::::::::::::::::::::: 121 S. Goderis, W. De Meuter, J. Brichau iv Object Programming in a Rule-Based Language with Strategies Hubert Dubois, H(cid:19)el(cid:18)ene Kirchner LORIA-Universit(cid:19)eNancy2 & LORIA-CNRS BP 239 54506 Vand(cid:27)uvre-l(cid:18)es-NancyCedex, France fHubert.Dubois|[email protected] Abstract. This paper presents a programming framework that com- bines the concepts of objects, rules and strategies, builtas an extension oftherule-basedlanguagewithstrategiesELAN.Thisextensionisimple- mented in a re(cid:13)ective way in ELAN itself and relies on the same formal semantics, namely the (cid:26)-calculus. 1 Introduction Object-based languages and rule-based languages have independently emerged asprogrammingparadigmsintheeighties.LanguageslikeAda[Ros92],Smalltalk- 80 [GR83], Ei(cid:11)el [Mey92] or Java [AG96] are well-known and largely used but often lackof semanticalbasis.Rule-based systems,initiallyused in the arti(cid:12)cial intelligence community, have gained interest with the development of e(cid:14)cient compilers. The ELAN system [BCD+00] providesa verygeneralapproachto rule-based programming. ELAN o(cid:11)ers an environment for specifying and prototyping de- duction systemsin a languagebased on rewriterulescontrolled bystrategies. It gives a natural and simple logical framework for the combination of computa- tion and deduction paradigms. It supports the design of theorem provers, logic programminglanguages,constraint solversand decision procedures and o(cid:11)ers a modularframeworkforstudyingtheircombination.ELANhasaclearoperational semantics based on rewriting logic [BKKR01] and on rewriting calculus [Cir00]. Its implementation involves compiled matching and reduction techniques inte- gratingassociativeandcommutativefunctions.Nondeterministiccomputations returnseveralresultswhoseenumerationishandledthankstoafewconstructors of choicestrategies.Astrategylanguageisavailabletocontrolrewriting.Evalu- ationofstrategiesandstrategyapplicationisagainbasedonrewriting.However, ELAN lack object oriented features, the notion of states, which provides more structuration, and the ability to de(cid:12)ne structures sharing the same properties. Morerecently,thecombinationofobject-basedlanguagesandrule-basedlan- guageshasprovedtobequiterelevanttoformalizeandsolveadvancedindustrial problemsthatrequiresomeformofreasoning.Amongmanyotherlanguages,let usmentionthreeofthem, morecloselyrelatedtoourapproach:CLAIRE[CL96], Oz [HSW95] and Maude [CDE+00]. 1