Skip to main content
QUICK REVIEW

[Paper Review] Smodels: A System for Answer Set Programming

Ilkka Niemelä, Patrik Simons|ArXiv.org|Mar 8, 2000
Logic, Reasoning, and KnowledgeComputer Science14 references95 citations
TL;DR

Smodels is a system for answer set programming that implements the stable model semantics for domain-restricted, function-free normal logic programs, extended with built-in functions, cardinality, and weight constraints. It uses a two-phase pipeline—lparse for grounding and translation, and smodels for efficient stable model computation via a Davis-Putnam-style backtracking search—demonstrating strong performance on real-world problems like planning, model checking, and constraint satisfaction.

ABSTRACT

The Smodels system implements the stable model semantics for normal logic programs. It handles a subclass of programs which contain no function symbols and are domain-restricted but supports extensions including built-in functions as well as cardinality and weight constraints. On top of this core engine more involved systems can be built. As an example, we have implemented total and partial stable model computation for disjunctive logic programs. An interesting application method is based on answer set programming, i.e., encoding an application problem as a set of rules so that its solutions are captured by the stable models of the rules. Smodels has been applied to a number of areas including planning, model checking, reachability analysis, product configuration, dynamic constraint satisfaction, and feature interaction.

Motivation & Objective

  • To provide a practical, efficient, and extensible system for answer set programming based on stable model semantics.
  • To support domain-restricted logic programs with built-in functions, cardinality, and weight constraints for expressive problem encoding.
  • To enable scalable computation of stable models for realistic applications involving hundreds of thousands of ground rules.
  • To offer a declarative, implementation-independent foundation that supports flexible optimization and integration into larger systems.

Proposed method

  • Transforms domain-restricted logic programs with variables into ground programs using a front-end tool, lparse, which evaluates domain predicates to determine variable ranges.
  • Translates grounded rules into primitive rules suitable for model generation, preserving the stable model semantics.
  • Employs a Davis-Putnam-like backtracking search procedure in smodels to compute stable models, leveraging inference and truth value propagation.
  • Supports cardinality and weight constraints via syntax that enforces bounds on the number or sum of satisfied literals in a model.
  • Integrates built-in functions (e.g., for integer arithmetic) to compactly encode complex constraints.
  • Provides an extensible API and dynamic loading of custom built-in functions for integration into C/C++ applications.

Experimental results

Research questions

  • RQ1How can stable model semantics be efficiently implemented for domain-restricted logic programs with constraints?
  • RQ2Can a system based on answer set programming outperform specialized tools in real-world applications like planning and model checking?
  • RQ3To what extent can built-in functions and cardinality/weight constraints enhance the expressiveness and efficiency of logic programming?
  • RQ4How scalable is the approach when applied to programs with hundreds of thousands of ground rules?
  • RQ5What mechanisms enable reliable and usable integration of the system into larger software systems?

Key findings

  • Smodels successfully computes stable models for logic programs with hundreds of thousands of non-trivial ground rules, demonstrating scalability beyond prototype stage.
  • The system outperforms commercial integer programming tools like CPLEX in a verification application, indicating competitive performance in complex domains.
  • The use of lparse for grounding and smodels for model search enables efficient handling of constraints and built-in functions while maintaining correctness.
  • The system supports advanced features such as total and partial stable model computation for disjunctive logic programs, extending its applicability.
  • Warnings in lparse for common errors (e.g., variable vs. constant misuse) improve usability and reduce user errors in program encoding.
  • The architecture allows embedding via API, enabling integration into C/C++ applications and supporting dynamic extension with custom built-in functions.

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.