Page 1 of 1

TCLOSE gives incorrect result

Posted: Fri Mar 19, 2010 3:19 pm
by HughDarwen
I tried
tclose(relation{tuple{x 1, y 2}, tuple{x 2, y 3}, tuple {x 3, y 4}})
and got
RELATION {x INTEGER, y INTEGER} {
TUPLE {x 1, y 2},
TUPLE {x 2, y 3},
TUPLE {x 3, y 4}
}

I think I should have got
RELATION {x INTEGER, y INTEGER} {
TUPLE {x 1, y 2},
TUPLE {x 2, y 3},
TUPLE {x 2, y 3},
TUPLE {x 1, y 4},
TUPLE {x 2, y 4},
TUPLE {x 3, y 4}
}

Hugh

Re: TCLOSE gives incorrect result

Posted: Fri Mar 19, 2010 9:39 pm
by Dave
As noted under "Limitations" at http://dbappbuilder.sourceforge.net/Rel.html, TCLOSE is not implemented yet. Sorry. :( The input relation is passed, unchanged, to the output.

I've been trying, almost since the start of Rel, to persuade a student to tackle the implementation for a final-year undergraduate dissertation. Exploring different transitive closure algorithms and comparing their speed and memory consumption, plus perhaps investigating applications for TCLOSE, would make an excellent project. Unfortunately, I've not yet managed to convince a student to do it. At some point, I'll probably wind up implementing it myself.