I try to use an optimization technique that assigns indexes and intervals in a
depth-first manner to the hierarchy of concepts and roles of an ontology.
city a location, country a location, coastalcity a city
location index=1, interval=[1-4]
city index=2, interval=[2-3]
coastalcity index=3, interval=[3-3]
country index=4 interval=[4-4]
Then a query q(X):- location(X) is rewritten to:
q(X):- class(X, Idx), Idx>=1, Idx <=4.
Hence all the following queries obtained from a rewriting algorithm:
q(X):-city(X) == q(X):-class(X,Idx), Idx>=2, Idx<=3.
q(X):-country(X) == q(X):-class(X, 4).
q(X):-coastalcity(X) == q(X):-class(X, 3).
will be included in the interval of the first one, and are redundant.
The problem is that XSB proves to be very slow on these indexed numbering
queries compared to the named predicates queries. Any reason for that? Any
to make it faster?
It's urgent and very important,
thank you very much,