Skip to main content
QUICK REVIEW

[Paper Review] dcs: An Implementation of DATALOG with Constraints

Deborah East, Mirosław Truszczyński|ArXiv.org|Mar 14, 2000
Logic, Reasoning, and KnowledgeComputer Science5 references15 citations
TL;DR

This paper presents DC, a DATALOG-based answer-set programming system that extends propositional logic with Horn rules and constraints to enable concise, efficient encodings of NP problems. By leveraging Horn rule closures to reduce theory size, DC outperforms SAT and stable model solvers on benchmarks like Hamilton cycles, N-queens, and Schur numbers, demonstrating superior performance due to compact encodings.

ABSTRACT

Answer-set programming (ASP) has emerged recently as a viable programming paradigm. We describe here an ASP system, DATALOG with constraints or DC, based on non-monotonic logic. Informally, DC theories consist of propositional clauses (constraints) and of Horn rules. The semantics is a simple and natural extension of the semantics of the propositional logic. However, thanks to the presence of Horn rules in the system, modeling of transitive closure becomes straightforward. We describe the syntax, use and implementation of DC and provide experimental results.

Motivation & Objective

  • To develop a practical answer-set programming system that combines propositional logic with Horn rules for modeling complex search problems.
  • To enable concise, human-readable encodings of NP-complete problems such as Hamilton cycles, graph coloring, and the N-queens problem.
  • To demonstrate that short encodings enabled by Horn rule closures lead to significant performance improvements over traditional SAT and stable model approaches.
  • To provide a system that supports incremental constraint addition and efficient debugging through modular design and informative error messages.

Proposed method

  • The system uses a three-part theory structure: constraints (TC), Horn rules (TH), and post-constraints (TPC), where answer sets are sets M ⊆ AtC satisfying TC and whose closure under TH satisfies TPC.
  • Horn rules are used to compute closures of sets satisfying constraints, enabling transitive closure and path reachability reasoning without explicit enumeration.
  • The implementation consists of two C modules—ground for grounding and dcs for solving—compiled with gcc, targeting portability across Linux and SPARC platforms.
  • A LookAhead procedure guides branching decisions by evaluating literals and selecting the most informative one for search efficiency.
  • The system supports incremental problem solving by allowing constraints to be added to an existing IDB without recompilation, facilitating dynamic problem modification.
  • Theoretical semantics extend propositional logic by incorporating non-monotonic closure via Horn rules, preserving simplicity while enabling expressive modeling.

Experimental results

Research questions

  • RQ1Can a DATALOG-based system with constraints and Horn rules achieve more compact encodings than standard SAT or stable model encodings?
  • RQ2Does the use of Horn rule closures significantly reduce the size of logic theories, leading to improved performance on NP problems?
  • RQ3Can DC outperform established systems like smodels and csat on benchmark problems such as Hamilton cycles and N-queens?
  • RQ4To what extent do short encodings enabled by Horn rules translate into measurable performance gains in practice?

Key findings

  • For Hamilton cycle problems, DC's theory size was drastically smaller than SAT (900 vs. 27,960 clauses) and smodels (1,212 vs. 621 atoms), with execution times under 1 second for 30-vertex graphs.
  • On Schur number problems, DC solved instances in under 0.2 seconds, while csat and smodels required over 1,500 seconds for the largest instance (4-45), demonstrating DC's scalability.
  • For 30-vertex graphs, DC solved Hamilton cycle problems in 0.12–0.23 seconds, outperforming csat (5.23–5.55 seconds) and smodels (1.91–51.04 seconds), especially on larger instances.
  • The use of Horn rules reduced theory size by up to 90% compared to SAT encodings, making large-scale problems like 40+ vertex graphs tractable where SAT failed.
  • DC's performance advantage was most pronounced in problems requiring transitive closure, such as Hamilton cycles, where Horn rules enabled compact, efficient encodings.
  • The LookAhead heuristic improved search efficiency by focusing on informative literals, contributing to faster convergence in the dcs solver.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.