Unformatted text preview: p ! with arguments a1 : : : ak , it returns a functional output a, or similarly a set valued2 output of which b is a member 4. the signature atoms or satoms are of the form p m(t1 : : : tk ) ) ft1 : : :tn g] or p m(t1 : : : tk ) ) ft1 : : : tn g] which have a similar meaning as the datoms { ) when invoked in object p with argument types t1 : : : tk, the method m returns an output (functional or set valued) which simultaneously belongs to the types ft1 : : : tng
0 0 0 0 0 0 5. the locality atoms or latoms are of the form p mk ] which states that the data or signature (as determined by whether 7! is one of !, ! or one of ), ) ) ! ) of method m whose (input) arity is k is locally de ned in object p
7! 6. the inheritability atoms or iatoms are of the form p [email protected] ] that speci es that the object p may use (or inherit) the method mk from object q
7! 7! 7. the participation atoms or ratoms are of the form r t1 : : : tn that states that r is a relationship (relation) involving object types t1 : : : tn. 8. the predicate atoms or predatoms are of the form r(a1 : : : an ) whose meaning is exactly as in classical logic. 9. and nally, the withdrawal atoms3 or watoms are of the form p mk > q] and p mk < q ] that captures the fact that the inheritance of the method mk is blocked ( > ) from the object p to q, or is inhibited ( < ) in p from q . Blocking is used when a superclass prevents an immediate subclass/instance from inheriting a property, whereas inhibition is used when a subclass/instance rejects the inheritance of a property from an immediate superclass. The formulas of L are de ned as usual. A literal is either an atom (A) or its negation (:A). Every literal is a well formed formula. If F and G are well formed
7! 7! 7! Following Flogic, we also permit molecules as a syntactic abbreviation for conjunctions of atoms. E.g., p m1 (a1 : : : ak ) ! b1 : : : mn (c1 : : : cm ) ! bn ] p m1 (a1 : : : ak ) ! b1 ]^ : : : ^ p mn (c1 : : : cm ) ! bn ]. Similarly, p m(a1 : : : ak )! b1 : : : bng] p m(a1 : : : ak )! b1] ^ : : : ^ !f ! p m(a1 : : : ak )! bn ]. A di erence between a set valued method and a functional method is that ! we enforce functionality requirement for the latter but not for the former. 3 It turns out that one of blocking or inhibition is su cient for our purposes. However, we keep both the constructs for data modeling convenience.
2 38 formulas and X is a variable, then so are F ^ G, F _ G , :F , (F ), 8X (F ), 9X (F ), and F G . A formula that contains no variables is called a ground formula. We follow the standard practice in logic programming and consider only the de nite Horn clause fragment of our language for the rest of the paper. Hence clauses in an ORLog program are of the form A B1 : : : Bm, where A is called the head atom and Bis are called the body literals. We assume that all the variables in a clause are universally quanti ed. If the head atom A of a clause A B1 : : : Bm is a d or satom, then we call it a d or sclause respectively. When convenient, we use the term property as a neutral term which refers to data or signature of methods. Thus, a propertyclause (pclause) is either a dclause or an sclause. Furthermore, in a pclause of the form o m(a1 : : : ak ) 7! a] B1 : : : Bm, we refer to o as the descriptor, or the context, of the pclause. In an analogous way we de ne isa, l, id, i, r, pred and wclauses based on the head atoms of the form isa, l, id, i, r, pred and watoms respectively. Recall that variables and constants are written in upper and lowercase strings respectively. We use the letters O P Q R (respectively, o p q r or o p q r) for variables (respectively constants, or arbitrary terms) representing object ids m, s, t, u, v, etc. for method names, a b c d 1 2 3 for constants and basic values W X Y Z , etc. for variables and so on. Programs in ORLog specify objects, their structures and behaviors through signature and method de nitions and organize objects in inheritance hierarchies through isa speci cations. Relationships among objects are speci ed using the relationships and predicates. De nition 3.1 (Programs) An ORLog program P is a triple of the form h
where, i is a (possibly empty) set of isa, l, id, and wclauses where the body literals are either isa, l, id, or watoms. is a (possibly empty) set of iclauses with body literals from isa, l, id, watoms or iatoms, and is a (possibly empty) set of p, pred and rclauses whose body literals are arbitrary atoms in L. 2 Intuitively, the clauses in de ne the isa hierarchy of classes and instances, the locality of clauses, objects, and the inheritance control information in the form of 39 withdrawal de nitions. The clauses in de ne the inheritability of clauses and nally the clauses in de ne properties for objects, and relationships among classes of objects. Note that in the above de nition, we have introduced an implicit dependency relation \(" such that ( and ( , which means that depends on and depe...
View
Full Document
 Fall '09
 ObjectOriented Programming, Databases, Inheritance, ORLog, abstract data model

Click to edit the document details