Download PDF

Theory and practice of logic programming

Publication date: 2006-01-01
Pages: 213 - 224
ISSN: 1471-0684
Publisher: Cambridge univ press

Author:

Schrijvers, Tom
Fruehwirth, Thom

Keywords:

declarative algorithms, time complexity analysis, disjoint-set problem, union-find algorithm, constraint handling rules, algorithms, Science & Technology, Technology, Computer Science, Software Engineering, Computer Science, Theory & Methods, Logic, Computer Science, Science & Technology - Other Topics, cs.PL, cs.CC, cs.DS, cs.PF, 0801 Artificial Intelligence and Image Processing, 0802 Computation Theory and Mathematics, 0803 Computer Software, Computation Theory & Mathematics, 4602 Artificial intelligence, 4613 Theory of computation

Abstract:

Constraint Handling Rules (CHR) is a committed-choice rule-based language that was originally intended for writing constraint solvers. In this paper we show that it is also possible to write the classic union-find algorithm and variants in CHR. The programs neither compromise in declarativeness nor efficiency. We study the time complexity of our programs: they match the almost-linear complexity of the best known imperative implementations. This fact is illustrated with experimental results.