Kind Theory and Software Reuse - Semantic Scholar

2 downloads 11541 Views 231KB Size Report
It provides a formal framework for describing, finding, customizing, composing, and ... using kind theory is that of software, particularly with regards to software as ...
Kind Theory and Software Reuse Joseph R. Kiniry Security of Systems Group Nijmegen Institute for Computing and Information Science Toernooiveld 1, 6525 ED Nijmegen, The Netherlands [email protected]

Abstract. Kind theory is a logic for describing and reasoning about structured knowledge in communities. It provides a formal framework for describing, finding, customizing, composing, and reasoning about structured domains, such as those of software and mathematics. One of the main domains studied using kind theory is that of software, particularly with regards to software as reusable knowledge about computation. This paper summarizes kind theory and several example applications of the theory for topics relating to software reuse.

1

Introduction

Kind theory is a logic for reasoning about reusable artifacts. Kinds are the entities within the logic used to classify instances. One can think of kinds as a sort of ontological first-class classifier, much like types in type theories and sorts in algebras, but with additional knowledge-centric structure and user-definable semantics and models. Kind theory’s definition is the result of analyzing (a) several branches of mathematics, (b) several formal methods for software and knowledge engineering, and (c) the tools and technologies used in the software creation process, particularly those that help people collaborate and (re)use software. This analysis drove the definition of the core constructs and axioms of kind theory1 . Kind theory includes a large number of tertiary new ideas, but unfortunately there is insufficient space to discuss them here. Examples include an innovative syntax that combines aspects of syntax (wellformedness) and semantics, the use of canonicality for renaming, the classification of data and behavior by an interpretive context, and the explicit introduction of agents that are not necessarily human. The interested reader should look to the author’s dissertation for more information [14]. Kind theory can be used to reason about reusable structured information in any domain. Thus, because the theory is quite generic, it must have numerous models (theoretically and colloquially). Software and mathematics were the natural “first application targets”, but only the former is discussed in this paper. The bulk of the work in the field of software reuse focuses on languages, tools, and systems that promote, encourage, or simplify reuse. Very little of this work has a formal foundation, and as of yet, there is no formal, general “theory of reuse”. Kind theory is meant to be one possibility for such a theory. This paper is only meant to give the reader a taste of kind theory and its application to some of the problems of reuse-centric software engineering.

2

Software as Knowledge

Software systems are more complicated today than at any point in the history of computing. Projects consisting of millions of lines of program code, written in a dozen languages, and developed and maintained by hundreds of people across multiple companies are now commonplace. The development of software systems, realized by the practice of software engineering, is primarily characterized by its complexity and variety. There are hundreds of languages, tools, and technologies to choose from for any given domain. The field of software engineering research has similar variety as there are an enormous number of formalisms, methodologies, and approaches. 1

The complete set of logical rules of kind theory are included on the final page of this paper.

Software is a young discipline, so it is unsurprising that this state of affairs is similar to that which more mature fields, such as manufacturing, faced many years ago. Until the development of standard measures, tools, and terminology, manufacturing was a cottage industry [2]. Independent manufacturers created their custom wares in their own manner and with their own tools and parts. The result of which often showed poor workmanship, irregularities, inconsistency, and incompatibility. The same can be said for software today. The desire for an “a la carte” approach to software engineering is often expressed by researchers and practitioners. Developers want the ability to pick and choose formalisms, tools, and technologies for each new problem. But the current state of affairs, characterized by fiefdoms of theory and technology, does not lend itself to this approach. One way to help realize this goal is to provide a “bridging formalism”. Such a theory might help software engineers, in a collaborative and distributed fashion, express the commonalities and differences between the various options (of formalisms, tools, technologies, etc.) available. If this information were to be collected from the software community and made publicly available, perhaps explicitly via a Web site and implicitly as part of popular integrated development environments, then the community as a whole would benefit. The web-based technology constructed to demonstrate kind theory’s utility as a reuse repository is called “Jiki” and is discussed in the aforementioned dissertation. The Jiki is a distributed component-based “wiki” (a read/write web space) which holds artifacts of numerous types (text, program code, images, etc.). Each of these artifacts is classified by a (set of) kind, and the user can manipulate the artifacts directly in a web browser.

Fig. 1. Stating Beliefs via a Web Interface

One example of such manipulation is the statement of semantics about a construct. Figure 1 shows an example form-based web interface used within the Jiki to state the beliefs of the user about the kind S ET, the kind used to denote the notion of a set in set theory. Describing the commonalities and differences between the various theory, tools, and technologies of software engineering can be accomplished in many ways. Several abstract branches of mathematics exist that can be used to describe and reason about such structures, but these options are overly general and abstract. They do not focus on the problems specific to representing and reasoning about structured ambiguous knowledge in communities. This paper summarizes an integrated set of theories and related software tools whose purpose is helping communities describe, construct, and reason about their complex reusable artifacts. The first two domains analyzed using these theories and tools were software systems and mathematics [14].

3

A Classification of Kind Theory

Kind theory is a non-classical, autoepistemic, paraconsistent, self-reflective logic. That is to say, kind theory has more than two truth values (i.e., true and false), it can be used to describe the self-knowledge of individuals, a context need not be (classically) logically consistent in order to make sound judgments, and kind theory has been used to describe itself. As this is quite a mix of non-standard approaches to several problems, each aspect of kind theory is described in a bit more detail below. The interested reader can check the bibliography to find more information about kind theory [14] and published results that depend upon it including work on component specification, code annotations, distribute knowledge capture, and theorem proving user interface design [13, 16–19]. Ultimately, the formal application of kind theory to a particular problem domain comes down to choosing which combination of theories is the appropriate model for the domain, and describing those theories within kind theory. Many basic mathematical and software domains have already been specified within kind theory, so some of the time this process is quite simple. After reviewing the formal aspects of kind theory including its classification and basic operators, an example of its use in the domain of reuse-centric software engineering is presented. Non-Classical When asked whether something is absolutely true or absolutely false, most people say “I don’t know” or “it is not either completely true or completely false”. This gray area of truth can be represented in logic and mathematics any number of ways. Most of these representations deal with gradations of truth, sometimes encoded in a truth predicate, and other times with probability theory or with modal or non-classical logics. What all of these representations have in common is that they have an underlying non-classical formal formulation—a basic logic that has more than two, and possibly infinite, truth values. As kind theory’s primary purpose is to be used describe “what is thought about things” (in a very general sense), then it is natural to choose a non-classical foundation. But, as domains, researchers, and tools have different models for representing the “grayness” of truth, kind theory does not stipulate one particular representation. A generic theoretical structure is defined that is sufficient for all reasoning within the logical, leaving the choice of model up to the user, given his or her domain, goals, and tools. For example, many logicians are unfamiliar and uncomfortable with non-classical logics, thus the model adopted by such users for kind theory’s truth structures (the operators “belief” and “claim” used to define semantics) might be simply a lifting function on sentences and truth values (thus, converting a multi-valued logic to a classical logic). Autoepistemic Autoepistemic logics let one describe and reason about one’s own knowledge and beliefs. There are a number of autoepistemic logics available today, most of which are non-monotonic (as is kind theory).

Their purpose is primarily to help draw conclusions with incomplete, introspective information. They also focus on the fact that not only knowledge, but the absence of knowledge, enables certain judgments [31]. Kind theory is autoepistemic for the same reasons. It is a non-classical logic with three truth values, one of which represents the absence of knowledge. Additionally, because its core semantics is (intentionally, logically) weak, its models are existing autoepistemic logics. In particular, the logics adopted as models by the multi-agent research community for knowledge representation languages like KQML and OWL are potential lightweight autoepistemic logics that work well with kind theory. Paraconsistent Paraconsistent logics are those that can deal with logical inconsistencies of various types [32]. These logics’ primary purpose is formally modeling the messy “real world”, a world that contains contradictions of various sorts, but in which humans can operate and reason without issue [1, 24]. Most paraconsistent logics are non-classical. Their development originates from artificial intelligence research in the fields of knowledge representation and engineering. As they are a relatively recent addition to the logician’s toolbox, they are still outside the mainstream of logic. Thus, only a relatively small number of examples have been developed over the past twenty years. Kind theory is a paraconsistent logic because, in formalizing and reasoning about a collaborating group of individuals’ beliefs, inconsistency is frequent. Likewise, temporary, intentional inconsistency is a hallmark of software engineering—systems under development are necessarily inconsistent and incomplete because they are not fully elucidated from a requirements or an engineering point of view [10]. Thus, kind theory has the aspects of existing paraconsistent logics, and many of these logics are models for kind theory. Self-Reflective Finally, kind theory is self-reflective because it has been partially expressed within itself and an experiment in representing reusable mathematical structures.

4

Operators

The cornerstone of kind theory is structure. Structure is characterized by the properties of an object, the relationships in which it is involved, and the manner in which it is interpreted by an observer. Consider Figure 2. The Universe is the unbounded set of all kinds and instances. Portions of that universe are domains which collect specialized areas of knowledge in the universe. Each kind can belong to many such domains or none at all. The latter of which are called extra-domain kind. A context is created by an agent. The agent chooses specific domains and extra-domain kinds and collects them in a context. This context is interpreted in a number of different ways, depending upon exactly which domains and kinds are part of the context. The interpretation takes place in an interpretation system, specified again, by the current context. The interpretation system need not be a formal system; a human expert reading a context, performing the interpretation in his or her mind, and making some inference based upon his or her experience is a legitimate interpretation system. Other legitimate interpretations are queries (for example, on a database) and judgments (on a logical system, for instance). The results of these interpretations can be named, reinserted into the universe, then introduced into the current context, starting the cycle anew. The most important point about these interpretations is that they are structure-preserving. And, since semantics is a part of structure, interpretations are also semantics-preserving. Thus, interpretations can be viewed as semantics-preserving functions.

Fig. 2. Pictorial Overview of Kind Theory Domains

Universe Extra−domain Kind

Kind Creation

Inclusion

Agent Queries

Interpretation

Judgments Logical Structure

Context Modification

Context

Interpretation System

Core Operators Kinds are described using a small set of operators, completely defined in Figure 3. Classification is covered with the inheritance operators < and