Re: Transitive closure


Tim Finin (finin@cs.umbc.edu)
Thu, 06 Mar 2003 14:08:19 -0500


anjali1 wrote:
> The transitive closure relation works perfect. The only mistake that
> some of you might be making must be defining the transitive closure predicate
> first, then declaring the parent/2 predicate as :-hilog parent, followed by
> the ancestor relation. I too made the same mistake.
> However the correct method is to first declare the parent/2 predicate
> as hilog using :-hilog parent , followed by the generic transitive closure
> relation and in the end the ancestor relation. The thing of essence here is
> the order. If that is correct, then we do not have any problems.

This makes sense. If XSB were closer to being a pure logic based
language then the order would not make a difference. I can imagine
why the order is important in this case. Here's a reasonable way (or
maybe just an *easy* way) to implement hilog terms -- modify the term
*reader* so that when it reads a term, say foo(1,2,3), it checks to
see if foo has been declared as a hilog term. If not, it builds a
regular term. If so, it builds and returns the term
apply(foo,1,2,3).

So, the declaration of foo to be a hilog term will not effect any
programs or data loaded before the declaration, only terms read after
the declaration.



This archive was generated by hypermail 2.0b3 on Thu Mar 06 2003 - 14:08:46 EST