Skip to main content
QUICK REVIEW

[Paper Review] A Compiler for Ordered Logic Programs

James P. Delgrande, Torsten Schaub|ArXiv.org|Mar 8, 2000
Logic, Reasoning, and Knowledge15 references8 citations
TL;DR

This paper presents PLP, a compiler that translates ordered logic programs—featuring explicit preference relations between rules—into standard extended logic programs under answer set semantics. By encoding preferences at the object level via atoms like $s\prec t$, PLP ensures that preferred answer sets in the original program correspond to stable models in the compiled output, enabling integration with existing systems like dlv and smodels without requiring new inference algorithms.

ABSTRACT

This paper describes a system, called PLP, for compiling ordered logic programs into standard logic programs under the answer set semantics. In an ordered logic program, rules are named by unique terms, and preferences among rules are given by a set of dedicated atoms. An ordered logic program is transformed into a second, regular, extended logic program wherein the preferences are respected, in that the answer sets obtained in the transformed theory correspond with the preferred answer sets of the original theory. Since the result of the translation is an extended logic program, existing logic programming systems can be used as underlying reasoning engine. In particular, PLP is conceived as a front-end to the logic programming systems dlv and smodels.

Motivation & Objective

  • To enable the use of existing logic programming systems (dlv, smodels) for reasoning with ordered logic programs without modifying their underlying algorithms.
  • To provide a declarative, extensible way to express preferences among rules and rule sets in nonmonotonic reasoning.
  • To support dynamic and contextual preferences, including preferences among preferences and default preferences.
  • To develop a practical front-end compiler that scales efficiently and integrates seamlessly with standard logic programming stacks.

Proposed method

  • The compiler translates an ordered logic program into a standard extended logic program where preference constraints are encoded using auxiliary atoms and default negation.
  • Rule names are introduced to allow preference statements like $s\prec t$ to express that rule $s$ is preferred over rule $t$.
  • The transformation ensures that answer sets of the compiled program correspond exactly to the preferred answer sets of the original ordered program under answer set semantics.
  • Set-ordered programs are supported by assigning names to sets of rules and expressing preferences between these sets via $m\prec m'$, enabling complex preference hierarchies.
  • The system uses Prolog to implement the compiler, leveraging standard constructs and ECLiPSe's pretty-printing for readable output.
  • The compiler is modular, with separate files for grounding, pretty-printing, and system-specific interfaces to dlv and smodels.

Experimental results

Research questions

  • RQ1Can preference information in logic programs be expressed at the object level without altering the underlying semantics or inference engine?
  • RQ2How can ordered logic programs be compiled into standard logic programs such that preferred answer sets are preserved?
  • RQ3What is the impact of supporting dynamic and contextual preferences, including preferences among preferences, on the compilation process?
  • RQ4To what extent can existing logic programming systems like dlv and smodels be reused for reasoning with ordered logic programs through a front-end compiler?
  • RQ5How does the performance of the compiled program scale with respect to the size and complexity of the original ordered logic program?

Key findings

  • The PLP compiler successfully translates ordered logic programs into standard extended logic programs such that the answer sets of the compiled program match the preferred answer sets of the original.
  • The system supports preferences between individual rules, sets of rules, and even preferences among preferences, enabling complex reasoning hierarchies.
  • The transformation is efficient, with the compiled program being polynomial in size relative to the input, ensuring scalability to real-world problem sizes.
  • The approach allows full reuse of dlv and smodels as reasoning back-ends, avoiding the need for custom inference algorithms.
  • The system has been implemented in ~300 lines of Prolog and runs on any platform where dlv or smodels are available, provided ECLiPSe Prolog is installed.
  • Evaluation using benchmarks from the TheoryBase system confirms that the method preserves semantic equivalence and scales effectively, even for complex nonmonotonic reasoning tasks.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.