On the Foundations of Termination Analysis of Active Database Rules

Traditional database systems provide a mechanism for storing large amounts of data and an interface for querying and manipulating this data. They are, however, passive in the sense that their state can only change as a result of outside in uences. An active database system enhances a traditional database system by providing, through active rules or triggers, the capability of automatically reacting to state changes without user intervention. The behaviour of active rules in such a system, however, can be di cult to predict and there is consequently a need for developing techniques to automatically analyse properties of a rule set. The main purpose of this thesis is to examine the property of termination, i.e. given a collection of active rules, is there a database state in which, once activated, the rules could trigger each other inde nitely. This problem is clearly of practical importance, since the possibility of in nite looping by rules in a database system should certainly be prevented. It is also very interesting and challenging theoretically, since the dynamics of triggers give rise to many intricacies. A major theme of our study is the investigation of the impact that language and control features can have upon the decision problem of termination. In contrast, earlier work has concentrated on developing su cient criteria for termination in systems with complex rule languages. Similar to previous important research problems such as boundedness of datalog, we aim to draw the exact boundary between the decidable and the undecidable cases. We do this by considering a number of parameters of rule systems which can a ect the expressiveness and hence the complexity of termination analysis. These can be broadly grouped into two categories. The rst, rule syntax, includes relation arity, update rule form and input domain constraints. The second, rule control structure, includes the pending rule mechanism and the meta rule language. Using these parameters, we identify rule system con gurations which lie near the boundary. Our results help clarify the relationships between di erent rule components. We also give some complexity results for the decidable cases and show how our techniques for the termination problem can be adapted to analyse the property of reachability. Finally, rather than giving up when presented with an unpromising situation, we propose a method which allows some de nitely terminating cases to proceed; we do this by obtaining a partial answer to termination based on abstract interpretation. ii In terms of precision, the method compares favourably with previous approaches to the problem. This is because it investigates the ow of data, rather than just the syntax of conditions and actions. Preface This thesis contains seven chapters and one appendix. The rst chapter is an introduction and the seventh a summary. Some of the material in Chapter one appeared in the 1995 Australasian Database Conference [11]. Chapters two, three, and four contain material which has not appeared previously. Chapters ve and six are considerably expanded treatments of material which appeared in Proceedings of the 1997 International Conference on Database Theory [8, 9]. This is to certify that 1. the thesis comprises only my original work, 2. due acknowledgement has been made in the text to all other material used, 3. the thesis is less than 100,000 words in length, exclusive of tables, maps, bibliographies, appendices and footnotes Acknowledgements I am greatly indebted to my supervisors, Kotagiri Ramamohanarao and Guozhu Dong. They have assisted me greatly throughout my studies and their enthusiasm and guidance helped make this thesis a reality. I would like to extend my thanks to others with whom I have collaborated to Lobel Crnogorac, with whom I have been fortunate to share an o ce and also to Harald S ndergaard and David Kemp. I am also grateful to my parents, who gave me the opportunity to pursue tertiary study. This work was supported by funding from the Co-operative Research Centre for Intelligent Decision Systems and the Key Centre for Knowledge Based Systems.