Lecture Notes in Artificial Intelligence 541 Subseries of Lecture Notes in Computer Science Edited by J. Siekmann Lecture Notes in Computer Science Edited by G. Goos and J. Hartmanis E Barahona L. Moniz Pereira A. Porto (Eds.) EPIA 91 5th Portuguese Conference on Artificial Intelligence Albufeira, Portugal, October 1-3, 1991 Proceedings galreV-regnirpS Berlin Heidelberg NewYork London Paris Tokyo Kong Hong Barcelona Budapest Series Editor J6rg Siekmann Institut ftir Informatik, Universit~t Kaiserslautern Postfach 3049, W-6750 Kaiserslautern, FRG Volume Editors Pedro Barahona Luis Moniz Pereira Ant6nio Porto Departamento de Inform~itica, Universidade Nova de Lisboa 2825 Monte da Caparica, Portugal CR Subject Classification (1991): 1.2.3-4, 1.2.6, 1.2.8 ISBN 3-540-54535-2 Springer-Verlag Berlin Heidelberg New York ISBN 0-387-54535-2 Springer-Verlag New York Berlin Heidelberg This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, re-use of illustrations, recitation, broadcasting, reproduction on microfilms or in otherw aysa,n d storage in data banks. Duplication of this publication or parts thereof is only permitted under the provisions of the German Copyright Law of September 9, 1965, ini ts current version, and a copyright fee must always be paid. Violations fall under the prosecution act of the German Copyright Law. © Springer-Verlag Berlin Heidelberg 1991 Printed in Germany Typesetting: Camera ready by author Printing and binding: Druckhaus Beltz, Hemsbach/Bergstr. 2145/3140-543210 - Printed on acid-free paper Preface The Portuguese Association for Artificial Intelligence (Associa~o Portuguesa Para a Intelig~ncia Artificial-APPIA) has been organizing Portuguese Conferences on Artificial Intelligence, now held every second year, since 1985. The present Fifth Conference on Artificial Intelligence, like the previous one, was aimed at an international audience and at a high standard regarding accepted communications. The international status of the Conference can be assessed from the fact that 62 contributions from 31 countries were received (26 contributions from Portugal). All of them were reviewed by at least three researchers of the appropriate scientific areas, and the reviews closely scrutinized by the Program Committee. To guarantee a high scientific standard, the Program Committee decided to accept only those papers significantly better than merely acceptable, and in fact most of them were judged definitely acceptable. As a result, only 20 papers were accepted and included in these proceedings. We would like to thank all the people who made important contributions to the technical quality of this Conference, namely the Program Committee members and the referees, listed elsewhere in these proceedings. We also thank our invited speakers Hassan Ait-Kaci, Robin Cooper, Mark Drummond, Catherine Lassez Vladimir Lipschitz, and Werner Schimanovich for their presentations, which significantly increased the interest and quality of the Conference. Finally, we would like to thank the institutions who have contributed (financially or otherwise) to the organization of this Conference, namely Funda~o Calouste Gulbenkian, Instituto Nacional de Investiga~ao Cientifica, Junta Nacional de Investiga~o Cientifica e Tecnol6gica, Funda~o Luso-Americana para o Desenvolvimento, Banco Espirito Santo e Comercial de Lisboa, Caixa Geral de Dep6sitos, Companhia Portuguesa Radio Marconi, Alcatel Portugal, IBM Portuguesa, Centro de Intelig~ncia Artificial do UNINOVA, and Departamento de Inform~tica da Universidade Nova de Lisboa. Lisbon, July 1991 Luis Moniz Pereira Ant6nio Porto Pedro Barahona IV Conference Chair Program Chair Pedro Barahona Lufs Moniz Pereira Ant6nio Porto Program Committee Pedro Barahona Universidade Nova de Lisboa Pavel Brazdil Universidade do Porto Helder Coelho Universidade T6cnica de Lisboa Gabriel Pereira Lopes Universidade Nova de Lisboa Jo~o Pav~o Martins Universidade T6cnica de Lisboa Fernando Pereira ATT Bell Laboratories, New Jersey Luis Moniz Pereira Universidade Nova de Lisboa Ant6nio Porto Universidade Nova de Lisboa Referees .J Alegria .J .J Alferes P. Barahona A. Borges deA lmeida I. Braha P. Brazdil R. Camacho L. Camarinha de Matos .J Cam6es Silva A. Cardoso .J Cohen H. Coelho R. Cooper E. Costa .J Cunha L. Damas .J Duarte do Amaral .J Esgalhado Valenqa .J Falc~o e Cunha M. Filgueiras G. Gaspar M. Gomes P. Guedes de Oliveira T. Hichey .J Hirschberg .J M. Jacquet D. Johnson .J P. Leal .J Legatheaux Martins M. Mamede A. Matos M. Matos F. Menezes L. Moniz Pereira L. Monteiro E. Morgado .J Nunes Aparicio A. Odlyzko E. Oliveira .J N. Oliveira J. Pav~o Martins F. Pereira G. Pereira Lopes I. Pimenta Rodrigues A. Pinho A. Porto M. Pr6spero dos Santos C. Queiroz C. Ramos R. Ribeiro A. Sernadas C. Sernadas L. Torgo A. Tra~a de Almeida Table of Contents Constraints Solving Linear Constraints on Finite Domains Through Parsing ....................................... M. Filgueiras, A. P. Tom,is Centro de Inform~itica, Universidade do Porto, Portugal Constraint Solving in Finite Domains under User Control .................................................. 17 .F Menezes, P. Barahona Departamento de InformStica, Universidade Nova de Lisboa, Portugal A New Method for Solving Linear Constraints on the Natural Numbers ........................ 30 A. P. Tom,is, M. Filgueiras Centro de Inform~tica, Universidade do Porto, Portugal A Constraint-Based Fuzzy Inference System ............................................................................. 45 K. Lano Computing Laboratory, Oxford University, United Kingdom A Constraint-Based Language for Querying Taxonomic Systems ........................................ 60 M. Mamede, L. Monteiro Departamento de Informatica, Universidade Nova de Lisboa, Portugal Search Heuristic Parsing and Search Space Pruning ............................................................................. 76 .J A. Mendes, P. R. Henriques Universidade do Minho, Braga, Portugal Wave-shaping in Multiprocessor Bidirectional Heuristic State Space Search .................. 92 P. C. Nelson, A. A. Toptsis Department of Electrical Engineering and Computer Science, University of Illinois, USA; Department of Computer Science and Mathematics, York University, Canada Knowledge Representation The Extended Stable Models of Contradiction Removal Semantics .................................... 501 L. Moniz Pereira, .J .J Alferes, .J N. Aparicio Departamento de Informatica, Universidade Nova de Lisboa, Portugal Modelling a Rational Cognitive Agent in SNePS .................................................................... 021 D. Kumar, .S C. Shapiro Department of Computer Science, SUNY at Buffalo, USA Semantics of Property Inheritance in a Hierarchic System with Explicit Negation ......... 531 G. David, A. Porto Departamento de Inform~tica, Universidade Nova de Lisboa, Portugal iiiv Temporal Reasoning Time In Confluences: Dealing with Delays for Consistency-Checking ............................... 151 A. Cardoso, E. Costa Laborat6rio de Inform~itica e Sistemas, Universidade de Coimbra, Portugal A Temporal Representation for Imperatively Structured Plans of Actions ...................... 561 E. Rutten CWI, Amsterdam, The Netherlands Maximal Intervals: An Approach to Temporal Reasoning ................................................... 081 C. Ribeiro, A. Porto Departamento de Inform~itica, Universidade Nova de Lisboa, Portugal Planning Consistency Driven Planning ....................................................................................................... 591 M. Decker, G. Moerkotte, H. M~iller, .J Posegga IPD - Fakult/it f/Jr Informatik, Universit/it Karlsruhe, Germany An Efficient Approach to PlannIng in Assembly Tasks .......................................................... 210 C. Ramos, E. Oliveira Faculdade de Engenharia, Universidade do Porto, Portugal Diagnosis and Repair Towards a Theory of the Repair Process ..................................................................................... 222 G. Friedrich, G. Gotflob, W. Nejdl Institut f/Jr Informationssysteme, Technische Universit/it Wien, Austria Declarative Source Debugging ...................................................................................................... 237 M. Calejo, L. Moniz Pereira Departamento de Inform~itica, Universidade Nova de Lisboa, Portugal Learning A Neural Approach to Data Compression and Classification ............................................... 250 K. P. Kratzer Fachhochschule Ulm, Germany Generalization for a Propositional Calculus: A Constraints-Based Approach .................. 264 R. Vorc'h IRISA, Rennes, France Adaptive Learning Using a Qualitative Feedback Loop ......................................................... 278 L. Winkelbauer, C. Stary International Institute for Applied Systems Analysis, Laxenburg, Austria; School of Computer Science, Florida International University, USA Solving Constraints on Linear Finite Domains Through *gnisraP Miguel Filgueiras, Ana Paula Tom£s Centro de Inform~tica, Universidade do Porto R. do Campo Alegre 823, 4100 Porto, Portugal email: [email protected], [email protected] Abstract In this paper we present results from ongoing research which allows the use of parsing methods to solve a particular kind of constraints, namely linear constraints on finite domains. Solving this kind of constraints is equivalent to solving systems of linear Diophantine equations on a finite subset of the naturals. We associate, to such a system, a definite-clause grammar that can be used to enumerate its solutions, and define a class of grammars, the connected grammars, for which the set of successful derivations covers the set of non-negative solutions of the associated system. This definition is based on a study of cycles in context-free grammars using compiler construction concepts and techniques. 1 Introduction The emergence of Constraint Logic Programming languages, namely Prolog III [Colmerauer 1987] and CHIP [Dincbas et al. 1988], [van Hentenryck 1989], and the definition of the CLP-scheme [Jaffar et al. 1986], [Jaff~r and Lassez 1987], increased and renewed the importance of the study of methods for handling con- straints and, in particular, methods for solving constraints [Cohen 1990]. *The research described in this paper saw partially supported by Instituto NacionM de In- Cientifica. vestiga~go In this paper we present results from ongoing research which allow the use of parsing methods to solve a particular kind of constraints, namely linear con- straints on finite domains 1 . Solving this kind of constraints is equivalent to solving systems of linear Diophantine equations on a finite subset of the naturals. It is easily seen that such a system may be always transformed into an equivalent one with positive coefficients by an appropriate use of the bounds for the unknowns. We show that there is a natural correspondence between a system and a definite- clause grammar (DCG) Pereira and Warren 1980, what enables us to trivially map the problem of solving linear constraints on finite domains into a parsing problem, and to try to use efficient parsing algorithms to solve the first one. How interesting this may turn out in practice depends on the results of a compari- son with other methods. The soundness requirement that the set of successful grammar derivations covers the solution set of the system is proved for the class of connected grammars, a sub-class of context-free grammars introduced below. The results presented can be easily extended to a subset of the DCGs. The next section gives a formal presentation of how successful derivations in a grammar can be related with a system of non-negative linear Diophantine (NNLD, for short) equations. In Section 3 notions concerning cycles in grammars are introduced that allow the definition, in Section 4 of the class of connected grammars. In order to prove (Section 6) that for this class the set of successful derivations covers the set of solutions of the associated system of equations, some other notions and results concerning subtrees and multisets of subtrees (forests) are described in Section .5 Finally, and before the Conclusions, an overview of how parsing can be used to solve linear constraints on finite domains is given. 2 Derivations and Systems of Equations To every context-free grammar G it is possible to associate a system of linear equations on non-negative integers in which each variable stands for the number of applications of each production rule of G in a successful derivation. Let G = (Vt, Vn,P,S) and for every iv E P, 1 < i < p let nl be the number of times ri is applied during a derivation of a string in L(G), the language generated by G. Let • ip(A) denote the set of indices i of the rules rl whose left-hand side is A ,2 eeS1 also sarieugliF ,0991 sarieugliF and Tom~s .0991 ~Without loss of generality it will be assumed that rof every non-terminal A E If,, ip(A) ~ .~ • rhs(r) be the right-hand side of rule r, • occ(X, (r) be the number of occurrences of symbol X in the string ,ro and • n(x) be the number of occurrences of the terminal z in the string to be parsed. In a successful derivation of a string w E L(G), the number of times a non- terminal symbol is expanded must be equal to the number of times it is produced (the start symbol obviously has one more occurrence). Similarly, the number of times a terminal symbol occurs in w must be equal to the number of times it is produced. As a consequenceo f these facts given a string w E L(G) the following equations must hold: non-terminal equations: • for S, the start symbol of G P ni - ~_, occ(S, rhs(rk)) * nk = 1 ieip(S) k=l for every non-terminal A(¢ S) q nV P ni - ~ occ(A, rhs(rk)) . nk = 0 iEip(A) k=l • terminal equations: for every terminal a E tV p occ(a, rhs( k)) • = oct(., k=l A particular string determines a set of solutions to the system. However, a solution in this set may either correspond to a successful derivation of a different string or to no derivation at all. The first situation arises because in the system there is no information about the order of symbols. The second one originates from the existence of cycles in the grammar: a solution may correspond to a sucessful derivation plus a certain number of cycles. When our goal is to solve a system of NNLD equations by parsing, the first case is not really problematic because we can fix the order and the string to be parsed. In contrast, the second means that the set of solutions is not covered by