Lecture Notes in Computer Science 3819 CommencedPublicationin1973 FoundingandFormerSeriesEditors: GerhardGoos,JurisHartmanis,andJanvanLeeuwen EditorialBoard DavidHutchison LancasterUniversity,UK TakeoKanade CarnegieMellonUniversity,Pittsburgh,PA,USA JosefKittler UniversityofSurrey,Guildford,UK JonM.Kleinberg CornellUniversity,Ithaca,NY,USA FriedemannMattern ETHZurich,Switzerland JohnC.Mitchell StanfordUniversity,CA,USA MoniNaor WeizmannInstituteofScience,Rehovot,Israel OscarNierstrasz UniversityofBern,Switzerland C.PanduRangan IndianInstituteofTechnology,Madras,India BernhardSteffen UniversityofDortmund,Germany MadhuSudan MassachusettsInstituteofTechnology,MA,USA DemetriTerzopoulos NewYorkUniversity,NY,USA DougTygar UniversityofCalifornia,Berkeley,CA,USA MosheY.Vardi RiceUniversity,Houston,TX,USA GerhardWeikum Max-PlanckInstituteofComputerScience,Saarbruecken,Germany Pascal Van Hentenryck (Ed.) Practical Aspects of Declarative Languages 8th International Symposium, PADL 2006 Charleston, SC, USA, January 9-10, 2006 Proceedings 1 3 VolumeEditor PascalVanHentenryck BrownUniversity Dept.ofComputerScience P.O.Box1910,Providence,RI02912,USA E-mail:[email protected] LibraryofCongressControlNumber:2005937161 CRSubjectClassification(1998):D.3,D.1,F.3,D.2 LNCSSublibrary:SL2–ProgrammingandSoftwareEngineering ISSN 0302-9743 ISBN-10 3-540-30947-0SpringerBerlinHeidelbergNewYork ISBN-13 978-3-540-30947-5SpringerBerlinHeidelbergNewYork Thisworkissubjecttocopyright.Allrightsarereserved,whetherthewholeorpartofthematerialis concerned,specificallytherightsoftranslation,reprinting,re-useofillustrations,recitation,broadcasting, reproductiononmicrofilmsorinanyotherway,andstorageindatabanks.Duplicationofthispublication orpartsthereofispermittedonlyundertheprovisionsoftheGermanCopyrightLawofSeptember9,1965, initscurrentversion,andpermissionforusemustalwaysbeobtainedfromSpringer.Violationsareliable toprosecutionundertheGermanCopyrightLaw. SpringerisapartofSpringerScience+BusinessMedia springer.com ©Springer-VerlagBerlinHeidelberg2006 PrintedinGermany Typesetting:Camera-readybyauthor,dataconversionbyScientificPublishingServices,Chennai,India Printedonacid-freepaper SPIN:11603023 06/3142 543210 Preface This volume contains the papers presented at the Eighth International Sym- posium on Practical Aspects of Declarative Languages (PADL 2006) held on January 9-10, 2006, in Charleston, South Carolina. Information about the con- ferencecanbefoundathttp://www.cs.brown.edu/people/pvh/PADL06.html. As is now traditional, PADL 2006 was co-located with the 33rd Annual Sympo- sium on Principles of Programming Languages that was held on January 11-13, 2006. The PADL conference series is a forum for researchers and practioners to present original work emphasizing novel applications and implementation tech- niques for all forms of declarative concepts. Topics of interest include, but are not limited to: – Innovative applications of declarative languages; – Declarative domain-specific languages and applications; – Practical applications of theoretical results; – New language developments and their impact on applications; – Evaluation of implementation techniques on practical applications; – Novel implementation techniques relevant to applications; – Novel uses of declarative languages in the classroom; – Practical experiences. This year, there were 36 submissions. Each submission was reviewed by at least three Programme Committee members. The committee decided to accept 15 papers. In addition, the programme also included three invited talks by Erik Meijer, David Roundy, and Philip Walder. I would like to thank the Program Committee members who worked hard to producehigh-qualityreviewsforthepapers,aswellasallthereviewersinvolved in the paper selection. It was a great pleasure to work with all of you. I also would like to thank Gopal Gupta for his availability and his expert advice in manyaspectsoftheconference.Wewerealsoluckytoattractthreeoutstanding invited speakers and I would like to take this opportunity to thank them again foracceptingourinvitation.Finally,thankstoAndreiVoronkovforhishelpwith the EasyChair system that automates so many of the tedious tasks involved in chairing a conference. October 2005 Pascal Van Hentenryck Organization Chairs Gopal Gupta General Chair Department of Computer Science University of Texas at Dallas Dallas, TX, USA Email: [email protected] Pascal Van Hentenryck Programme Chair Department of Computer Science Brown University Providence, RI, USA Email: [email protected] Programme Committee Kenichi Asai Daniel Damian Mireille Ducasse Matthew Flatt Gopal Gupta Manuel Hermenegildo Paul Hudak Narendra Jussien Laurent Michel Gopalan Nadathur Enrico Pontelli Peter Van Roy Vitor Santos-Costa Christian Schulte Peter Stuckey David S. Warren Roland Yap Additional Reviewers Ajay Bansal Ralph Becket VIII Organization Nicolas Beldiceanu Stefano Bistarelli Francisco Bueno Daniel Cabeza Hadrien Cambazard Manuel Carro Mike Codish Raphael Collet Jesus Correas Tristan Denmat Wlodek Drabent Greg Duck Ines Dutra Kevin Glynn Yves Jaradin Srividya Kona Ricardo Lopes Ajay Mallya Boriss Mejias Jose Morales Yoann Padioleau Luis Quesada Emad Saad Benjamin Sigonneau Luke Simon Tran Cao Son Fred Spiessens Qian Wang Table of Contents Using CHRs to Generate Functional Test Cases for the Java Card Virtual Machine Sandrine-Dominique Gouraud, Arnaud Gotlieb .................... 1 Generic Cut Actions for External Prolog Predicates Tiago Soares, Ricardo Rocha, Michel Ferreira ..................... 16 Controlling Search Space Materialization in a Practical Declarative Debugger Ian MacLarty, Zoltan Somogyi .................................. 31 Automatic Verification of a Model Checker by Reflection Bow-Yaw Wang ............................................... 45 Probabilistic-Logical Modeling of Music Jon Sneyers, Joost Vennekens, Danny De Schreye ................. 60 Using Dominators for Solving Constrained Path Problems Luis Quesada, Peter Van Roy, Yves Deville, Rapha¨el Collet................................................. 73 JQuery: A Generic Code Browser with a Declarative Configuration Language Kris De Volder ................................................ 88 A Hybrid BDD and SAT Finite Domain Constraint Solver Peter Hawkins, Peter J. Stuckey ................................. 103 Adding Constraint Solving to Mercury Ralph Becket, Maria Garcia de la Banda, Kim Marriott, Zoltan Somogyi, Peter J. Stuckey, Mark Wallace................... 118 Modeling Genome Evolution with a DSEL for Probabilistic Programming Martin Erwig, Steve Kollmansberger ............................. 134 Tabling in Mercury: Design and Implementation Zoltan Somogyi, Konstantinos Sagonas ........................... 150 Translating Description Logic Queries to Prolog Zsolt Nagy, Gergely Luka´csy, P´eter Szeredi ....................... 168 X Table of Contents Efficient Top-Down Set-Sharing Analysis Using Cliques Jorge Navas, Francisco Bueno, Manuel Hermenegildo............... 183 Querying Complex Graphs Yanhong A. Liu, Scott D. Stoller ................................ 199 Incremental Evaluation of Tabled Prolog: Beyond Pure Logic Programs Diptikalyan Saha, C.R. Ramakrishnan ............................ 215 Author Index................................................... 231 Using CHRs to Generate Functional Test Cases (cid:1) for the Java Card Virtual Machine Sandrine-Dominique Gouraud and Arnaud Gotlieb IRISA/CNRSUMR 6074, Campus Universitaire deBeaulieu, 35042 RennesCedex, France Phone: +33 (0)2 99 84 75 76 – Fax:+33 (0) 2 99 84 71 71 [email protected], [email protected] Abstract. Automated functional testing consists in deriving test cases from the specification model of a program to detect faults within an implementation. In our work, we investigate using Constraint Handling Rules(CHRs)toautomatethetestcasesgenerationprocessoffunctional testing. Ourcase study is a formal model of theJava Card Virtual Ma- chine (JCVM) written in a sub-language of the Coq proof assistant. In this paper we define an automated translation from this formal model into CHRs and propose to generate test cases for each bytecode defini- tion of the JCVM. The originality of our approach resides in the use of CHRstofaithfullymodeltheformallyspecifiedoperationalsemanticsof the JCVM. The approach has been implemented in Eclipse Prolog and a full set of test cases have been generated for testing theJCVM. Keywords: CHR,Software testing, JavaCard VirtualMachine. 1 Introduction The increasing complexity of computer programs ensures that automated soft- ware testing will continue to play a prevalent role in softwarevalidation. In this context, automated functional testing consists in 1) generating test cases from a specification model, 2) executing an implementation using the generated test cases and then 3) checking the computed results with the help of an oracle. In automated functional testing, oracles are generated from the model to provide the expected results. Several models have been used to generate test cases: al- gebraic specifications [1], B machineries [2] or finite state machines [3], just to name a few. In our work, we investigate using Constraint Handling Rules (CHRs) to au- tomate the test cases and oracles generation process of functional testing. Our (cid:1) This work is supported bytheR´eseau National desTechnologies Logicielles as part of the CASTLES project (www-sop.inria.fr/everest/projects/castles/). This project aimsat definingacertification environmentfortheJavaCard platform.The projectinvolvestwoacademicpartners:theEverestandLandeteamsofINRIAand two industrial partners: OberthurCard Systemsand Alliance Qualit Logicielle. P.VanHentenryck(Ed.):PADL2006,LNCS3819,pp.1–15,2006. (cid:1)c Springer-VerlagBerlinHeidelberg2006