Unformatted text preview: d conflict traverse these tuples to decide inheritability. Hence a possible violation of local strati cation will occur in the Herbrand instantiation of P if the object hierarchy graph is cyclic. But since P, and hence Pi , is assumed to be i-consistent, the hierarchy graph is acyclic. Hence Pr must be locally strati ed for every consistent ORLog program. Also note that the encoded ORLog program is still de nite. The idea is to de ne a perfect model for the reduced program Pr , which is the union of the encoded program and the set of axioms in P , i.e., Pr = encode(Pi) P . Although the i-completed programs are conventional rst-order de nite programs, the reduced programs are normal Horn programs. Notice that the reduced program has all the machineries needed to compute a perfect model for Pr . Also note that the depends on relation \(" for ORLog programs still hold in Pr . Our de nitions of local strati cation and perfect models coincide with 64] and hence are identical. Note that the structure of Pr = h r r r i partly suggests a strati cation in a broad sense where r < r < r. The goal of the strati cation is to decompose the ground extension of a program Pr into di erent strata P 1 : : : P n such that Pr ] can be obtained as the disjoint union of these strata. The encoded intended models of reduced programs can now be computed by computing their perfect models using the standard recipes available for normal programs 7, 6].
r r r + + local uses + + possible
cycle conflict withdraw + parent + Figure 12: Dependency relation of predicates in P .
r 4.3.4 ORLog to Coral Translation Algorithm
We now present an algorithm that can be used to translate ORLog programs into F-ORLog programs that can be evaluated in Coral deductive database system using Coral query evaluator. Note that the actual implementation details are not an issue here, only the translation is. The translation algorithm is presented in Figure 13. Its termination and correctness are indirectly captured in the discussion that precedes this section. We present 83 a complete encoding of the i-completed program of Example 3.2 in Example 4.2. Algorithm Translation Input: An ORLog program P Output: A reduced F-ORLog program Pr begin
1. 2. 3. 4. Compute the l-closure Pp of P Compute i-completion Pi of Pp Encode Pi into Pe Obtain Pr as Pe P
r end. Figure 13: ORLog to Coral translation algorithm. Example 4.2 Consider the i-completed program P1 in Example 4.1. The encoding encode(P1 ) is the following rst-order program.
i i (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) object(o): object(p): object(q ): object(r): object(X ) parent(X o): object(Q): parent(r p): parent(r q ): parent(q o): parent(p o): withdraw(r p t 0 func val): withdraw(p r t 0 func val): isa(X X ) object(X ): isa(X Y ) parent(X Z ) isa(Z Y ): 84 (15) (16) (17) (18) (19) (20) (21) (22) (23) (24) (25) (26) (27) (28) local (P u 0 func val) parent(P o): local (o m 0 func val): local (o s 0 func val): local (q t 0 func val): local (p s 0 func val): local (p t 0 func val): local (Q v 0 func val): property(V m 0 func val apply () X ) property(V s 0 func val apply () X ) property(V v 0 func val apply () g ) uses(V o m 0 func val): property(V s 0 func val apply () 5) uses(V o s 0 func val): property(V u 0 func val apply () d) parent(V o) uses(V P u 0 func val): property(V s 0 func val apply () 2) uses(V p s 0 func val): property(V t 0 func val apply () a) uses(V p t 0 func val): property(V t 0 func val apply () c) uses(V q t 0 func val): property(V v 0 func val apply () g ) uses(V Q v 0 func val): 2 4.4 Implementability of ORLog
We conclude this section with the following remarks on the implementability of ORLog. It is clear from the encoding theorem 4.1 and the intuitive equivalence of reduction that for every i-consistent ORLog program P, there exists a perfect model for the corresponding reduced F-ORLog program Pr in the rst-order predicate logic i P has an intended model in ORLog. Furthermore, the encoding of the intended model is identical to the perfect model of the corresponding reduced program and vice-versa. This makes it possible to implement ORLog in any rst-order database system that is capable of computing perfect models of programs. As it will be clear that no meta-interpretation is necessary to compute perfect models of reduced programs. In 41], we explored the possibility of using LDL 32] as the host database system on which we built an ORLog interface. But its inability to support computation of perfect models based on local strati cation was a major disadvantage. Since coral incorporates perfect model semantics as part of its negation semantics, we are inclined to use Coral at this point to maximize our design goals. In the next chapter we discuss issues pertinent to the implementation of ORLog in Coral. 85 Chapter 5 Design and Implementation of ORLog
Although the research into deductive object-oriented database systems are relatively new, experimental prototypes have already started to emerge. Again due to lack of a common data model, every system that cam...
View Full Document