Parallel Instantiation of ASP Programs: Techniques and Experiments

Parallel Instantiation of ASP Programs: Techniques and Experiments
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

Answer Set Programming (ASP) is a powerful logic-based programming language, which is enjoying increasing interest within the scientific community and (very recently) in industry. The evaluation of ASP programs is traditionally carried out in two steps. At the first step an input program P undergoes the so-called instantiation (or grounding) process, which produces a program P’ semantically equivalent to P, but not containing any variable; in turn, P’ is evaluated by using a backtracking search algorithm in the second step. It is well-known that instantiation is important for the efficiency of the whole evaluation, might become a bottleneck in common situations, is crucial in several realworld applications, and is particularly relevant when huge input data has to be dealt with. At the time of this writing, the available instantiator modules are not able to exploit satisfactorily the latest hardware, featuring multi-core/multi-processor SMP (Symmetric MultiProcessing) technologies. This paper presents some parallel instantiation techniques, including load-balancing and granularity control heuristics, which allow for the effective exploitation of the processing power offered by modern SMP machines. This is confirmed by an extensive experimental analysis herein reported. To appear in Theory and Practice of Logic Programming (TPLP). KEYWORDS: Answer Set Programming, Instantiation, Parallelism, Heuristics


💡 Research Summary

**
The paper addresses a critical performance bottleneck in Answer Set Programming (ASP) systems: the grounding (instantiation) phase, which transforms a program with variables into an equivalent variable‑free program before the actual answer‑set search begins. While this phase is essential for the overall efficiency of ASP evaluation, existing grounders are essentially single‑threaded and cannot exploit the parallel processing capabilities of modern multi‑core symmetric multiprocessing (SMP) machines. To overcome this limitation, the authors propose a comprehensive parallel grounding framework that operates on three hierarchical levels—components, rules, and single‑rule—and integrates dynamic load‑balancing together with cheap granularity‑control heuristics.

Component‑level parallelism: The input program is first represented as a dependency graph whose nodes are IDB predicates and whose arcs capture positive body dependencies. Strongly connected components (SCCs) of this graph define modules that can be evaluated independently once their predecessor modules have been grounded. By performing a topological ordering of SCCs, the system can launch multiple modules in parallel whenever they are mutually independent, thereby reducing the size of intermediate groundings and avoiding a combinatorial explosion of candidate atoms.

Rule‑level parallelism: Within each module, rules are classified as exit (non‑recursive) or recursive. Exit rules are grounded concurrently using facts already produced by predecessor modules. Recursive rules are handled by a semi‑naïve evaluation loop: at each iteration, all recursive rules are grounded in parallel, but only the newly derived facts from the previous iteration are considered. This limits redundant work and preserves correctness while still exploiting parallelism across rules.

Single‑rule level parallelism: The first two levels are ineffective for programs that contain only a few rules (e.g., classic graph‑coloring encodings). To address such cases, the authors introduce a novel strategy that partitions the extension of a single rule’s literals into several disjoint sub‑domains. Each sub‑domain is processed by a separate thread, effectively parallelising the grounding of a single rule. The size of each partition is not fixed; instead, a granularity‑control heuristic estimates the computational cost of grounding a sub‑task based on the number of variables, the size of the current extensional database, and the selectivity of literals. If the estimated cost is low, larger partitions are used to keep overhead minimal; if high, finer partitions are created to balance the workload.

Dynamic load‑balancing: Because the actual cost of grounding sub‑tasks can deviate from heuristic estimates, the system continuously monitors the work queues of all threads. When an imbalance is detected, pending tasks are redistributed among idle cores. Load‑balancing is triggered only when the granularity of tasks is sufficiently fine, thus avoiding excessive context‑switching overhead.

The implementation builds upon the state‑of‑the‑art DLV grounder, extending it with support for aggregates, richer input syntax, and optimized I/O handling. An extensive experimental campaign was conducted on a set of publicly available benchmarks (graph coloring, scheduling, database queries, etc.) using machines equipped with 2 to 8 cores. The results demonstrate:

  • Super‑linear speed‑ups for “easy‑to‑parallelise” instances where many rules can be processed independently; e.g., up to 12× acceleration on an 8‑core machine.
  • Near‑optimal efficiencies (80–90 % of the ideal linear speed‑up) for “hard‑to‑parallelise” instances that involve few rules and heavy recursion, thanks to the single‑rule parallelism and granularity control.
  • Significant gains even with only two cores (≈1.8× speed‑up), confirming that the framework is beneficial on typical consumer hardware.
  • Scalability that remains stable as the problem size grows; efficiency does not degrade when the number of ground atoms increases dramatically.

A comparative analysis with the earlier parallel grounding approach by Calimeri et al. (2008) shows that the new three‑level scheme not only subsumes the previous component‑ and rule‑level techniques but also extends applicability to programs where those techniques alone would be ineffective.

In conclusion, the paper delivers a practical, well‑engineered solution for parallel ASP grounding. By combining hierarchical parallelism, adaptive granularity heuristics, and runtime load‑balancing, it enables ASP systems to fully exploit modern multi‑core architectures, thereby reducing grounding time from a potential bottleneck to a scalable component. The techniques are generic enough to be integrated into other ASP systems and are likely to become a standard part of future high‑performance ASP solvers.


Comments & Academic Discussion

Loading comments...

Leave a Comment