Elvira Albert (Ed.) Logic-Based 4 4 Program Synthesis 8 7 S C and Transformation N L 22nd International Symposium, LOPSTR 2012 Leuven, Belgium, September 2012 Revised Selected Papers 123 Lecture Notes in Computer Science 7844 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 Elvira Albert (Ed.) Logic-Based Program Synthesis and Transformation 22nd International Symposium, LOPSTR 2012 Leuven, Belgium, September 18-20, 2012 Revised Selected Papers 1 3 VolumeEditor ElviraAlbert ComplutenseUniversityofMadrid DepartmentofComputerScience(DSIC) SénecaAvenue2 28040Madrid,Spain E-mail:[email protected] ISSN0302-9743 e-ISSN1611-3349 ISBN978-3-642-38196-6 e-ISBN978-3-642-38197-3 DOI10.1007/978-3-642-38197-3 SpringerHeidelbergDordrechtLondonNewYork LibraryofCongressControlNumber:2013936976 CR Subject Classification (1998): D.1.6, D.2.4-5, F.4.1, G.2.2, F.3, I.2.2-4, D.3.1, F.1.1 LNCSSublibrary:SL1–TheoreticalComputerScienceandGeneralIssues ©Springer-VerlagBerlinHeidelberg2013 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 contains a selection of the papers presented at the 22nd International Symposium on Logic-Based Program Synthesis and Transforma- tion (LOPSTR 2012) held during September 18-20, 2012, in Leuven. LOPSTR 2012 was co-located with PPDP 2012, the 14th International ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming. PreviousLOPSTR symposia were held in Odense (2011),Hagenberg (2010), Coimbra (2009), Valencia (2008), Lyngby (2007), Venice (2006 and 1999), London(2005and2000),Verona(2004),Uppsala(2003),Madrid(2002),Paphos (2001), Manchester (1998, 1992, and 1991), Leuven (1997), Stockholm (1996), Arnhem (1995), Pisa (1994), and Louvain-la-Neuve (1993). Information about the conference can be found at: http://costa.ls.fi.upm.es/lopstr12/. The aim ofthe LOPSTR seriesis to stimulate and promote internationalre- searchandcollaborationinlogic-basedprogramdevelopment.LOPSTRtradition- allysolicitscontributions,inanylanguageparadigm,intheareasofspecification, synthesis,verification,analysis,optimization,specialization,security,certification, applicationsandtools,program/modelmanipulation,andtransformationaltech- niques.LOPSTRhasareputationforbeingalively,friendlyforumforpresenting anddiscussingworkinprogress.Formalproceedingsareproducedonlyafterthe symposiumsothatauthorscanincorporatethisfeedbackinthepublishedpapers. In response to the call for papers, 27 contributions were submitted from 19 different countries. The Program Committee accepted four full papers for im- mediate inclusion in the formal proceedings, and nine more papers were ac- cepted after a revision and another round of reviewing. In addition to the 13 contributed papers, this volume includes the abstracts of the invited talks by two outstanding researchers: one LOPSTR invited talk by Tom Schrijvers (University of Ghent, Belgium) and a joint PPDP-LOPSTR invited talk by Ju¨rgen Giesl (RWTH Aachen, Germany). I wantto thank the ProgramCommittee members, who workeddiligently to producehigh-qualityreviewsforthesubmittedpapers,aswellasalltheexternal reviewers involved in the paper selection. I am very grateful the LOPSTR 2012 Conference Co-chairs, Daniel De Schreye and Gerda Janssens, and the local organizers for the great job they did in preparing the conference. I also thank Andrei Voronkov for his excellent EasyChair system that automates many of the tasksinvolvedinchairingaconference.Finally,I gratefullyacknowledgethe sponsors of LOPSTR: The Association for Logic Programming and Fonds voor Wetenschappelijk Onderzoek Vlaanderen. March 2013 Elvira Albert Organization Program Committee Elvira Albert Complutense University of Madrid, Spain Sergio Antoy Portland State University, USA Demis Ballis University of Udine, Italy Henning Christiansen Roskilde University, Denmark Michael Codish Ben-Gurion University of the Negev, Israel Danny De Schreye K.U. Leuven, Belgium Esra Erdem Sabanci University, Istanbul Maribel Fernandez King’s College London, UK Carsten Fuhs University College London, UK John Gallagher Roskilde University, Denmark Robert Glu¨ck University of Copenhagen, Denmark Miguel Gomez-Zamalloa Complutense University of Madrid, Spain R´emy Haemmerl´e Technical University of Madrid, Spain Geoff Hamilton Dublin City University, Ireland Reiner H¨ahnle Technical University of Darmstadt, Germany Gerda Janssens K.U. Leuven, Belgium Isabella Mastroeni University of Verona, Italy Kazutaka Matsuda University of Tokyo, Japan Paulo Moura Universidade da Beira Interior, Portugal Johan Nordlander Lule˚a University of Technology, Sweden Andrey Rybalchenko Technische Universita¨t Mu¨nchen, Germany Kostis Sagonas Uppsala University, Sweden Francesca Scozzari Universit`a “G. D’Annunzio” di Chieti, Italy Valerio Senni Universta` di Roma “Tor Vergata”,Italy German Vidal Technical University of Valencia, Spain Additional Reviewers Amtoft, Torben Hentschel, Martin De Angelis, Emanuele Nigam, Vivek Fioravanti, Fabio Nogueira, Vitor Grossniklaus, Michael Riesco, Adrian Table of Contents Symbolic Evaluation Graphs and Term Rewriting — A General Methodology for Analyzing Logic Programs (Abstract) ............... 1 Ju¨rgen Giesl, Thomas Stro¨der, Peter Schneider-Kamp, Fabian Emmes, and Carsten Fuhs An Introduction to Search Combinators............................. 2 Tom Schrijvers, Guido Tack, Pieter Wuille, Horst Samulowitz, and Peter J. Stuckey A Declarative Pipeline Language for Complex Data Analysis .......... 17 Henning Christiansen, Christian Theil Have, Ole Torp Lassen, and Matthieu Petit Semantic Code Clones in Logic Programs ........................... 35 C´eline Dandois and Wim Vanhoof Specialization with Constrained Generalization for Software Model Checking ....................................................... 51 Emanuele De Angelis, Fabio Fioravanti, Alberto Pettorossi, and Maurizio Proietti Enhancing Declarative Debugging with Loop Expansion and Tree Compression .................................................... 71 David Insa, Josep Silva, and C´esar Toma´s XACML 3.0 in Answer Set Programming ........................... 89 Carroline Dewi Puspa Kencana Ramli, Hanne Riis Nielson, and Flemming Nielson Types vs. PDGs in Information Flow Analysis ....................... 106 Heiko Mantel and Henning Sudbrock Galliwasp: A Goal-Directed Answer Set Solver....................... 122 Kyle Marple and Gopal Gupta Computing More Specific Versions of Conditional Rewriting Systems ... 137 Naoki Nishida and Germa´n Vidal Improving Determinization of Grammar Programs for Program Inversion........................................................ 155 Minami Niwa, Naoki Nishida, and Masahiko Sakai X Table of Contents A Framework for Guided Test Case Generation in Constraint Logic Programming.................................................... 176 Jos´e Miguel Rojas and Miguel Go´mez-Zamalloa Simplifying the Verification of Quantified Array Assertions via Code Transformation .................................................. 194 Mohamed Nassim Seghir and Martin Brain Proving Properties of Co-logic Programs with Negation by Program Transformations ................................................. 213 Hirohisa Seki ProgramAnalysis and Manipulation to Reproduce Learners’Erroneous Reasoning....................................................... 228 Claus Zinn Author Index.................................................. 245 Symbolic Evaluation Graphs and Term Rewriting — A General Methodology (cid:2) for Analyzing Logic Programs (Abstract) Ju¨rgen Giesl1, Thomas Stro¨der1, Peter Schneider-Kamp2, Fabian Emmes1, and Carsten Fuhs3 1 LuFGInformatik 2, RWTH Aachen University,Germany 2 Dept.of Mathematics and Computer Science, Universityof Southern Denmark 3 Dept.of Computer Science, University College London, UK There existmanypowerful techniques to analyzetermination andcomplexity of term rewrite systems (TRSs). Our goal is to use these techniques for the anal- ysis of other programming languages as well. For instance, approaches to prove termination of definite logic programs by a transformation to TRSs have been studiedfordecades.However,achallengeistohandlelanguageswithmorecom- plexevaluationstrategies(suchasProlog,wherepredicateslikethecut influence the control flow). We present a general methodology for the analysis of such programs. Here, the logic program is first transformed into a symbolic evaluation graph which represents all possible evaluations in a finite way. Afterwards, different analyses can be performed on these graphs. In particular, one can generate TRSs from such graphs and apply existing tools for termination or complexity analysis of TRSs to infer informationonthe termination orcomplexity ofthe originallogic program. More information can be found in the full paper [1]. Reference 1. Giesl,J.,Str¨oder,T.,Schneider-Kamp,P.,Emmes,F.,Fuhs,C.:Symbolicevaluation graphs and term rewriting — a general methodology for analyzing logic programs. In:Proc. PPDP 2012, pp.1–12. ACM Press (2012) (cid:2) SupportedbytheDFGundergrant GI274/5-3, theDFGResearch TrainingGroup 1298(AlgoSyn),andtheDanishCouncilforIndependentResearch,NaturalSciences. E.Albert(Ed.):LOPSTR2012,LNCS7844,p.1,2013. (cid:2)c Springer-VerlagBerlinHeidelberg2013 An Introduction to Search Combinators TomSchrijvers1,GuidoTack2,PieterWuille1,3, HorstSamulowitz4,andPeterJ.Stuckey5 1 UniversiteitGent,Belgium {tom.schrijvers,pieter.wuille}@ugent.be 2 NationalICTAustralia(NICTA)andMonashUniversity,Victoria,Australia [email protected] 3 KatholiekeUniversiteitLeuven,Belgium [email protected] 4 IBMResearch,NewYork,USA [email protected] 5 NationalICTAustralia(NICTA)andUniversityofMelbourne,Victoria,Australia [email protected] Abstract. The ability to model search in a constraint solver can be an essen- tial asset for solving combinatorial problems. However, existing infrastructure for defining search heuristics is often inadequate. Either modeling capabilities are extremely limited or users are faced with a general-purpose programming languagewhosefeaturesarenottailoredtowardswritingsearchheuristics.Asa result,majorimprovementsinperformancemayremainunexplored. This article introduces search combinators, a lightweight and solver- independentmethodthatbridgesthegapbetweenaconceptuallysimplemodel- inglanguageforsearch(high-level,functionalandnaturallycompositional)and anefficientimplementation(low-level,imperativeandhighlynon-modular).By allowingtheusertodefineapplication-tailoredsearchstrategiesfromasmallset ofprimitives,searchcombinatorseffectivelyprovidearichdomain-specificlan- guage(DSL)formodelingsearchtotheuser.Remarkably,thisDSLcomesata lowimplementationcosttothedeveloperofaconstraintsolver. 1 Introduction Search heuristics often make all the difference between effectively solving a combi- natorial problem and utter failure. Heuristics make a search algorithm efficient for a varietyofreasons,e.g.,incorporationofdomainknowledge,orrandomizationtoavoid heavy-tailedruntimes.Hence,theabilitytoswiftlydesignsearchheuristicsthataretai- lored towards a problem domain is essential for performance. This article introduces search combinators, a versatile, modular, and efficiently implementable language for expressingsearchheuristics. 1.1 StatusQuo In CP, much attention has been devoted to facilitating the modeling of combinatorial problems. A range of high-level modeling languages, such as OPL [1], Comet [2], E.Albert(Ed.):LOPSTR2012,LNCS7844,pp.2–16,2013. ©Springer-VerlagBerlinHeidelberg2013