Unformatted text preview: . Id(c) 2 D B.
Each basic type name in TB is associated with a basic domain of the same type, and each constructed (object) type name is associated with an object o 2 O that encodes the domain of objects of type in O. That is, Id( ) = D B for 2 TB , and Id( ) = o 2 O for 2 TO , where o is the semantic counterpart of the object type8 . Each symbol r in P of type 1 : : : D , i.e. Id(r) D 1 : : : D .
n n o ok j n is assigned a relation on D 1 ::: Each symbol m in M is associated with a set9 of partial functions of the form f : D 1 : : :D D 1 ::: D D 2D ], where there is exactly one such function in the set for a xed type associated with m. That is, Id(m) : : :D D 1 ::: D D 2D ]]. Here k=1 j =0 D 1 o 2 TO i = 1 : : : k and l 2 T , l = 0 : : : j , and o 2 TO .
1 o ok k i Note that the set of partial functions associated with m by Id relates m to a unique function for each type associated with m. This helps us overload method names and re ne them by allowing them to accept any number of arguments, and
Note that in what follows we use the notation A B ] and A 7! B ] to denote the set of all partial and total functions respectively from A to B . 8 Note that we use object ids 2 TO IO to represent object types that are associated with their semantic counterpart { the actual object o 2 O that the id represents. It is useful to think of o as a concise representation of the domain corresponding to all its instances in the structure S . 9 Recall that each method has a set of types associated with it.
7 47 use di erent implementations for each type associated with the same method name. Furthermore, we also allow one function per type. For example, we can de ne a method child with a signature person child(year) ) fpersong] which refers to all the children of a person in a given year, and another method child with a signature person child(spouse) ) fpersong] refers to the set of children with a given spouse. (Here person is the context of the method.) Note that (i) for methods m de ned in objects the index k = 1 and D refers to the implicit argument (the object acting as the context for the method). (ii) for methods in relationships10, k 1 and in this case D 1 : : :D refers to the (explicit) key of the relation r of types 1 : : : k . In this case, the key acts as the context of the method. Also, note that a method may return a single or a set structured value, depending on its signature. We next consider the function Is.
ok o ok Is acts as the identity function on each oid i 2 IO , i.e. Is(i) = i 2 TO .
Each constant c in C is associated with its intended type, i.e, Is(c) = , for some type 2 TB . the arity of r.
j 8 2T. k Each predicate symbol r 2 P is assigned its type, i.e, Is(r) 2 TO , where k is
Is acts as the identity function on type names, i.e. Is( ) = Each symbol m in M is associated with a set of type tuples of the form < o1 , : : :, o , 1 : : : k ft1 : : : tng >, which represent the (function) type o : : : j : : : k ! ft1 : : : tng. That is, Is(m) j=1 k=0 TO T k 2 ]. o 1
j
1 T The functions L and L associate with each symbol m 2 M a set of partial functions of the form f : N 2 , where there is exactly one such function in the set for a xed arity associated with m, i.e., L : M ! N 2 ]. That is, L (m)(k) O, and similarly for L (m)(k) O. Here k is a natural number in N B and corresponds to an arity of the method m. Intuitively, it means that a method de nition (similarly a method signature) of arity k is locally available at each object o 2 L (m)(k) (similarly, o 2 L (m)(k)).
7!d 7!s O 7! O 7!d 7!s 7! d 7!s In ORLog, we allow relations to have methods, or virtual attributes, as much the same way the objects do. This follows from the underlying semantic data model, the OR model, on which ORLog is based.
10 48 The functions C and C associate with each method symbol m 2 M of arity k and object o 2 O, a unique object p 2 O. Formally C : M ! N ! O 7! O]], where each m is associated with a total function N ! O 7! O]. Intuitively, whenever C (m)(k)(o) = p, it says that object o may use the de nition or signature of m of arity k from the object p. We will later see that de ning suitable additional properties for these functions, it is possible to achieve con ict free inheritance of methods and signatures in the object hierarchies and to capture the semantics of withdrawal in a clean declarative manner. Finally, the functions W and W associate with each method symbol m 2 M of arity k and object o 2 O, a set of objects in O. Formally W : M ! N ! O 2 ]]. That is, whenever p 2 W (m)(k)(o), it means that method m (both data and signature) if de ned in the immediate superclass p of o, is withdrawn from o (for inheritance purposes). As a result o can not inherit this method from p. A variable assignment : V ! D is a function that assigns each basic domain variable X an element of B of appropriate sort, and assigns each id variable X an object from O. Variable assignments can be extended recursively to all formulas in the obvious manner. Let S be a semantic...
View
Full Document
 Fall '09
 ObjectOriented Programming, Databases, Inheritance, ORLog, abstract data model

Click to edit the document details