Eliminating Disjunction in Logic Programs

You are reading version 1 of this direction, frozen 2026-10-04. The latest version is version 2.

Version 1 of 220 papers26 conceptsfrozen 2026-10-04

In computational logic, disjunction—the ability to say "A or B is true"—is a double-edged sword. While it allows us to model uncertainty and non-deterministic choices, it significantly increases the computational cost of finding solutions. In the world of Answer Set Programming (ASP), moving from "normal" logic programs to "disjunctive" ones typically jumps the complexity of reasoning from NP-complete to the second level of the polynomial hierarchy ($\Pi^P_2$-complete).

To bridge this gap, researchers have developed a suite of techniques to "eliminate" disjunction, transforming complex disjunctive rules into simpler, normal rules that high-performance solvers can handle efficiently.

The Intuition of Shifting

The core mechanism for removing disjunction is a technique known as shifting. Imagine a rule that says if a condition $C$ is met, then either $A$ or $B$ must be true: $$A \lor B \leftarrow C$$ The "shifting" insight is that we can treat the choice between $A$ and $B$ as a form of negation. If we assume $B$ is not true, then $A$ must be true. We can rewrite the disjunctive rule into two normal rules: $$A \leftarrow C, \text{not } B$$ $$B \leftarrow C, \text{not } A$$ Miroslaw Truszczynski and Stefan Woltran explored this in Hyperequivalence of Logic Programs with Respect to Supported Models, showing that under certain semantics, these transformations preserve the "hyperequivalence" of program modules—meaning they remain interchangeable regardless of the context they are plugged into.

Unfolding and Breaking Cycles

Shifting works beautifully for simple rules, but it struggles when rules are recursive. If $A$ depends on $B$ and $B$ depends on $A$ through a disjunction, we create "head cycles" that simple shifting cannot resolve without changing the program's meaning.

To solve this, Jianmin Ji and colleagues introduced restricted unfolding in Eliminating Disjunctions in Answer Set Programming by Restricted Unfolding. Unfolding is like algebraic substitution: if a rule depends on an atom $X$, you replace $X$ with the definitions of the rules that produce $X$. By surgically unfolding specific "culprit" atoms that cause cycles, the authors can transform "almost" head-cycle-free programs into normal ones.

This is further refined by analyzing the structural properties of the program. In On Elementary Loops and Proper Loops for Disjunctive Logic Programs, Jianmin Ji and Hai Wan identify broader classes of loops that can be simplified in polynomial time, allowing practitioners to apply standard solvers to problems previously considered too expensive.

Is Disjunction Actually Necessary?

A natural question arises: if we can often eliminate disjunction, does it actually add any "power" to our logic languages?

Recent theoretical work suggests that for many common tasks, the answer is no. Heng Zhang and Guifei Jiang demonstrated in Characterizing the Program Expressive Power of Existential Rule Languages that adding disjunction to existential rules (like Datalog±) does not increase their expressive power when answering standard conjunctive queries. Similarly, Camille Bourgaux and her co-authors showed in Capturing Homomorphism-Closed Decidable Queries with Existential Rules that any decidable, homomorphism-closed query can be captured without needing disjunction in the rule heads.

These findings imply that disjunction is often a "syntactic sugar"—a more compact way to write complex logic—rather than a fundamental requirement for expressivity.

Compiling to Tractable Forms

The ultimate goal of this research is practical: turning high-level, complex knowledge representations into something a computer can solve quickly.

For example, in ontology reasoning, Mark Kaminski and Bernardo Cuenca Grau developed methods to "downgrade" complex ontologies into Datalog. In Computing Horn Rewritings of Description Logics Ontologies, they use a transposition technique: moving disjunctive atoms from the conclusion (head) to the premise (body) and replacing them with auxiliary predicates. This allows deterministic Datalog engines to simulate the branching logic required for disjunctive reasoning.

Similarly, for hybrid systems that combine "closed-world" logic with "open-world" ontologies, Sanja Lukumbuzya and Mantas Simkus show in Resilient Logic Programs how to compile these multi-level frameworks into standard disjunctive ASP. While this moves toward disjunction rather than away from it, it follows the same philosophy: compiling complex, specialized logic into a standard, optimized format that existing solvers can process.

By understanding the boundaries where disjunction can be shifted, unfolded, or rewritten, researchers are expanding the range of problems that can be solved using the highly efficient, deterministic engines of modern logic programming.

Papers in this version

History & citationVersion 2 · 2026-10-04

Current · Permanent link

  1. Version 2 (latest) · 2026-10-04 · 22 papers
  2. Version 1 · 2026-10-04 · 20 papers
Cite this direction

Latest version (a living page):

@misc{lacuna_disjunctive_to_normal_program_transforma_69802517,
  title = {disjunctive-to-normal program transformation},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/disjunctive-to-normal-program-transformation/rdr_6980251788c44430b4885cfb546487c3},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-12-01},
}

This exact version (version 1, frozen text):

@misc{lacuna_eliminating_disjunction_in_logic_program_69802517_v1,
  title = {Eliminating Disjunction in Logic Programs},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/eliminating-disjunction-in-logic-programs/rdr_6980251788c44430b4885cfb546487c3/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-12-01},
}