{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

slides01-13

# 2 invert the view de nitions so they are edb

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: gic to get rid of existential variables. 2. Invert the view de nitions, so they are EDB predicates with function symbols de ned in terms of a view. 3 Remember that the EDB" predicates are really global, abstract concepts as in IM, not stored relations. Example To invert the view v1X,Y :- parX,Z & parZ,Y 1 we get: parX,fX,Y :- v1X,Y parfX,Y,Y :- v1X,Y Notice that :- is a misnomer as far as the view de nition is concerned, but in the inverse rules it is simply an assertion that there are no bogus facts in the view. A More Complex Example Suppose we have EDB predicates global concepts f X; Y  and mX; Y , meaning that Y is the father or mother, respectively, of X . Our query is to nd all maternal ancestors" of an individual X , i.e., all females who are ancestors: r1: mancX,Y :- mX,Y r2: mancX,Y :- fX,Z & mancZ,Y r3: mancX,Y :- mX,Z & mancZ,Y The available views are: v1X,Y :- fX,Z & mZ,Y v2X,Y :- mX,Y Invert the Views r4: fX,gX,Y :- v1 X,Y r5: mgX,Y,Y :- v1 X,Y r6: mX,Y :- v2...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online