Lecture Notes in Artificial Intelligence 4369 EditedbyJ.G.CarbonellandJ.Siekmann Subseries of Lecture Notes in Computer Science Masanobu Umeda Armin Wolf Oskar Bartenstein Ulrich Geske Dietmar Seipel Osamu Takata (Eds.) Declarative Programming for Knowledge Management 16thInternationalConferenceonApplications ofDeclarativeProgrammingandKnowledgeManagement,INAP2005 Fukuoka,Japan,October22-24,2005 RevisedSelectedPapers 1 3 SeriesEditors JaimeG.Carbonell,CarnegieMellonUniversity,Pittsburgh,PA,USA JörgSiekmann,UniversityofSaarland,Saarbrücken,Germany VolumeEditors MasanobuUmeda KyushuInstituteofTechnology 680-4Kawazu,Iizuka,Fukuoka820-8502,Japan E-mail:[email protected] ArminWolf UlrichGeske FraunhoferFIRST Kekuléstraße7,12489Berlin,Germany E-mail:{armin.wolf,ulrich.geske}@first.fraunhofer.de OskarBartenstein IFComputerJapan 5-28-2Sendagi,Bunkyo-ku,Tokyo113-0022,Japan E-mail:[email protected] DietmarSeipel UniversitätWürzburg AmHubland,97074Würzburg,Germany E-mail:[email protected] OsamuTakata KyushuInstituteofTechnology 680-4Kawazu,Iizuka,Fukuoka820-8502,Japan E-mail:[email protected] LibraryofCongressControlNumber:2006938800 CRSubjectClassification(1998):I.2.4,I.2,D.1.6 LNCSSublibrary:SL7–ArtificialIntelligence ISSN 0302-9743 ISBN-10 3-540-69233-9SpringerBerlinHeidelbergNewYork ISBN-13 978-3-540-69233-1SpringerBerlinHeidelbergNewYork 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:11963578 06/3142 543210 Preface Knowledge means power – but only if it is available at the right time, the right place, and in the hands of the right people. Structured, engineered, repeatable methodstogather,transport,andapplyknowledgearecollectivelycalledknowl- edge management. Declarative programming strives for the ideal of programming by wish: the user states what he or she wants, and the computer figures out how to achieve it. Thus, declarative programming splits into two separate parts: methods for humans on how to write wishes, and algorithms for computers that fulfil these wishes. Knowledgemanagementisnowrecognizedasaneconomickeyfactor.Declar- ative programming has matured far beyond the research stage of a merely in- teresting formal logic model to one of the powerful tools in computer science. Nowadays,noprofessionalactivityisthinkablewithoutknowledgemanagement, and companies increasingly need to document their business processes. Here, declarative programmingcarries the promise to be a shortcut to not only docu- menting but also implementing knowledge-basedenterprises. This volume presents a selection of papers presented at the 16th Interna- tional Conference on Applications of Declarative Programming and Knowledge Management,INAP 2005,heldinOctober2005atWasedaUniversity,Fukuoka, Japan. These papers reflect a snapshot of ongoing research and current appli- cations in knowledge management and declarative programming. Further, they provide reality checks and many pointers for readers who consider introducing related technologies into their products or working environments. Skimming throughthe table of contents, technology managersas well as im- plementorswillbesurprisedonthewidescopecoveredbythisselectionofpapers. If you think of knowledge streams as supply, manufacturing, or distribution chains, you will see that it all fits together. Thepapershavebeenselectedfortheirthought-provokingvalue,theauthors are aware that their readers have diverse backgrounds. We sincerely hope that this book is stimulating reading, applying and conducting further research in declarative programming and knowledge management. Japan/Germany 2006 Masanobu Umeda Armin Wolf Oskar Bartenstein Ulrich Geske Dietmar Seipel Osamu Takata (Editors) Organization INAP2005wasorganizedbyIFComputer,Japan,theKyushuInstituteofTech- nology,Japan,FraunhoferFIRST,Germany,UniversityofWu¨rzburg,Germany, and Waseda University, Japan. Executive Committee Conference Chair: Oskar Bartenstein IF Computer, Japan ProgramCo-chair: Masanobu Umeda Kyushu Institute of Technology, Japan ProgramCo-chair: Armin Wolf Fraunhofer FIRST, Germany Constraints Track Chair: Ulrich Geske Fraunhofer FIRST, Germany Knowledge Management Track Chair: Dietmar Seipel University of Wu¨rzburg, Germany Applications Track Chair: Osamu Takata Kyushu Institute of Technology, Japan Local Arrangement Chair: Osamu Yoshie Waseda University, Japan Program Committee Masanobu Umeda, Kyushu Institute of Technology, Japan Armin Wolf, Fraunhofer FIRST, Germany Oskar Bartenstein, IF Computer, Japan Ulrich Geske, Fraunhofer FIRST, Germany Dietmar Seipel, University of Wu¨rzburg, Germany Osamu Yoshie, Waseda University, Japan Osamu Takata, Kyushu Institute of Technology, Japan Kouichi Shibao, AIE Research, Japan Virginia Dignum, Utrecht University, Netherlands Petra Hofstedt, Technical University of Berlin, Germany Neng-Fa Zhou, The City University of New York, USA Sergio A. Alvarez, Boston College, USA Joachim Baumeister, University of Wu¨rzburg, Germany Carolina Ruiz, Worcester Polytechnic Institute, USA VIII Organization External Referees Masaaki Hashimoto, Kyushu Institute of Technology, Japan Hidenobu Kunichika, Kyushu Institute of Technology, Japan Keiichi Katamine, Kyushu Institute of Technology, Japan NaoyasuUbayashi, Kyushu Institute of Technology, Japan Taketoshi Ushiama, Kyushu University, Japan Andreas Bo¨hm, University of Wu¨rzburg, Germany Marbod Hopfner, University of Wu¨rzburg, Germany Supporting Institutions IF Computer, Tokyo, Japan Waseda University, Graduate School of Information, Production and Systems, Japan Table of Contents Frontier Technologies Prolog Cafe: A Prolog to Java Translator System..................... 1 Mutsunori Banbara, Naoyuki Tamura, and Katsumi Inoue TURTLE++ – A CIP-Library for C++ ............................. 12 Petra Hofstedt and Olaf Krzikalla Constraint Solving for Sequences in Software Validation and Verification ..................................................... 25 Nikolai Kosmatov Using a Logic Programming Language with Persistence and Contexts... 38 Salvador Abreu and Vitor Nogueira On a Rough Sets Based Data Mining Tool in Prolog:An Overview .... 48 Hiroshi Sakai Not-First and Not-Last Detection for Cumulative Scheduling in O(n3logn) ................................................... 66 Andreas Schutt, Armin Wolf, and Gunnar Schrader Calc/Cream: OpenOffice Spreadsheet Front-End for Constraint Programming.................................................... 81 Naoyuki Tamura O(nlogn) Overload Checking for the Cumulative Constraint and Its Application ..................................................... 88 Armin Wolf and Gunnar Schrader Inductive Logic Programming:Yet Another Application of Logic....... 102 Akihiro Yamamoto Industrial Case Studies Railway Scheduling with Declarative Constraint Programming......... 117 Ulrich Geske User Profiles and Matchmaking on Mobile Phones.................... 135 Thomas Kleemann and Alex Sinner X Table of Contents A Design Product Model for Mechanism Parts by Injection Molding.... 148 Tatsuichiro Nagai, Isao Nagasawa, Masanobu Umeda, Tatsuji Higuchi, Yasuyuki Nishidai, Yusuke Kitagawa, Tsuyoshi Tsurusaki, Masahito Ohhashi, and Osamu Takata A Knowledge-Based System for Process Planning in Cold Forging Using the Adjustment of Stepped Cylinder Method................... 161 Osamu Takata, Yuji Mure, Yasuo Nakashima, Masuharu Ogawa, Masanobu Umeda, and Isao Nagasawa Business Integration An Overview of Agents in Knowledge Management................... 175 Virginia Dignum ubiCMS – A Prolog Based Content Management System.............. 190 Oskar Bartenstein Multi-threading Inside Prolog for Knowledge-Based Enterprise Applications..................................................... 200 Masanobu Umeda, Keiichi Katamine, Isao Nagasawa, Masaaki Hashimoto, and Osamu Takata A Meta-logical Approach for Multi-agent Communication of Semantic Web Information................................................. 215 Visit Hirankitti and Vuong Xuan Tran Author Index.................................................. 229 Prolog Cafe: A Prolog to Java Translator System Mutsunori Banbara1, Naoyuki Tamura1, and Katsumi Inoue2 1 Information Scienceand Technology Center, Kobe University 1-1 Rokkodai, Nada, Kobe 657-8501, Japan {banbara, tamura}@kobe-u.ac.jp 2 National Instituteof Informatics 2-1-2 Hitotsubashi, Chiyoda-ku,Tokyo101-8430, Japan [email protected] Abstract. We present the Prolog Cafe system that translates Prolog into Javavia theWAM. Prolog Cafe providesmulti-threaded Prolog en- gines. A Prolog Cafe thread seems to be conceptually an independent PrologevaluatorandcommunicateswitheachotherthroughsharedJava objects. Prolog Cafe also has theadvantages of portability, extensibility, smooth interoperation with Java, and modularity. In performance, our translator generates faster code for a set of classical Prolog benchmarks than an existing Prolog-to-Java translator jProlog. 1 Introduction Recent development of Prolog in Java suggests a successful direction to extend not only Prolog to be more networked and mobile, but also Java applications to be more intelligent. We aim to develop a Java-conscious Prolog system that hasthe advantagesofportability,extensibility,interoperability,parallelism,and modularity. In the implementation of Prolog,the Warren Abstract Machine (WAM) [1,2] has became a de facto standard. WAM is flexible enough for several exten- sionssuchashigher-order,concurrent,constraint,andlinearlogicprogramming. WAM has been also a basis for compiling Prolog into C [3], C++, Java, C#. We present the Prolog Cafe system that translates Prolog into Java. The execution model of translatedJava classes is basedon the WAM. Main features of Prolog Cafe are as follows: – Portability Prolog Cafe is a 100% pure Java implementation and is portable to any platform supporting a Java compiler. – Extensibility The output of Prolog Cafe translator can be well structured and readable. PrologCafeisthereforeeasilyexpandablewithincreasingJavaclasslibraries. – Interoperability FromtheJavaside,thetranslatedcodeofPrologCafecanbeeasilyembedded into Java applications such as Applets and Servlets. From the Prolog side, any Java object can be represented as a Prolog term, and its methods and fields can be exploited from Prolog. M.Umedaetal.(Eds.):INAP2005,LNAI4369,pp.1–11,2006. (cid:2)c Springer-VerlagBerlinHeidelberg2006 2 M. Banbara, N. Tamura, and K.Inoue – Parallelism Prolog Cafe provides multi-threaded Prolog engines. A Prolog Cafe thread seemstobeconceptuallyanindependentPrologevaluator,inwhichaProlog goalruns ona localruntime environment.PrologCafe threadscommunicate with each other through shared Java objects. – Modularity Prolog modules are translated into separate Java packages that can be im- ported from each other. Inperformance,ourtranslatorgeneratesfastercodeforasetofclassicalProlog benchmarksthananexistingProlog-to-JavatranslatorjProlog.Maindifferences from the previous versionof Prolog Cafe [4] are new features of interoperability, parallelism, and modularity listed above. UsefulnessofPrologCafehasbeenshownthroughseveralapplications:P#[5], Multisat [6], Maglog [7], Holoparadigm [8], and CAWOM [9]. Among these appli- cations,we give a brief introduction to the Multisat system,a parallelexecution system of SAT solvers. The reminder ofthis paperis organizedasfollows.After showingthe transla- tionmethodofexistingPrologtoJavatranslatorsinSection2,Section3presents the Prolog Cafesystemin detail.Relatedworkis discussed inSection4,andthe paper is concluded in Section 5. 2 Existing Prolog to Java Translator Systems Inthis section,we presenthowjPrologandLLPjtranslateProloginto Java.Due to space limitations, we use the following simple example: p :- q, r. q. 2.1 jProlog The jProlog [10] system, developed by B. Demoen and P. Tarau, is a first gen- erationPrologto Javatranslatorvia the WAM. jPrologis basedon binarization transformation [11], a continuation passing style compilation used in BinProlog. In jProlog approach, each clause is first translated into a binary clause by binarization and then translated into one Java class. Each predicate with the same name/arity is translated a set of classes;there is one class for direct entry point, and other classes for clauses. Each continuation goal is translated into a term object, that is executed by referring to the hash table to transform it into its corresponding predicate object. Our example is first translated into the following binary clauses where Cont represents a continuation goal: p(Cont) :- q(r(Cont)). q(Cont) :- call(Cont).