PDF (Dissertation.Pdf)
Total Page:16
File Type:pdf, Size:1020Kb
Kind Theory Thesis by Joseph R. Kiniry In Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy California Institute of Technology Pasadena, California 2002 (Defended 10 May 2002) ii © 2002 Joseph R. Kiniry All Rights Reserved iii Preface This thesis describes a theory for representing, manipulating, and reasoning about structured pieces of knowledge in open collaborative systems. The theory's design is motivated by both its general model as well as its target user commu- nity. Its model is structured information, with emphasis on classification, relative structure, equivalence, and interpretation. Its user community is meant to be non-mathematicians and non-computer scientists that might use the theory via computational tool support once inte- grated with modern design and development tools. This thesis discusses a new logic called kind theory that meets these challenges. The core of the work is based in logic, type theory, and universal algebras. The theory is shown to be efficiently implementable, and several parts of a full realization have already been constructed and are reviewed. Additionally, several software engineering concepts, tools, and technologies have been con- structed that take advantage of this theoretical framework. These constructs are discussed as well, from the perspectives of general software engineering and applied formal methods. iv Acknowledgements I am grateful to my initial primary adviser, Prof. K. Mani Chandy, for bringing me to Caltech and his willingness to let me explore many unfamiliar research fields of my own choosing. I am also appreciative of my second adviser, Prof. Jason Hickey, for his support, encouragement, feedback, and patience through the later years of my work. If Jason had not appeared at Caltech in Autumn of 1999, I may well have not finished my Ph.D. I am very much in debt to Joseph Goguen whose inspiring work started me on the path of using algebras and categories. José Meseguer and Francisco (Paco) Duran have been of tremendous help and inspiration in my use of Maude and rewriting logic. Thanks also go to fellow graduate students and research group members Daniel Zimmer- man, Eve Schooler, Michel Charpentier, Roman Ginis, Paolo Sivilotti, John Thornley, and Berna Massingill, and Adam Rifkin—the original reason for my coming to Caltech. I am one that would loose my head if it wasn't screwed on at times, so administrative assistance is appreciated. To that end, I am in debt to Diane Goodfellow and Jeri Chittum, two of the key folks that keep Caltech Computer Science running. I am most grateful to the Caltech Computer Science community for providing such an open, stimulating, and quality environment in which to do “way-out” work. Influential members of my community are, besides those fellow students mentioned above: Eric Bax, Eitan Grinspun, Rajit Manohar, Alexander Nicholson, Mika Nyström, Steven Schkolne, and Zoë Wood. Life is not complete without friends, and I am lucky enough to have too many to list. Of particular importance over these past five years are Chara Williams and Mary Baxter. A large cadre of best friends, most nonlocal, have kept me sane, healthy, and high-spirited over the years: John Greene, Dara Thompson, Amy Wilkinson, Cici Koenig, Cynthia Fay, Patricia Wong, Robert Pastor, Robert Stacy, and the BoDO gang: Mark Baker, Nelson Minar, and last but not least, Ron Resnick. Academic encouragement came from many fronts. First and foremost I thank Doug Lea for his subtle background influence in furthering my academic career—you are my invisible adviser. I also thank my various academic advisers over the years: Gregory Riccardi, David Kopriva, Steven Leach, and Charles Weems. Thanks also go to John Thornley for providing v remote encouragement when I needed it most and Eric Klavins for filling in as a last-second committee member. Several teachers, instructors, and professors have had an enormous impact on me over the years. I think this is unavoidable for someone who has lived through five degrees, three uni- versities, and numerous research stints at various places. I'd like to acknowledge the following individuals, some of whom might remember me with a smile, and others with a cringe. From Ft. Myers High School: Janet Marderness, Bruce Conover, and Barbara Kepler. From Florida State University: Theodore Baker, Paolo Aluffi, Steven Bellenot, Jim Gaunt, Robert Gilmer, Sam Huckaba, David Loper, Joe Mott, Daniel Oberlin, and Euliquio Young. From the University of Massachusetts at Amherst: James Kurose, Eliot Moss, Jack Wileden, Steven Cook, and Teresa Kellogg. From the Open Software Foundation: John Bowe, Murray Mazer, Ira Goldstein, and Ron Rebeiro. Finally, I'd like to thank my family for all of their support, encouragement, faith, and love. vi Abstract My contribution, described in this thesis, is a theory that is meant to assist in the construction of complex software systems. I propose a notion of structure that is independent of language, formalism, or problem domain. I call this new abstraction a kind, and its related formal system, kind theory. I define a type system that models the structural aspects of kind theory. I also define an algebra that models this type system and provides a logic in which one can specify and execute computations. A reflective definition of kind theory is reviewed. This reflective specification depends upon a basic ontology for mathematics. By specifying the theory in itself, I provide an example of how one can use kind theory to reason about reuse in general formal systems. I provide examples of the use of kind theory in reasoning about software constructs in several domains of software engineering. I also discuss a set of software tools that I have constructed that realize or use kind theory. A logical framework is used to specify a type theoretic and algebraic model for the theory. Using this basic theorem prover one can reason about software systems using kind theory. Also, I have constructed a reuse repository that supports online collaboration, houses software assets, helps search for components that match specifications, and more. This repository is designed to use kind theory (via the logical framework) for the representation of, and reasoning about, software assets. Finally, I propose a set of language-independent specification constructs called semantic properties which have a semantics specified in kind theory. I show several uses of these con- structs, all of which center on reasoning about reusable component-based software, by giving examples of how these constructs are applied to programming and specification languages. I discuss how the availability of these constructs and the associated theory impact the software development process. vii Notation Nearly all mathematical presentation constructs (e.g., theorems, axioms, etc.) are independently numbered. The only exception is corollaries which are numbered according to their associated theorem. Proofs are denoted by a leading Proof. or Proof of Theorem Title and are ended by a box. Logical rules are written in the standard style: Modus Ponens (MP) U U ) V V A rule named with an asterisk is reversible and summarizes two rules. Variables in rules are written in the default font if they represent arbitrary free entities. The basic Boolean values of true and false are denoted as > and ? respectively. The set of Boolean values is denoted by the symbol 2 = f>; ?g. We denote a ternary truth value of unknown with the symbol ?. The set of ternary truth values is specified by the symbol 3 = f>; ?; ?g. Arbitrary sets are written as A; B; C; : : : in italics. Algebraic sorts are written in the typeface Boolean; Int; Float; : : : and types are written in the typeface Boolean; Integer; Float; : : :. Models are written in calligraphic font M; N; O; : : :. Kinds are written as Poset; Universal; List; : : : and instances use the standard font I; J; : : :. Functions are named with lowercase roman and Greek letters or basic symbols as in f ; γ; : : :; choice of symbol will be made clear in the presentation. Functions are written inline in the <p typical fashions: <p: Kind ! Kind or, occasionally, Kind ! Kind. The identity function on an object X is idX : X ! X, or id : X ! X. Composition of functions f : X ! Y and g : Y ! Z is written g· f . viii Contents Acknowledgements iv Abstract vi List of Figures xix List of Tables xxi 1 Introduction 1 1.1 Motivation . 1 1.2 Aspects of Software . 2 1.2.1 Core Notions Derived from Software . 2 1.2.2 Subjectivity in Software . 3 1.2.3 Aspects of Information . 4 1.3 Related Work . 5 1.3.1 General Classification Theories . 5 1.3.2 Knowledge Theories . 6 1.3.2.1 Conceptual Spaces . 7 1.3.3 General Theoretical Foundations . 7 1.3.3.1 Category Theory . 7 1.3.3.2 Model Theory . 8 1.3.3.3 Paraconsistent and Other Deviant Logics . 8 1.3.4 Knowledge Representation . 10 1.3.5 Software Reuse . 10 1.3.5.1 Reuse Models . 10 1.3.5.2 Reuse Theories . 11 1.3.5.3 Reuse Technologies . 11 1.3.5.4 Asset Repositories . 12 1.3.6 Formal Methods . 13 1.3.7 Components and Composition . 14 ix 1.3.7.1 Concepts to Drive New Kinds . 14 1.3.7.2 Semantic Composition . 15 1.3.8 Knowledgeable Software Environments . 16 1.4 Contributions . 16 1.4.1 Theoretical . 16 1.4.2 Analysis of Existing Software Engineering Constructs . 17 1.4.3 Definition of New Constructs . 17 1.4.4 Tools . 18 1.4.5 Summary . 18 1.5 Overview . 18 1.5.1 A Classification of Kind Theory . 19 1.5.2 Theoretical Models . 19 1.5.3 Practical Models . 20 1.5.4 Systems . 21 1.6 Thesis Structure .