ebook img

Implementation and Application of Functional Languages: 20th International Symposium, IFL 2008, Hatfield, UK, September 10-12, 2008. Revised Selected Papers PDF

300 Pages·2011·3.197 MB·
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Implementation and Application of Functional Languages: 20th International Symposium, IFL 2008, Hatfield, UK, September 10-12, 2008. Revised Selected Papers

Lecture Notes in Computer Science 5836 CommencedPublicationin1973 FoundingandFormerSeriesEditors: GerhardGoos,JurisHartmanis,andJanvanLeeuwen EditorialBoard DavidHutchison LancasterUniversity,UK TakeoKanade CarnegieMellonUniversity,Pittsburgh,PA,USA JosefKittler UniversityofSurrey,Guildford,UK JonM.Kleinberg CornellUniversity,Ithaca,NY,USA AlfredKobsa UniversityofCalifornia,Irvine,CA,USA FriedemannMattern ETHZurich,Switzerland JohnC.Mitchell StanfordUniversity,CA,USA MoniNaor WeizmannInstituteofScience,Rehovot,Israel OscarNierstrasz UniversityofBern,Switzerland C.PanduRangan IndianInstituteofTechnology,Madras,India BernhardSteffen TUDortmundUniversity,Germany MadhuSudan MicrosoftResearch,Cambridge,MA,USA DemetriTerzopoulos UniversityofCalifornia,LosAngeles,CA,USA DougTygar UniversityofCalifornia,Berkeley,CA,USA GerhardWeikum MaxPlanckInstituteforInformatics,Saarbruecken,Germany Sven-Bodo Scholz Olaf Chitil (Eds.) Implementation and Application of Functional Languages 20th International Symposium, IFL 2008 Hatfield, UK, September 10-12, 2008 Revised Selected Papers 1 3 VolumeEditors Sven-BodoScholz UniversityofHertfordshire DepartmentofComputerScience Hatfield,AL109AB,UK E-mail:[email protected] OlafChitil UniversityofKent SchoolofComputing Kent,CT27NF,UK E-mail:[email protected] ISSN0302-9743 e-ISSN1611-3349 ISBN978-3-642-24451-3 e-ISBN978-3-642-24452-0 DOI10.1007/978-3-642-24452-0 SpringerHeidelbergDordrechtLondonNewYork LibraryofCongressControlNumber:2011937065 CRSubjectClassification(1998):F.3,D.3,D.2,F.4.1,D.1,D.2.4 LNCSSublibrary:SL1–TheoreticalComputerScienceandGeneralIssues ©Springer-VerlagBerlinHeidelberg2011 Thisworkissubjecttocopyright.Allrightsarereserved,whetherthewholeorpartofthematerialis concerned,specificallytherightsoftranslation,reprinting,re-useofillustrations,recitation,broadcasting, reproductiononmicrofilmsorinanyotherway,andstorageindatabanks.Duplicationofthispublication orpartsthereofispermittedonlyundertheprovisionsoftheGermanCopyrightLawofSeptember9,1965, initscurrentversion,andpermissionforusemustalwaysbeobtainedfromSpringer.Violationsareliable toprosecutionundertheGermanCopyrightLaw. Theuseofgeneraldescriptivenames,registerednames,trademarks,etc.inthispublicationdoesnotimply, evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfromtherelevantprotectivelaws andregulationsandthereforefreeforgeneraluse. Typesetting:Camera-readybyauthor,dataconversionbyScientificPublishingServices,Chennai,India Printedonacid-freepaper SpringerispartofSpringerScience+BusinessMedia(www.springer.com) Preface This volume presents revised and selected papers from the 20th International Symposium on Implementation and Application of Functional Languages (IFL 2008). Following the tradition of the IFL symposia, the papers presented here have been selected from revised versions of the 31 papers that were presented at the event which was organized by the Compiler Technology Group of the University of Hertfordshire in Hatfield, UK. In its 20-year-old tradition, IFL has been held at various places throughout Europe including The Netherlands, UK, Germany, Sweden, Spain, Ireland and Hungary. The symposium brings together researchers actively engaged in the implementation and application of functional and function-based programming languages. It provides an open forum for researchers who wish to present and discussnewideasandconcepts,workinprogress,preliminaryresults,etc.related primarilybutnotexclusivelytotheimplementationandapplicationoffunctional languages. Topics of interest cover a wide range, from novel language designs, theoretical underpinnings, compilation and optimization techniques for diverse hardwarearchitectures,toapplications,programmingtechniquesandnoveltools. IFL2008had58participantsincludingresearchersfromoutsideEuropesuch asfromtheUSAandCanada.Thepresentationscoveredawiderangeofaspects and we believe that the present volume gives a good impression of that range. Although mainly intended for the participants, preprint versions of all presen- tations are available as a technical report from the University of Hertfordshire (TR 474). ThisvolumestartswithRalfHinze’spaperonMoessner’sTheorem.Itscom- pellinguseofatheoryofscansandconvolutionsenablesaniceandconciseproof of that theorem, showing how a programming language perspective can help mathematical reasoning. The paper’s beauty has gained the author the Peter LandinPrize,whichisawardedtothebestpaperofeachyear’sIFLsymposium. Thesubsequentthreepapersfocusonnovelwaysforimplementingdeclarative languages:BerndBraßelandSebastianFischerproposeanovelwayformapping functionallogicprogramstopurelyfunctionalprogramswhichpreserveslaziness. Ian Mackie suggests interaction nets as an implementation vehicle for closed reductionsthatpromisessubstantialperformanceimprovements.ClemensGrelck andFrankPenczekintroduceastreaming-basedcoordinationlanguagenamedS- Netanddescribe anavenueforits effectiveimplementation.Thesemoreholistic papers are followed by papers that aim at improving individual aspects of the implementation of functional languages. Nils Anders Danielsson and Ulf Norell present a surprisingly simple approach to parsing mixfix operator expressions which they have implemented for Agda. Kai Trojahner and Clemens Grelck presentanoptimizationforthecompilationofprogramsthatoperategenerically on n-dimensional arrays.They found an elegant way to use dependent types to VI Preface getridofarraydescriptorsatruntime.OlhaShkaravska,MarcovanEekelenand Alejandro Tamalet stretch the boundaries of type-based analyses to determine the possible relations between the sizes of input and output lists of functions. In the remaining papers, the focus shifts from language implementation as- pects toward the application of functional languages. At the boundary between implementationsandapplication,wehavepapersonembeddedlanguages.George Giorgidze and Henrik Nilsson expose nicely how Template Haskell can be used to embed functional hybrid modelling. Joel Svensson, Mary Sheeran and Koen Claessen introduce Obsedian, an embedded DSL for unleashing the power of graphics cards in a high-level way. Yan Wang and Vero´nica Gaspes show how the data description calculus can be embedded into Haskell in order to better support short-lived data formats. ThenexttwopapersareconcernedwithiTasks,acombinatorlibraryinClean thatenablesrapiddevelopmentofWeb-basedmulti-userwork-flowsystems.The first paper,authored by Jan Martin Jansen,Rinus Plasmeijer and Pieter Koop- man, proposes a seamless extension of iTasks that enables advanced forms of user-interaction through plug-in technology. The second paper is authored by Jan Martin Jansen, Rinus Plasmeijer and Pieter Koopman. It tries to capture thebehaviorofiTasksinahigh-levelsemanticsfacilitatingformalreasoningand testing of such systems. MauroJaskelioff’spaperonmonadtransformerlibrariesidentifies shortcom- ings of the existing monad transformer libraries and proposes an improved ap- proach that substantially simplifies the way several effects can be combined. David Teller, Arnaud Spiwack and Till Varoquaux suggest a neat way of im- provingexceptionhandlinginOCamlwithoutrequiringadditionalnewlanguage features. This paper demonstrates nicely how advanced language features such aspolymorphicvariantscanbe harnessedtocreateintriguingnew functionality. The final paper,in a way constitutes the most appliedcontribution. The au- thors,BasLijnseandRinusPlasmeijer,trytoinvestigatenovelwaysofbridging between databases and functional programming languages. Their key idea is to start from an abstractionlayer on top of databases and then to map the opera- tionsonthatleveldowntogenericallydefinedboiler-platecodethatimplements therequiredfunctionalitiesonthedatabaseaswellasonthecorrespondingdata structures. We hope thatthe currentvolume will not only providethe readerwith some fascinating new ideas on how to implement or use declarative programming languages,butwillalsoencouragereaderstoparticipateinfutureIFLsymposia. August 2009 Sven-Bodo Scholz Olaf Chitil Organization Program Committee Umut Acar Toyota Technological Institute USA Kenichi Asai Ochanomizu University Japan Lennart Augustsson Credit Suisse UK Olaf Chitil University of kent UK Koen Claessen Chalmers University of Technology Sweden Marko van Eekelen Radboud University Nijmegen The Netherlands Martin Erwig OregonState University USA Andy Gill University of Kansas USA Neal Glew Intel Research USA Clemens Grelck University of Lu¨beck Germany Jurriaan Hage Utrecht University The Netherlands Fr´ed´eric Loulergue University of Orl´eans France Greg Michaelson Heriot-Watt University UK Zolt´an Horva´th Eo¨tvo¨s Lora´nd University Hungary Frank Huch University of Kiel Germany Rinus Plasmeijer Radboud University Nijmegen The Netherlands Sven-Bodo Scholz University of Hertfordshire UK (Chair) Martin Sulzmann IT University of Copenhagen Denmark Additional Reviewers Tim Bauer Pieter Koopman Joel Svensson Bernd Braßel Leonard Lensink Wouter Swierstra Wonsoek Chae Mo´nica Ma´sz´aros Mt Tejfel Chris Chambers Michal Palka Kai Trojahner Jan Christiansen Frank Penczek Bernard van Gastel Gergely Devai Leaf Petersen John van Groningen Peter Divianszky Daniel Rolls Eric Walkingshaw Sebastian Fischer Olha Shkaravska Viktoria Zsok Local Organization Jing Guo Frank Penczek Jeyan Thiyagalingam Carl Joslin Daniel Rolls Stephan Herhut Sven-Bodo Scholz Table of Contents Scans and Convolutions—A Calculational Proof of Moessner’s Theorem........................................................ 1 Ralf Hinze From Functional Logic Programs to Purely Functional Programs Preserving Laziness .............................................. 25 Bernd Braßel and Sebastian Fischer An Interaction Net Implementation of Closed Reduction .............. 43 Ian Mackie Implementation Architecture and Multithreaded Runtime System of S-Net.......................................................... 60 Clemens Grelck and Frank Penczek Parsing Mixfix Operators ......................................... 80 Nils Anders Danielsson and Ulf Norell Descriptor-Free Representation of Arrays with Dependent Types....... 100 Kai Trojahner and Clemens Grelck Collected Size Semantics for Functional Programsover Lists........... 118 Olha Shkaravska, Marko van Eekelen, and Alejandro Tamalet Embedding a Functional Hybrid Modelling Language in Haskell........ 138 George Giorgidze and Henrik Nilsson Obsidian: A Domain Specific Embedded Language for Parallel Programming of Graphics Processors ............................... 156 Joel Svensson, Mary Sheeran, and Koen Claessen A Library for Processing Ad Hoc Data in Haskell: Embedding a Data Description Language ............................................ 174 Yan Wang and Ver´onica Gaspes iEditors: Extending iTask with Interactive Plug-ins.................... 192 Jan Martin Jansen, Rinus Plasmeijer, and Pieter Koopman An Executable and Testable Semantics for iTasks .................... 212 Pieter Koopman, Rinus Plasmeijer, and Peter Achten Monatron: An Extensible Monad Transformer Library ................ 233 Mauro Jaskelioff X Table of Contents CatchMeIfYouCan:LookingforType-Safe,Hierarchical,Lightweight, Polymorphic and Efficient Error Management in OCaml .............. 249 David Teller, Arnaud Spiwack, and Till Varoquaux BetweenTypesandTables:UsingGenericProgrammingforAutomated Mapping between Data Types and Relational Databases .............. 272 Bas Lijnse and Rinus Plasmeijer Author Index.................................................. 291 Scans and Convolutions— A Calculational Proof of Moessner’s Theorem Ralf Hinze Computing Laboratory, University of Oxford Wolfson Building, Parks Road,Oxford, OX13QD, England [email protected] http://www.comlab.ox.ac.uk/ralf.hinze/ Abstract. The paper introduces two corecursion schemes for stream- generatingfunctions,scansandconvolutions,anddiscussestheirproper- ties.Asanapplicationoftheframework,acalculationalproofofPaasche’s generalisation of Moessner’s intriguing theorem is presented. 1 Introduction Inthe1950sAlfredMoessnerdiscoveredthefollowingintriguingschemeforgen- eratingthenaturalkthpowers[1]:Fromthesequenceofnaturalnumbers,delete everykthnumber andformthe sequence ofpartialsums.Fromthe resultingse- quence,delete every (k−1)-stnumber and formagainthe partialsums. Repeat this step k−1 times. Thesecondsimplestinstanceoftheprocessyieldsthesquaresbysummingup the odd numbers. (Of course if we repeat the transformation 0 times, we obtain the 1st powers of the naturals.) 1 2/ 3 4/ 5 6/ 7 8/ ... 1 4 9 16 ... For generating the cubes we perform two deletion-and-summation steps. 1 2 3/ 4 5 6/ 7 8 9/ 10 11 (cid:2)1(cid:2)2 ... 1 3/ 7 (cid:2)1(cid:2)2 19 (cid:2)2(cid:2)7 37 (cid:2)4(cid:2)8 ... 1 8 27 64 ... Thesecondsequenceisprobablyunfamiliar—thenumbersarethe“three-quarter squares” (A0770431)—but the final sequence is the desired sequence of cubes. Actually, it is not surprising that we get near the kth powers by repeated summations.Ifweomitthedeletions,weobtainthecolumnsofPascal’striangle, the binomial coefficients, which are related to the falling factorial powers [3]. 1 2 3 4 5 ... 1 3 6 10 15 ... 1 4 10 20 35 ... 1 5 15 35 70 ... 1 MostsequencesdefinedinthispaperarerecordedinSloane’sOn-LineEncyclopedia ofIntegerSequences[2].KeysoftheformAnnnnnnrefertoentriesinthatdatabase. S.-B.ScholzandO.Chitil(Eds.):IFL2008,LNCS5836,pp.1–24,2011. (cid:2)c Springer-VerlagBerlinHeidelberg2011

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.