Unformatted text preview: his chapter is to develop a simple logical account of behavioral inheritance (in the sense of code reuse) with overriding, providing for con ict resolution in the event of multiple inheritance. This we achieve by enriching the syntax of the logic so that the locality (i.e., point of de nition) and inheritability of properties (i.e., methods 35 and signatures) can be asserted and inferred. In addition, our language allows for a syntactic instruction for withdrawing property de nitions to prevent subclasses or instances from inheriting them. A special aspect of this latter feature is that it allows the programmer to in uence the logic's inheritance mechanism to suit her preferred needs. The above features were rst introduced in the context of ORLog (for Object Relationship Logic) 40]. In 40], we developed a declarative semantics for the higherorder features of ORLog, not including inheritance. In a preliminary version of the work contained in this chapter 42], we presented a declarative characterization of behavioral inheritance in ORLog and showed that con ict resolution in ORLog is possible in a relatively simple way. In 22], a stable model semantics for behavioral inheritance was proposed using notions of locality and inheritability similar to those proposed in 40]. By contrast, in the present discussion, we account for behavioral inheritance within the logic, by capturing it within a sound and complete proof theory. We also develop a modeltheoretic and xpoint semantics and establish the equivalence of all three semantics. Before closing this section, we note that a majority of the works on inheritance rely on a form of nonmonotonic reasoning. Of these, 29, 30, 47] capture value inheritance while 50, 22, 18] handle a form of behavioral inheritance. While a nonmonotonic account of inheritance is natural and interesting, it relies on extralogical features to capture inheritance. In addition, most of these proposals incur a high cost for query processing, which can be signi cant for database applications. In comparison, a complete proof theoretic and declarative account of inheritance is at once intellectually more satisfying and o ers a greater promise as an e cient computational platform. Interested readers are, however, referred to 47] for a more detailed survey and an eloquent discussion on the issues related to logic based objectoriented languages in general. The rest of this chapter is organized as follows. In section 3.3 we present the syntax and an informal semantics of inheritance. We then present a formal modeltheoretic semantics of ORLog in section 3.4, an Herbrand semantics in section 3.5, a proof procedure in section 3.6, and nally a xpoint semantics in section 3.7. In section 3.7 we also prove that (i) the xpoint semantics and the modeltheoretic semantics are equivalent, and (ii) the proof theory is sound and complete with respect to this semantics. 36 3.3 Overview of ORLog
In this section we discuss the salient features of ORLog, its syntax and inheritance semantics using an example. We also discuss, on intuitive grounds, the concepts of clause locality and inheritability that are unique to ORLog. 3.3.1 Syntax
The alphabet of the language L of ORLog is a tuple hC V M T P i, where (1) C is a denumerable set of constants playing the role of basic values and also object id's, (2) V is an in nite set of variables, (3) an in nite set of method symbols M for method names, (4) T is an in nite set of symbols for type names, and nally (5) P is an in nite set of predicate symbols. The set of terms Io = C V are called the idterms. A method denotation is an expression of the form mk , where m is a method symbol, k is a natural number and 7! is one of ! ! ), and ) 1. It says that m is a ! ) method of arity k and it takes on the incarnation ! ! ), or ) as indicated by ! ) 7!. Intuitively, ! and ! are used to denote data expressions and ) and ) are ! ) used for type or signature expressions, just as in Flogic. Throughout the paper we use the uppercase letters for variables and lowercase letters for constants. We use bold lowercase letters to denote arbitrary terms.
7! Atomic and Complex Formulas
There are nine types of atomic formulas in ORLog. If ak s, p and q are idterms in Io, tis are type names in T , r is a predicate symbol of arity n in P , and mk is a method denotation as de ned above, then the set of atomic formulas of ORLog is de ned as follows:
7! 1. the idatoms are of the form p ] which assert the existence of objects or types 2. the isa atoms are of the forms p : q and p :: q that state that object p is an instance or subclass of object q, where : (::) means immediate (transitive) instance/subclass
When a distinction is not important, we shall also use the notations 7!s and 7!d to stand for an element in f) ) and f! ! respectively. )g !g
1 37 3. the data atoms or datoms are of the form p m(a1 : : : ak ) ! a] or p m(a1 : : : ak )! b] which means when method m is invoked in the context of object...
View
Full Document
 Fall '09
 ObjectOriented Programming, Databases, Inheritance, ORLog, abstract data model

Click to edit the document details