Lecture Notes in Computer Science 2235 EditedbyG.Goos,J.Hartmanis,andJ.vanLeeuwen 3 Berlin Heidelberg NewYork Barcelona HongKong London Milan Paris Tokyo Cristian S. Calude Gheorghe Pa˘un Grzegorz Rozenberg Arto Salomaa (Eds.) Multiset Processing Mathematical, Computer Science, and Molecular Computing Points of View 1 3 SeriesEditors GerhardGoos,KarlsruheUniversity,Germany JurisHartmanis,CornellUniversity,NY,USA JanvanLeeuwen,UtrechtUniversity,TheNetherlands VolumeEditors CristianS.Calude UniversityofAuckland,DepartmentofComputerScience CenterforDiscreteMathematicsandTheoreticalComputerScience E-mail:[email protected],[email protected] GheorghePa˘un InstituteofMathematicsoftheRomanianAcademy E-mail:[email protected],[email protected] GrzegorzRozenberg LeidenUniversity,LeidenInstituteforAdvancedComputerScience E-mail:[email protected] ArtoSalomaa TurkuCenterforComputerScience,TUCS E-mail:asalomaa@utu.fi Cataloging-in-PublicationDataappliedfor DieDeutscheBibliothek-CIP-Einheitsaufnahme Multisetprocessing:mathematical,computerscience,andmolecular computingpointsofview/CristianS.Calude...(ed.).-Berlin; Heidelberg;NewYork;Barcelona;HongKong;London;Milan;Paris; Tokyo:Springer,2001 (Lecturenotesincomputerscience;Vol.2235) ISBN3-540-43063-6 CRSubjectClassification(1998):E.1,F.1,F.4.2-3,J.3,J.2 ISSN0302-9743 ISBN3-540-43063-6Springer-VerlagBerlinHeidelbergNewYork Thisworkissubjecttocopyright.Allrightsarereserved,whetherthewholeorpartofthematerialis concerned,specificallytherightsoftranslation,reprinting,re-useofillustrations,recitation,broadcasting, reproductiononmicrofilmsorinanyotherway,andstorageindatabanks.Duplicationofthispublication orpartsthereofispermittedonlyundertheprovisionsoftheGermanCopyrightLawofSeptember9,1965, initscurrentversion,andpermissionforusemustalwaysbeobtainedfromSpringer-Verlag.Violationsare liableforprosecutionundertheGermanCopyrightLaw. Springer-VerlagBerlinHeidelbergNewYork amemberofBertelsmannSpringerScience+BusinessMediaGmbH http://www.springer.de ©Springer-VerlagBerlinHeidelberg2001 PrintedinGermany Typesetting:Camera-readybyauthor,dataconversionbySteingräberSatztechnikGmbH,Heidelberg Printedonacid-freepaper SPIN:10845800 06/3142 543210 Preface The multiset (a set with multiplicities associated with its elements, in the form of natural numbers) is a notion which has appeared again and again in many areas of mathematics and computer science, sometimes called a bag (some his- torical information appears in the enclosed paper by A. Syropoulos). As a data structure, this notion stands “in-between” strings/lists, where a linear ordering of symbols/items is present, and sets, where no ordering and no multiplicity is considered; in a multiset, only the multiplicity of elements matters, not their ordering.Actually,inbetweenlistsandmultisetswealsohavepomsets,partially ordered multisets. Confining ourselves to computer science, we may mention many areas where multisets are used: formal power series, Petri nets, data bases, logics, formal languagetheory(inrelationwithParikhmapping,commutativegrammars,etc), concurrency, and so on. In the last few years, the notion has occurred in a rather natural way in the molecular computing area. An aqueous solution of chemical compounds, swimming together in a given space, without any given spatial relation between individual elements, is just a multiset. Actually, this chemical metaphor was used several years before the occurrence of what is now called molecular computing, as the basic ingredient of the Gamma language and the Chemical Abstract Machine (a comprehensive survey of these ideas is provided by J.-P. Banaˆtre, P. Fradet, D. Le Metayer). Then, multisets were usedinrelationwithDNAcomputing,especiallyinthecontextofcomputingby splicing(Hsystems):takingintoaccountthenumberofDNAmoleculesprovedto beaverypowerfulfeatureofHsystems,leadingtocomputationalcompleteness. In the prolongation of the chemical metaphor, the membrane computing area has recently emerged, as an abstraction of the living cell structure and biochemistry: in the compartments defined by a membrane structure, one pro- cesses multisets of chemical compounds, denoted by symbols or by strings over a given alphabet (up-to-date details about this area can be found on the web page http://bioinformatics.bio.disco.unimib.it/psystems, mastered by C. Zandron, in Milan). In spite of all these “applications” and of many other related topics, the no- tion of a multiset has not received any systematic, monographic attention. In August2000,aworkshopwasorganizedinCurteadeArge¸s,Romania,explicitly with the aim of discussing the mathematical backgrounds, the computer science and molecular computing relevance of the notion of a multiset, with emphasis on multiset processing in the distributed framework of membrane computing. The editors of the present volume constituted the program committee of the workshop, while the organizing institutions were the “Simion Stoilow” Institute ofMathematicsoftheRomanianAcademy,Bucharest,theArtificialIntelligence Department of the Polytechnical University of Madrid, the Centre for Discrete Mathematics and Theoretical Computer Science of Auckland University, New Zealand, and the “Vlaicu-Voda˘” High School of Curtea de Arge¸s, Romania. A VI technicalreport(no140/2000)ofCDMTCS,AucklandUniversity,waspublished as a pre-proceedings working volume, in anticipation of obtaining improved ver- sionsofthepapersduringtheworkshop,throughtheinteractionoftheauthors. Actually, several new papers were started during the meeting as a result of co- operation among participants. Some of these papers were collected in a special double issue of the Romanian Journal of Information Science and Technology (ROMJIST), published as nr. 1-2 of volume 4, from 2001. Other papers, as well as several additional invited papers, are contained in the present volume. While the ROMJIST issue is mainly devoted to DNA and membrane com- puting,thepresentvolumeisfocusedonfundamentals,onmathematicalformal- izations, and computer science (including molecular computing) applications of the notion of a multiset. Besides the two papers mentioned above, there are papers about the mathematical status of the notion of a multiset (S. Marcus, S. Miyamoto, T.Y. Nishida), about a theoretical, formal language-like study of multisets (by E. Csuhaj-Varju, M. Kudlek, C. Martin-Vide, V. Mitrana, Gh. Pa˘un), with the ambition of founding a consistent rewriting Chomsky-like the- oryofmultisets,aswellasapplicativepapers:multisetsanddatabases(arather comprehensive paper by G. Lamberti, M. Melchiori, M. Zanella), multisets in visual languages (P. Bottoni, B. Meyer, F. Parisi Presice), multisets and dy- namic systems (W. Reising), multisets and formal languages (J. Dassow). Sev- eral papers are related to membrane computing, discussing the relation with constraintprogramming(A.Dovier,C.Piazza,G.Rossi),thepower(M.Madhu, K.Krithivasan)andefficiencyofmembranesystems(A.Obtulowicz),apossible implementation on the usual electronic computer (F. Arroyo, A.V. Baranda, J. Castellanos, C. Luengo, L.F. Mingo), or applications in Artificial Life, mainly via extensive simulations on the computer (Y. Suzuki, Y. Fujiwara, H. Tanaka). These papers, besides a large quantity of background information (basic no- tions and results, bibliography, further developments not presented in an exten- sive manner), also contain research topics and problems, so that the volume is intended to be useful both to the “users” of the notion of a multiset and to those who want to contribute to the development of its theory, with special at- tentionbeingpaidtothecomputerscienceapproaches(includingthemembrane computing area). Of course, this is only a step towards “FMT” (Formal Macroset/Multiset Theory), to borrow one of the syntagmas used as the title of a paper included in the volume. Hopefully, the next step will be done by the reader. * * * We warmly thank all contributors to this volume for their timely and high- quality work, as well as A. Hofmann, from Springer-Verlag, Heidelberg, for the efficient and pleasant cooperation. September 2001 Cristian S. Calude Gheorghe Pa˘un Grzegorz Rozenberg Arto Salomaa Table of Contents Structures and Bio-language to Simulate Transition P Systems on Digital Computers ...... 1 Fernando Arroyo, Angel V. Baranda, Juan Castellanos, Carmen Luengo, Luis F. Mingo Gamma and the Chemical Reaction Model: Fifteen Years After ............................................... 17 Jean-Pierre Banaˆtre, Pascal Fradet, Daniel Le M´etayer Visual Multiset Rewriting: Applications to Diagram Parsing and Reasoning .............. 45 Paolo Bottoni, Bernd Meyer, Francesco Parisi Presicce Multiset Automata ............................................... 69 Erzs´ebet Csuhaj-Varju´, Carlos Mart´ın-Vide, Victor Mitrana Parikh Mapping and Iteration ................................... 85 Ju¨rgen Dassow Multiset Constraints and P Systems ........................... 103 Agostino Dovier, Carla Piazza, Gianfranco Rossi Toward a Formal Macroset Theory ............................ 123 Manfred Kudlek, Carlos Mart´ın-Vide, Gheorghe Pa˘un Normal Forms of Grammars, Finite Automata, Abstract Families, and Closure Properties of Multiset Languages .... 135 Manfred Kudlek, Victor Mitrana On Multisets in Database Systems ............................. 147 Gianfranco Lamperti, Michele Melchiori, Marina Zanella Tolerance Multisets .............................................. 217 Solomon Marcus Fuzzy Multisets and Their Generalizations ................... 225 Sadaaki Miyamoto VIII Universality Results for Some Variants of P Systems ........ 237 Madhu Mutyam, Kamala Krithivasan Multiset and K-Subset Transforming Systems ................ 255 Taishin Yasunobu Nishida On P Systems with Active Membranes Solving the Integer Factorization Problem in a Polynomial Time ... 267 Adam Obtul7owicz The Linear Theory of Multiset Based Dynamic Systems .... 287 Wolfgang Reisig Artificial Life Applications of a Class of P Systems: Abstract Rewriting Systems on Multisets ..................... 299 Yasuhiro Suzuki, Yoshi Fujiwara, Junji Takabayashi, Hiroshi Tanaka Mathematics of Multisets ....................................... 347 Apostolos Syropoulos Author Index .................................................... 359 Structures and Bio-language to Simulate Transition P Systems on Digital Computers Fernando Arroyo1, Angel V. Baranda2, Juan Castellanos2, Carmen Luengo1, and Luis F. Mingo3 1 Dpto. de Lenguajes, Proyectos y Sistemas Inform´aticos Escuela Unversitaria de Inform´atica, Universidad Polit´ecnica de Madrid Crta. de Valencia Km. 7, 28031 Madrid, Spain {farroyo, cluengo}@eui.upm.es 2 Dpto. de Inteligencia Artificial, Facultad de Inform´atica Universidad Polit´ecnica de Madrid Campus de Montegancedo, 28660 Boadilla del Monte, Madrid, Spain [email protected] 3 Dpto. de Organizaci´on y Estructura de la Informaci´on Escuela Unversitaria de Inform´atica, Universidad Polit´ecnica de Madrid Crta. de Valencia Km. 7, 28031 Madrid, Spain [email protected] Abstract. The aim of this paper is to show that some computational models inspired from biological membranes, such as P systems, can be simulated on digital computers in an efficient manner. To this aim, it is necessary to characterize non-determinism and parallel execution of evolution rules inside regions. Both these issues are formally described hereinordertoobtainafeasibledescriptionintermsofdatastructures and operations able to be implemented in a functional programming language.StaticanddynamicstructuresoftransitionPsystemsarefor- malised in order to define a bio-language to represent them. Finally, a draft of a language for describing a transition P systems is presented. It will facilitate the description of transition P systems in terms of sen- tencesinahighlevelprogramminglanguage;suchsentenceswilldefinea program.Aprocessofcompilationwillparsetheprogramtoappropriate data structures and will launch the execution of the simulation process. 1 Introduction Membrane computing is a new research field, of a biological inspiration, intro- ducedbyGh.Pa˘unin[4].Thisnewcomputationalparadigmtriestoimitatethe way nature computes at the cellular level. Any biological system can be viewed as a hierarchical construct where the interchange of materials takes place. This process of material interchange can be interpreted as a computing process [4]. Taking into account this point of view, we can say that membrane computing is a general architecture of “living organisms”, in the sense of Artificial Life [5]. Computingwithmembranesusesahierarchicalmembranestructureinthesame sense that it is used in the chemical abstract machine of Berry and Boudol [3], C.S.Caludeetal.(Eds.):MultisetProcessing,LNCS2235,pp.1–15,2001. (cid:1)c Springer-VerlagBerlinHeidelberg2001 2 Fernando Arroyo et al. and the basic ideas of evolution rules as multisets transformation are inspired in Γ systems introduced by Banaˆtre [1]. Here we present the classical general descriptionof transitionPsystems for determiningtheir maincomponents. The transition P systems structure is recursively defined, as composed by several membranes enclosed by a unique membrane named “skin”. This structure de- fines a hierarchical compartmental structure that can be easily represented as a Venn diagram. The membrane structure is the main component of a transition P system. Membranes are uniquely labelled and they delimit regions or vesicles wherethereexistobjects,representedbyamultiset,andasetofevolutionrules. The objects are represented by symbols from a given alphabet. Usually, an evo- lution rule from a determined region has the form r : ca → cb da2 and it inj out saysthatacopyofatogetherwithacopyofthecatalystc(catalystsareobjects whicharenevermodifiedbuttheymustbepresenttoapplytherule)isreplaced by a copy of the object d which remains in the membrane, while two copies of theobjectaaresentoutthroughthemembraneoftheregion,andacopyofthe object b is sent to the region labelled by j. Note that the rule r can be applied if and only if the region includes directly the membrane j. In general, the use of the expression “a copy of the object” is reduced to “the object” in order to make descriptions of computations in membrane systems simpler. However, it is important to bear in mind that copies of objects are used when evolution rules are applied in regions. P systems evolution is performed in a non-deterministic and massively par- allel manner. That is, inside every region of the P system, the objects to evolve and the evolution rules that can be applied are chosen in an exhaustive and non-determinist way. Evolution in membranes is synchronous, i.e., evolution in- side regions is governed by an external clock. In each time unit, every region evolves and changes its multiset of objects by application of evolution rules of the region. This means that in each time unit the P system changes its state or configuration. ComputationsinPsystemsareachievedbysequencesoftransitionsbetween configurations. A configuration is halting if no rule is applicable in any region. We say that a computation is successful if we reach a halting configuration, and the result of the computation is the number of objects sent to the environment through the skin or to a given elementary membrane during the computation. Tothisbasicmodelmanymodificationscanbeadded.Hereweconsideronly one more feature: a priority relation among rules in regions. This new feature means that only rules with the higher priority can be used in a given evolution step. This feature permits to establish an order relationship among rules and in some sense to project a kind of execution program in the evolution rules set. 2 Static Structure of Transition P Systems InthissectionwepresentthesimplestvariantofPsystems,transitionPsystems. It is the basic model with the added feature of a priority relation on the set of evolution rules.