The data atoms or d atoms are of the form p ma1 ak

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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 s-atoms 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 d-atoms { ) 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 l-atoms 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 i-atoms 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 r-atoms 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 pred-atoms are of the form r(a1 : : : an ) whose meaning is exactly as in classical logic. 9. and nally, the withdrawal atoms3 or w-atoms 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 F-logic, 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 s-atom, then we call it a d- or s-clause respectively. When convenient, we use the term property as a neutral term which refers to data or signature of methods. Thus, a propertyclause (p-clause) is either a d-clause or an s-clause. Furthermore, in a p-clause of the form o m(a1 : : : ak ) 7! a] B1 : : : Bm, we refer to o as the descriptor, or the context, of the p-clause. In an analogous way we de ne is-a, l-, id-, i-, r-, pred- and w-clauses based on the head atoms of the form is-a, l-, id-, i-, r-, pred- and w-atoms 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 is-a 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 is-a, l-, id-, and w-clauses where the body literals are either is-a, l-, id-, or w-atoms. is a (possibly empty) set of i-clauses with body literals from is-a, l-, id-, w-atoms or i-atoms, and is a (possibly empty) set of p-, pred- and r-clauses whose body literals are arbitrary atoms in L. 2 Intuitively, the clauses in de ne the is-a 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

{[ snackBarMessage ]}

Ask a homework question - tutors are online