74 42 reducing inheritance to deductions although all

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: approach to implementation. 74 4.2 Reducing Inheritance to Deductions Although all the above proposals have advantages, none is absolutely better than the other. But the most striking distinction of ORLog with these languages is in its simplicity and naturalness. In the following sections, we discuss an encoding scheme of ORLog into rst-order logic, and present a mechanism to reduce inheritance to deductions. We also prove that the encoding, and subsequently claim that the reduction, preserves the meaning of the original ORLog programs. This entails that introduction of non-logical constructs or procedurality is not essential for ORLog and a model for a program can still be computed by xpoint computation of the reduced programs. To distinguish between ORLog and the encoded and reduced ORLog, we call them respectively ORLog and F-ORLog (for rst-order ORLog). Notice that this reduction is possible only because ORLog has a clearly understood logical semantics of all its features. We organize the rest of this chapter as follows. We rst present an encoding scheme of ORLog in rst-order logic in section 4.2.1. Then in section 4.3 we present the inheritance reduction technique relying on the idea of inheritance completion, or i-completion and show its equivalence by relating the intended model of ORLog programs to perfect models of reduced programs. We also give an algorithm for translating ORLog programs to Coral deductive database language. We defer our discussion on the design choices and decisions until after this chapter. 4.2.1 Encoding ORLog in Predicate Logic Although ORLog enjoys a richer syntax than its predicate logic counterpart, it turns out that ORLog is no more expressive than predicate logic. In fact they are equivalent in terms of their expressive power. However, it is the case that ORLog syntax allows us to model and specify our domain of discourse in a very convenient way. Note that, in general higher-order syntax 24, 47] has been found to be useful to model complex objects and to reason about them. In this section we develop an encoding algorithm to show that ORLog is rst-order encodable, and the semantics of the encoded program is equivalent to the original program. This observation immediately indicates that it is possible to use a rst-order language to implement ORLog as a viable alternative to a more direct implementation. 75 First we present the encoding scheme as follows. Given an ORLog language L = hC V M T P i, we de ne Lencode = hC V M T P P F i to be a language in predicate logic such that P is a set of predicate symbols that includes fobject1, local2 , withdraw3, parent2, isa2, uses3, property4, participate2, relation2 g and F is a distinct set of function symbols applyn+1 one for each n 1. Given an ORLog formula , its encoding into predicate logic, , is given as the following recursive transformation rules. In the following rules encodea is a transformation that encodes ORLog atoms, and encodet encodes ORLog terms appearing in atomic ORLog formulas. encodet (X ) = X , for each variable X 2 V encodet (c) = c, for each constants c 2 C encodet (s) = s for each symbol s 2 M TP encodea (A _ B) = encodea (A) _ encodea (B) encodea (A ^ B) = encodea (A) ^ encodea (B) encodea (:A) = :encodea (A) p encodea ((QX )A) = (QX )encodea(A), where Q is either 9 or 8. Encoding of atomic formulas are given case by case as follows: { encodea(p ]) = object(encodet(p)) { encodea(p : q) = parent(encodet(p) encodet(q)) { encodea(p :: q) = isa(encodet(p) encodet(q)) { encodea(p mk ]) = local(encodet(p) m k type)1 { encodea(p mk < q]) = withdraw(encodet(p) encodet(q) m k type) { encodea(p mk > q]) = withdraw(encodet(q) encodet(p) m k type) { encodea(p q@mk ]) = uses(encodet(p) encodet(q) m k type) 7! 7! 7! 7! Here and in what follows, type is mapped to one of the constants in ffunc val func sig set val set sigg depending on 7!, where ! mapsto func val, ! mapsto set val, ) mapsto func sig, and ! nally ) mapsto set sig. ) 1 76 { encodea(r t1 : : : tn) = participate(encodet(r) applyn(encodet(t1) : : : { encodea(r(a1 : : : encodet (an ))) encodet (tn ))) an )) = relation(encodet(r) apply n (encodet(a1 ) : : : { encodea(p m(a1 : : : ak ) 7! a]) = property(encodet (p) m k type apply k (encodet (a1) : : : encodet (ak )) encodet (a)). Given an ORLog (Herbrand) Structure H = hH H H i with its Herbrand universe U and Herbrand base H, the corresponding predicate logic structure, encode(M) =< U IP >, is de ned as follows: IP (s) = s for every logical symbol s 2 U . < encodet(p) >2 IP (object) () H j= p ]. < encodet(p) encodet(q) >2 IP (parent) () H j= p : q. < encodet(p) encodet(q) >2 IP (isa) () H j= p :: q. < encodet(p) m k type >2 IP (local) () H j= p mk ]. 7! < encodet(p) encodet(q) m k type >2 IP (withdraw) () H j= p mk < q] _ q mk > p]. 7! 7! < encodet(r) applyn(encodet(t1) : : : encodet(tn)) >2 IP (participate) () H j= r t1 : : : tn. < encodet(r) applyn (encod...
View Full Document

This document was uploaded on 01/10/2011.

Ask a homework question - tutors are online