Table of Contents
Fetching ...

Efficiency of Analysis of Transitive Relations using Query-Driven, Ground-and-Solve, and Fact-Driven Inference

Yanhong A. Liu, Scott D. Stoller, John Idogun, Yi Tong

TL;DR

The paper addresses the problem of predicting and comparing the efficiency of three major rule-based inference paradigms—query-driven, ground-and-solve, and fact-driven—in analyzing transitive relations. It provides precise optimal time-complexity formulas for all rule-variant and graph-type combinations, and validates the theory with detailed performance measurements using XSB, clingo, and Soufflé. Key findings show that left recursion is typically more efficient across systems, that input graph shape can drastically affect costs, and that the best system depends on whether standalone code or constraint solving is required. The work offers practical guidance for selecting rule systems and identifies avenues for improvements in grounding, tabling, and incrementalization to push toward closer adherence to optimal complexities.

Abstract

Logic rules allow analysis of complex relationships, especially including transitive relations, to be expressed easily and clearly. Rule systems allow queries using such rules to be done automatically. It is well known that rule systems using different inference methods can have very different efficiency on the same rules and queries. In fact, different variants of rules and queries expressing the same relationships can have more drastically different efficiency in the same rule system. Many other differences can also cause differences in efficiency. What exactly are the differences? Can we capture them exactly and predict efficiency precisely? What are the best systems to use? This paper analyzes together the efficiency of all three types of well-known inference methods -- query-driven, ground-and-solve, and fact-driven -- with optimizations, and compares with optimal complexities for the first time, especially for analyzing transitive relations. We also experiment with rule systems widely considered to have best performances for each type. We analyze all well-known variants of the rules and examine a wide variety of input relationship graphs. Our results include precisely calculated optimal time complexities; exact explanations and comparisons across different inference methods, rule variants, and graph types; confirmation with detailed measurements from performance experiments; and answers to the key questions above.

Efficiency of Analysis of Transitive Relations using Query-Driven, Ground-and-Solve, and Fact-Driven Inference

TL;DR

The paper addresses the problem of predicting and comparing the efficiency of three major rule-based inference paradigms—query-driven, ground-and-solve, and fact-driven—in analyzing transitive relations. It provides precise optimal time-complexity formulas for all rule-variant and graph-type combinations, and validates the theory with detailed performance measurements using XSB, clingo, and Soufflé. Key findings show that left recursion is typically more efficient across systems, that input graph shape can drastically affect costs, and that the best system depends on whether standalone code or constraint solving is required. The work offers practical guidance for selecting rule systems and identifies avenues for improvements in grounding, tabling, and incrementalization to push toward closer adherence to optimal complexities.

Abstract

Logic rules allow analysis of complex relationships, especially including transitive relations, to be expressed easily and clearly. Rule systems allow queries using such rules to be done automatically. It is well known that rule systems using different inference methods can have very different efficiency on the same rules and queries. In fact, different variants of rules and queries expressing the same relationships can have more drastically different efficiency in the same rule system. Many other differences can also cause differences in efficiency. What exactly are the differences? Can we capture them exactly and predict efficiency precisely? What are the best systems to use? This paper analyzes together the efficiency of all three types of well-known inference methods -- query-driven, ground-and-solve, and fact-driven -- with optimizations, and compares with optimal complexities for the first time, especially for analyzing transitive relations. We also experiment with rule systems widely considered to have best performances for each type. We analyze all well-known variants of the rules and examine a wide variety of input relationship graphs. Our results include precisely calculated optimal time complexities; exact explanations and comparisons across different inference methods, rule variants, and graph types; confirmation with detailed measurements from performance experiments; and answers to the key questions above.
Paper Structure (9 sections, 1 table)