---
abstract: 'Adapting techniques from database theory in order to optimize Answer Set Programming (ASP) systems, and in particular the grounding components of ASP systems, is an important topic in ASP. In recent years, the Magic Set method has received some interest in this setting, and a variant of it, called DMS, has been proposed for ASP. However, this technique has a caveat, because it is not correct (in the sense of being query-equivalent) for all ASP programs. In recent work, a large fragment of ASP programs, referred to as *super-coherent programs*, has been identified, for which DMS is correct. The fragment contains all programs which possess at least one answer set, no matter which set of facts is added to them. Two open question remained: How complex is it to determine whether a given program is super-coherent? Does the restriction to super-coherent programs limit the problems that can be solved? Especially the first question turned out to be quite difficult to answer precisely. In this paper, we formally prove that deciding whether a propositional program is super-coherent is ${\ensuremath{{\Pi}_{3}^{P}}}$-complete in the disjunctive case, while it is ${\ensuremath{{\Pi}_{2}^{P}}}$-complete for normal programs. The hardness proofs are the difficult part in this endeavor: We proceed by characterizing the reductions by the models and reduct models which the ASP programs should have, and then provide instantiations that meet the given specifications. Concerning the second question, we show that all relevant ASP reasoning tasks can be transformed into tasks over super-coherent programs, even though this transformation is more of theoretical than practical interest.'
author:
- |
    MARIO ALVIANO and WOLFGANG FABER\
    University of Calabria, 87036 Rende (CS), Italy\
- |
    STEFAN WOLTRAN\
    Vienna University of Technology, 1040 Vienna, Austria\
bibliography:
- 'supercoherent.bib'
title: 'Complexity of Super-Coherence Problems in ASP [^1] '
---

\[firstpage\]

Answer-Set Programming, Complexity Analysis

Introduction {#sec:introduction}
============

Answer Set Programming ([$\rm ASP$]{}) is a powerful formalism for knowledge representation and common sense reasoning [@bara-2002]. Allowing disjunction in rule heads and nonmonotonic negation in bodies, [$\rm ASP$]{} can express every query belonging to the complexity class $\rm{\ensuremath{\Sigma_{2}^P}}$ (${\ensuremath{\mathrm{NP}}}^{\ensuremath{\mathrm{NP}}}$). Encouraged by the availability of efficient inference engines, such as DLV [@leon-etal-2002-dlv], GnT [@janh-etal-2005-tocl], Cmodels [@lier-2005-lpnmr], or ClaspD [@dres-etal-2008-KR], [$\rm ASP$]{} has found several practical applications in various domains, including data integration [@leon-etal-2005], semantic-based information extraction [@manna-etal-2011-tldks; @manna-etal-2011-jcss], e-tourism [@ricca-etal-2010-IDUM], workforce management [@ricca-etal-2012-tplp], and many more. As a matter of fact, these [$\rm ASP$]{} systems are continuously enhanced to support novel optimization strategies, enabling them to be effective over increasingly larger application domains.

Frequently, optimization techniques are inspired by methods that had been proposed in other fields, for example database theory, satisfiability solving, or constraint satisfaction. Among techniques adapted to ASP from database theory, Magic Sets [@ullm-89; @banc-etal-86; @beer-rama-91] have recently achieved a lot of attention. Following some earlier work [@grec-2003; @cumb-etal-2004-iclp], an adapted method called *DMS* has been proposed for [$\rm ASP$]{} in [@alvi-etal-2012-aij]. However, this technique has a caveat, because it is not correct (in the sense of being query-equivalent) for all [$\rm ASP$]{} programs. In recent work [@alvi-fabe-2011-aicom; @alvi-fabe-2010-aspocp], a large fragment of ASP programs, referred to as *super-coherent programs* ([$\rm ASP^{\rm sc}$]{}), has been identified, for which DMS can be proved to be correct. Formally, a program is super-coherent, if it is coherent (i.e. possesses at least one answer set), no matter which input (given as a set of facts) is added to the program.

Since the property of being super-coherent is a semantic one, a natural question arises: How difficult is it to decide whether a given program belongs to [$\rm ASP^{\rm sc}$]{}? It turns out that the precise complexity is rather difficult to establish. Some bounds have been given in [@alvi-fabe-2011-aicom], in particular showing decidability, but especially hardness results seemed quite hard to obtain. In particular, the following question remained unanswered: Is it possible to implement an efficient algorithm for testing super-coherence of a program, to decide for example whether DMS has to be applied or not? In this paper we provide a negative answer to this question, proving that deciding whether a propositional program is super-coherent is complete for the third level of the polynomial hierarchy in the general case, and for the second level for normal programs. As the complexity of query answering is located on lower levels of the polynomial hierarchy, our results show that implementing a sound and complete super-coherence check in a query optimization setting does not provide an approach for improving such systems.

While our main motivation for studying [$\rm ASP^{\rm sc}$]{} stemmed from the applicability of DMS, this class actually has many more important motivations. Indeed, it can be viewed as the class of *non-constraining programs*: Adding extensional information to these programs will always result in answer sets. One important implication of this property is for modular evaluation. For instance, when using the splitting set theorem of [ ]{}, if a top part of a split program is an [$\rm ASP^{\rm sc}$]{} program, then any answer set of the bottom part will give rise to at least one answer set of the full program—so for determining answer set existence, there would be no need to evaluate the top part.

On a more abstract level, one of the main criticisms of [$\rm ASP$]{} (being voiced especially in database theory) is that there are programs which do not admit any answer set (traditionally this has been considered a more serious problem than the related nondeterminism in the form of multiple answer sets, cf. ). From this perspective, programs which guarantee coherence (existence of an answer set) have been of interest for quite some time. In particular, if one considers a fixed program and a variable “database,” one arrives naturally at the class [$\rm ASP^{\rm sc}$]{} when requiring existence of an answer set. This also indicates that deciding super-coherence of programs is related to some problems from the area of equivalence checking in ASP [@Eiter05; @Eiter07; @Oetsch07b]. For instance, when deciding whether, for a given arbitrary program $P$, there is a uniformly equivalent definite positive (or definite Horn) program, super-coherence of $P$ is a necessary condition—this is straightforward to see because definite Horn programs have exactly one answer set, so a non-super-coherent program cannot be uniformly equivalent to any definite Horn program.

Since super-coherent programs form a strict subset of all [$\rm ASP$]{} programs, another important question arises: Does the restriction to super-coherent programs limit the problems that can be solved by them? In this paper, we show that this is not the case, by embedding all relevant reasoning tasks over [$\rm ASP$]{} (testing answer set existence, query answering, answer set computation) into reasoning tasks over [$\rm ASP^{\rm sc}$]{}. We also show that all reasoning tasks over normal (non-disjunctive) [$\rm ASP$]{} can be embedded into tasks over normal [$\rm ASP^{\rm sc}$]{}. These results essentially demonstrate that [$\rm ASP^{\rm sc}$]{} is sufficient to encode any problem that can be solved by full [$\rm ASP$]{}, and is therefore in a sense “complete”. However, we would like to note that these embeddings were designed for answering this theoretical question, and might lead to significant overhead when evaluated with ASP solvers. We therefore do not advocate to use them in practical settings, and finding efficient embeddings is a challenging topic for future research.

To summarize, the main contributions of the paper are as follows:

-   We show that recognizing super-coherence for disjunctive and normal programs is complete for classes ${\ensuremath{{\Pi}_{3}^{P}}}$ and ${\ensuremath{{\Pi}_{2}^{P}}}$, respectively, thus more complex than the common ASP reasoning tasks.

-   We provide a transformation of reasoning tasks over general programs into tasks over super-coherent programs, showing that the restriction to super-coherent programs does not curtail expressive power.

-   We also briefly discuss the relation between checking for super-coherence and testing equivalence between programs where we make use of our results to sharpen complexity results due to [ ]{}.

In order to focus on the essentials of these problems, in this paper we deal with propositional programs, but we conjecture that the results can be extended to the non-propositional case by using complexity upgrading techniques as presented in [@eite-etal-97-tods; @gott-etal-99apal], arriving at completeness for classes [$\mbox{\rm co-}{\ensuremath{\mathrm{NEXP}}}^{{\ensuremath{\mathrm{NP}}}}$]{} and [$\mbox{\rm co-}{\ensuremath{\mathrm{NEXP}}}^{{\ensuremath{\Sigma_{2}^P}}}$]{}, respectively.

The remainder of this article is organized as follows. In Section \[sec:preliminaries\] we first define some terminology needed later on. In Section \[sec:statement\] we formulate the complexity problems that we analyze, and state our main results. The proofs for these problems are presented in Section \[sec:proofdisj\] for disjunctive programs, and in Section \[sec:proofnorm\] for normal programs. In Section \[sec:embedding\] we show “completeness” of [$\rm ASP^{\rm sc}$]{} via simulating reasoning tasks over [$\rm ASP$]{} by tasks over [$\rm ASP^{\rm sc}$]{}. In Section \[sec:impl\] we briefly discuss the relation to equivalence problems before concluding the work in Section \[sec:concl\].

Preliminaries {#sec:preliminaries}
=============

In this paper we consider propositional programs, so an atom $p$ is a member of a countable set ${{\cal U}}$. A [*literal*]{} is either an atom $p$ (a positive literal), or an atom preceded by the [ *negation as failure*]{} symbol ${{\mathit not}}$ (a negative literal). A [*rule*]{} ${\ensuremath{r}}$ is of the form $$\begin{array}{l}
    p_1 \ \lor\ \cdots \ \lor\ p_n {\leftarrow}q_1,\ \ldots,\ q_j,\ {{\mathit not}}~q_{j+1},\ \ldots,\ {{\mathit not}}~q_m  
\end{array}$$ where $p_1,\ \ldots,\ p_n,\ q_1,\ \ldots,\ q_m$ are atoms and $n\geq 0,$ $m\geq j\geq 0$. The disjunction $p_1\ \lor\ \cdots \ \lor\ p_n$ is the [*head*]{} of [$r$]{}, while the conjunction $q_1,\ \ldots,\ q_j,\ {{\mathit not}}~q_{j+1},\ \ldots,\ {{\mathit not}}~q_m$ is the [*body*]{} of [$r$]{}. Moreover, ${\ensuremath{H({\ensuremath{r}})}}$ denotes the set of head atoms, while ${\ensuremath{B({\ensuremath{r}})}}$ denotes the set of body literals. We also use ${\ensuremath{B^+({\ensuremath{r}})}}$ and ${\ensuremath{B^-({\ensuremath{r}})}}$ for denoting the set of atoms appearing in positive and negative body literals, respectively, and ${{\mathit At}}({\ensuremath{r}})$ for the set ${\ensuremath{H({\ensuremath{r}})}}\cup {\ensuremath{B^+({\ensuremath{r}})}} \cup {\ensuremath{B^-({\ensuremath{r}})}}$. A rule ${\ensuremath{r}}$ is normal (or disjunction-free) if $|{\ensuremath{H({\ensuremath{r}})}}| = 1$ or $|{\ensuremath{H({\ensuremath{r}})}}| = 0$ (in this case ${\ensuremath{r}}$ is also referred to as a *constraint*), positive (or negation-free) if ${\ensuremath{B^-({\ensuremath{r}})}}=\emptyset$, a [*fact*]{} if both ${\ensuremath{B({\ensuremath{r}})}}=\emptyset$ and $|{\ensuremath{H({\ensuremath{r}})}}| = 1$.

A *program* ${P}$ is a finite set of rules; if all rules in it are positive (resp. normal), then ${P}$ is a positive (resp. normal) program. Odd-cycle-free (cf. [@dung-92; @you-yuan-94]) and stratified (cf. [@apt-etal-88]) programs constitute two other interesting classes of programs. An atom $p$ appearing in the head of a rule ${\ensuremath{r}}$ [*depends*]{} on each atom $q$ that belongs to ${\ensuremath{B({\ensuremath{r}})}}$; if $q$ belongs to ${\ensuremath{B^+({\ensuremath{r}})}}$, $p$ depends positively on $q$, otherwise negatively. A program without constraints is *odd-cycle-free* if there is no cycle of dependencies involving an odd number of negative dependencies, while it is [*stratified*]{} if each cycle of dependencies involves only positive dependencies. Programs containing constraints have been excluded by the definition of odd-cycle-free and stratified programs. In fact, constraints intrinsically introduce odd-cycles in programs as a constraint of the form $${\leftarrow}q_1,\ \ldots,\ q_j,\ {{\mathit not}}~q_{j+1},\ \ldots,\ {{\mathit not}}~q_m$$ can be replaced by the following equivalent rule: $$co {\leftarrow}q_1,\ \ldots,\ q_j,\ {{\mathit not}}~q_{j+1},\ \ldots,\ {{\mathit not}}~q_m,\ {{\mathit not}}~co,$$ where $co$ is a fresh atom (i.e., an atom that does not occur elsewhere in the program). We also require the notion of *head-cycle free* programs (cf. [@bene-dech-94]): a program ${P}$ is called head-cycle free if no different head atoms in a rule positively depend mutually on each other.

Given a program ${P}$, let ${{\mathit At}}({P})$ denote the set of atoms that occur in it, that is, let ${{\mathit At}}({P}) = \bigcup_{{\ensuremath{r}}\in {P}} {{\mathit At}}({\ensuremath{r}})$. An *interpretation* $I$ for a program ${P}$ is a subset of ${{\mathit At}}({P})$. An atom $p$ is true w.r.t. an interpretation $I$ if $p\in I$; otherwise, it is false. A negative literal ${{\mathit not}}\ p$ is true w.r.t. $I$ if and only if $p$ is false w.r.t. $I$. The body of a rule ${\ensuremath{r}}$ is true w.r.t. $I$ if and only if all the body literals of ${\ensuremath{r}}$ are true w.r.t. $I$, that is, if and only if ${\ensuremath{B^+({\ensuremath{r}})}} \subseteq I$ and ${\ensuremath{B^-({\ensuremath{r}})}} \cap I = \emptyset$. An interpretation $I$ [*satisfies*]{} a rule ${\ensuremath{r}}\in {P}$ if at least one atom in ${\ensuremath{H({\ensuremath{r}})}}$ is true w.r.t. $I$ whenever the body of ${\ensuremath{r}}$ is true w.r.t. $I$. An interpretation $I$ is a *model* of a program ${P}$ if $I$ satisfies all the rules in ${P}$.

Given an interpretation $I$ for a program ${P}$, the reduct of ${P}$ w.r.t. $I$, denoted by ${P}^{I}$, is obtained by deleting from ${P}$ all the rules ${\ensuremath{r}}$ with ${\ensuremath{B^-({\ensuremath{r}})}} \cap I \neq \emptyset$, and then by removing all the negative literals from the remaining rules [@gelf-lifs-91]. The semantics of a program ${P}$ is given by the set ${{\mathit AS}}({P})$ of the answer sets of ${P}$, where an interpretation $M$ is an answer set for ${P}$ if and only if $M$ is a subset-minimal model of ${P}^M$.

In the subsequent sections, we will use the following properties that the models and models of reducts of programs satisfy (see, e.g. [@Eiter04; @Eiter05]):

-   for any disjunctive program $P$ and interpretations $I\subseteq J\subseteq K$, if $I$ satisfies $P^J$, then $I$ also satisfies $P^K$;

-   for any normal program $P$ and interpretations $I, J\subseteq K$, if $I$ and $J$ both satisfy $P^K$, then also $(I\cap J)$ satisfies $P^K$.

By a query in this paper we refer to an atom, negative and conjunctive queries can be simulated by adding appropriate rules to the associated program. A query ${\ensuremath{\mathit{q}}}$ is *bravely* true for a program $P$ if and only if $q\in A$ for some $A \in {{\mathit AS}}(P)$. A query ${\ensuremath{\mathit{q}}}$ is *cautiously* true for a program $P$ if and only if $q\in A$ for all $A \in {{\mathit AS}}(P)$.

We now introduce super-coherent ASP programs ([$\rm ASP^{\rm sc}$]{} programs), the main class of programs studied in this paper.

A program ${P}$ is *super-coherent* if, for every set of facts $F$, ${{\mathit AS}}({P}\cup F) \neq \emptyset$. Let [$\rm ASP^{\rm sc}$]{} denote the set of all super-coherent programs.

Note that [$\rm ASP^{\rm sc}$]{} programs include all odd-cycle-free programs (and therefore also all stratified programs). Indeed, every odd-cycle-free program admits at least one answer set and remains odd-cycle-free even if an arbitrary set of facts is added to its rules. On the other hand, there are programs having odd-cycles that are in [$\rm ASP^{\rm sc}$]{}, cf. [ ]{}.

Complexity of Checking Super-Coherence {#sec:statement}
======================================

In this section, we study the complexity of the following natural problem:

-   Given a program $P$, is $P$ super-coherent, i.e.  does ${{\mathit AS}}(P\cup F)\neq\emptyset$ hold for any set $F$ of facts.

We will study the complexity for this problem for the case of disjunctive logic programs and non-disjunctive (normal) logic programs. We first have a look at a similar problem, which turns out to be rather trivial to decide.

The problem of deciding whether, for a given disjunctive program $P$, there is a set $F$ of facts such that ${{\mathit AS}}(P\cup F)\neq\emptyset$ is ${\ensuremath{\mathrm{NP}}}$-complete; ${\ensuremath{\mathrm{NP}}}$-hardness holds already for normal programs.

We start by observing that there is $F$ such that ${{\mathit AS}}(P\cup F)\neq\emptyset$ if and only if $P$ has at least one model. Indeed, if $M$ is a model of $P$, then $P\cup M$ has $M$ as its answer set. On the other hand, if $P$ has no model, then no addition of facts $F$ will yield an answer set for $P\cup F$. It is well known that deciding whether a program has at least one (classical) model is ${\ensuremath{\mathrm{NP}}}$-complete for both disjunctive and normal programs.

In contrast, the complexity for deciding super-coherence is surprisingly high, which we shall show next. To start, we give a straight-forward observation.

\[prop:restrict\] A program $P$ is super-coherent if and only if for each set $F\subseteq {{\mathit At}}(P)$, ${{\mathit AS}}(P\cup F)\neq\emptyset$.

The only-if direction is by definition. For the if-direction, let $F$ be any set of facts. $F$ can be partitioned into $F' = F \cap {{\mathit At}}(P)$ and $F'' = F \setminus F'$. By assumption, $P$ is super-coherent and thus $P \cup F'$ is coherent. Let $M$ be an answer set of $P \cup F'$. We shall show that $M \cup F''$ is an answer set of $P \cup F = P \cup F' \cup F''$. This is in fact a consequence of the splitting set theorem [@lifs-turn-94], as the atoms in $F''$ are only defined by facts not occurring in $P \cup F'$.

Our main results are stated below. The proofs are contained in the subsequent sections.

\[thm:disj\] The problem of deciding super-coherence for disjunctive programs is ${\ensuremath{{\Pi}_{3}^{P}}}$-complete.

\[thm:norm\] The problem of deciding super-coherence for normal programs is ${\ensuremath{{\Pi}_{2}^{P}}}$-complete.

Proof of Theorem \[thm:disj\] {#sec:proofdisj}
-----------------------------

Membership follows by the following straight-forward nondeterministic algorithm for the complementary problem, i.e. given a program $P$, does there exist a set $F$ of facts such that ${{\mathit AS}}(P\cup F)=\emptyset$: we guess a set $F\subseteq {{\mathit At}}(P)$ and check ${{\mathit AS}}(P\cup F)=\emptyset$ via an oracle-call. Restricting the guess to ${{\mathit At}}(P)$ can be done by Proposition \[prop:restrict\]. Checking ${{\mathit AS}}(P\cup F)=\emptyset$ is known to be in ${\ensuremath{{\Pi}_{2}^{P}}}$ [@EiterG95]. This shows ${\ensuremath{{\Pi}_{3}^{P}}}$-membership.

For the hardness we reduce the ${\ensuremath{{\Pi}_{3}^{P}}}$-complete problem of deciding whether QBFs of the form $\forall X\exists Y\forall Z\phi$ are true to the problem of super-coherence. Without loss of generality, we can consider $\phi$ to be in DNF and, indeed, $X\neq\emptyset$, $Y\neq \emptyset$, and $Z\neq\emptyset$. We also assume that each disjunct of $\phi$ contains at least one variable from $X$, one from $Y$ and one from $Z$. More precisely, we shall construct for each such QBF $\Phi$ a program $P_\Phi$ such that $\Phi$ is true if and only if $P_\Phi$ is super-coherent. Before showing how to actually construct $P_\Phi$ from $\Phi$ in polynomial time, we give the required properties for $P_\Phi$. We then show that for programs $P_\Phi$ satisfying these properties, the desired relation ($\Phi$ is true if and only if $P_\Phi$ is super-coherent) holds, and finally we provide the construction of $P_\Phi$.

\[def:red\] Let $\Phi = \forall X\exists Y\forall Z\phi$ be a QBF with $\phi$ in DNF. We call any program $P$ satisfying the following properties a *$\Phi$-reduction*:

1.  $P$ is given over atoms $U=X\cup Y\cup Z \cup 
    \overline{X} \cup 
    \overline{Y} \cup 
    \overline{Z} \cup  \{u,v,w\}$, where all atoms in sets $\overline{S}=\{\overline{s} \mid s\in S\}$ ($S \in \{X,Y,Z\}$) and $\{u,v,w\}$ are fresh and mutually disjoint;

2.  $P$ has the following models:

    -   $U$;

    -   for each $I\subseteq X$, $J\subseteq Y$, $$M[I,J]=I\cup \overline{(X\setminus I)}\cup J\cup \overline{(Y\setminus J)}\cup Z\cup \overline{Z}\cup \{u,v\}$$ and $$M'[I,J]=I\cup \overline{(X\setminus I)}\cup J\cup \overline{(Y\setminus J)}\cup Z\cup \overline{Z}\cup \{v,w\};$$

3.  for each $I\subseteq X$, $J\subseteq Y$, the models[^2] of the reduct $P^{M[I,J]}$ are $M[I,J]$ and $$O[I] = I\cup \overline{(X\setminus I)};$$

4.  for each $I\subseteq X$, $J\subseteq Y$, the models of the reduct $P^{M'[I,J]}$ are $M'[I,J]$ and

    -   for each $K\subseteq Z$ such that $I\cup J \cup K\not \models \phi$, $$N[I,J,K] = I \cup \overline{(X\setminus I)}\cup J\cup \overline{(Y\setminus J)}\cup K\cup \overline{(Z\setminus K)}\cup \{v\};$$

5.  the models of the reduct $P^U$ are $U$ itself, $M[I,J]$, $M'[I,J]$, and $O[I]$, for each $I\subseteq X$, $J\subseteq Y$, and $N[I,J,K]$ for each $I\subseteq X$, $J\subseteq Y$, $K\subseteq Z$, such that $I\cup J \cup K\not \models \phi$.

=\[\] =\[draw,thick,-&gt;\] =\[draw,thick\] =\[draw,thick,rectangle, rounded corners\]

\(U) at (0,1) [$U$]{}; (MI0J0) at (-4,-1) [$M[I_0,J_0]$]{}; (dots1) at (-2.5,-1) [$\cdots$]{}; (MImJn) at (-1,-1) [$M[I_m,J_n]$]{}; (MpI0J0) at (1,-1) [$M'[I_0,J_0]$]{}; (dots2) at (2.5,-1) [$\cdots$]{}; (MpImJn) at (4,-1) [$M'[I_m,J_n]$]{};

\(U) edge node\[above left\] [$\subset$]{} (MI0J0); (dots3) at (-1.5,-0.3) [$\cdots$]{}; (U) edge node\[left\] [$\subset$]{} (MImJn);

\(U) edge node\[right\] [$\subset$]{} (MpI0J0); (dots4) at (1.5,-0.3) [$\cdots$]{}; (U) edge node\[above right\] [$\subset$]{} (MpImJn);

(CMMI0J0) at (-4,-3) [$O[I_0]$]{}; (MI0J0) edge node\[left\] [$P^{M[I_0,J_0]}$]{} (CMMI0J0);

(dots5) at (-2.75,-3) [$\cdots$]{};

(CMMImJn) at (-1.5,-3) [$O[I_m]$]{}; (MImJn) edge node\[left\] [$P^{M[I_m,J_n]}$]{} (CMMImJn);

(CMMpI0J0) at (1,-3) [$
  \begin{array}{l}
   N[I_0,J_0,K] \mbox{\ s.t.}\\
   I_0 \cup J_0 \cup K \not \models \phi  
  \end{array}
$]{}; (MpI0J0) edge node\[right\] [$P^{M'[I_0,J_0]}$]{} (CMMpI0J0);

(dots5) at (3,-3) [$\cdots$]{};

(CMMpImJn) at (5,-3) [$
  \begin{array}{l}
   N[I_m,J_n,K] \mbox{\ s.t.}\\
   I_m \cup J_n \cup K \not \models \phi  
  \end{array}
 $]{}; (MpImJn) edge node\[right\] [$P^{M'[I_m,J_n]}$]{} (CMMpImJn);

(CMU) at (0,3) [$
  \begin{array}{c}
   M[I_0,J_0]\ \cdots\ M[I_m,J_n]\qquad M'[I_0,J_0]\ \cdots\ M'[I_m,J_n]\\[2ex]  
   O[I_0]\ \cdots\ O[I_m] \qquad
   \begin{array}{l}
   N[I_0,J_0,K] \mbox{\ s.t.}\\
   I_0 \cup J_0 \cup K \not \models \phi  
  \end{array}
\ \cdots\ 
  \begin{array}{l}
   N[I_m,J_n,K] \mbox{\ s.t.}\\
   I_m \cup J_n \cup K \not \models \phi  
  \end{array}
  \end{array}
$]{};

\(U) edge node\[right\] [$P^{U}$]{} (CMU);

The structure of models of $\Phi$-reductions and the “countermodels” (see below what we mean by this term) of the relevant reducts is sketched in Figure \[fig:phired\]. The center of the diagram contains the models of the $\Phi$-reduction and their subset relationship. For each of the model the respective box lists the “countermodels,” by which we mean those reduct models which can serve as counterexamples for the original model being an answer set, that is, those reduct models which are proper subsets of the original model.

We just note at this point that the models of the reduct $P^U$ given in Item 5 are not specified for particular purposes, but are required to allow for a realization via disjunctive programs. In fact, these models are just an effect of property (P1) mentioned in Section \[sec:preliminaries\]. However, before showing a program satisfying the properties of a *$\Phi$-reduction*, we first show the rationale behind the concept of $\Phi$-reductions.

For any QBF $\Phi = \forall X\exists Y\forall Z\phi$ with $\phi$ in DNF, a $\Phi$-reduction is super-coherent if and only if $\Phi$ is true.

Suppose that $\Phi$ is false. Hence, there exists an ${{\mathcal I}}\subseteq X$ such that, for all $J\subseteq Y$, there is a $K_Y\subseteq Z$ with ${{\mathcal I}}\cup J \cup K_Y\not\models \phi$. Now let $P$ be any $\Phi$-reduction and $F_{{\mathcal I}}= {{\mathcal I}}\cup \overline{(X\setminus {{\mathcal I}})}$. We show that ${{\mathit AS}}(P\cup F_{{\mathcal I}})=\emptyset$, thus $P$ is not super-coherent. Let ${{\mathcal M}}$ be a model of $P \cup F_{{\mathcal I}}$. Since $P$ is a $\Phi$-reduction, the only candidates for ${{\mathcal M}}$ are $U$, $M[{{\mathcal I}},J]$, and $M'[{{\mathcal I}},J]$, where $J\subseteq Y$. Indeed, for each $I\neq{{\mathcal I}}$, $M[I,J]$ and $M'[I,J]$ cannot be models of $P\cup F_{{\mathcal I}}$ because $F_{{\mathcal I}}\not\subseteq M[I,J]$, resp. $F_{{\mathcal I}}\not\subseteq M'[I,J]$. We now analyze these three types of potential candidates:

-   ${{\mathcal M}}=U$: Then, for instance, $M[{{\mathcal I}},J]\subset U$ is a model of $(P\cup F_{{\mathcal I}})^{{\mathcal M}}=P^{{\mathcal M}}\cup F_{{\mathcal I}}$ for any $J \subseteq Y$. Thus, ${{\mathcal M}}\notin{{\mathit AS}}(P\cup F_{{\mathcal I}})$.

-   ${{\mathcal M}}=M[{{\mathcal I}},J]$ for some $J\subseteq Y$. Then, by the properties of $\Phi$-reductions, $O[{{\mathcal I}}]\subset {{\mathcal M}}$ is a model of $(P\cup F_{{\mathcal I}})^{{\mathcal M}}=P^{{\mathcal M}}\cup F_{{\mathcal I}}$. Thus, ${{\mathcal M}}\notin{{\mathit AS}}(P\cup F_{{\mathcal I}})$.

-   ${{\mathcal M}}=M'[{{\mathcal I}},J]$ for some $J\subseteq Y$. By the initial assumption, there exists a $K_Y\subseteq Z$ with ${{\mathcal I}}\cup J \cup K_Y\not\models \phi$. Then, by the properties of $\Phi$-reductions, $N[{{\mathcal I}},J,K]\subset {{\mathcal M}}$ is a model of $P^{{\mathcal M}}$ and thus also of $(P\cup F_{{\mathcal I}})^{{\mathcal M}}$. Hence, ${{\mathcal M}}\notin{{\mathit AS}}(P\cup F_{{\mathcal I}})$.

In each of the cases we have obtained ${{\mathcal M}}\notin{{\mathit AS}}(P\cup F_{{\mathcal I}})$, hence ${{\mathit AS}}(P\cup F_{{\mathcal I}})=\emptyset$ and $P$ is not super-coherent.

Suppose that $\Phi$ is true. It is sufficient to show that for each $F\subseteq U$, ${{\mathit AS}}(P\cup F)\neq \emptyset$. We have the following cases:

If $\{s,\overline{s}\}\subseteq F$ for some $s\in X\cup Y$ or $\{u,w\}\subseteq F$. Then $U\in{{\mathit AS}}(P\cup F)$ since $U$ is a model of $P\cup F$ and each potential model $M\subset U$ of the reduct $P^U$ (see the properties of $\Phi$-reductions) does not satisfy $F\subseteq M$; thus each such $M$ is not a model of $P^U\cup F=(P\cup F)^U$.

Otherwise, we have $F\subseteq M[I,J]$ or $F\subseteq M'[I,J]$ for some $I\subseteq X$, $J\subseteq Y$. In case $F\subseteq M[I,J]$ and $F\not\subseteq O[I]$, we observe that $M[I,J]\in{{\mathit AS}}(P\cup F)$ since $O[I]$ is the only model (being a proper subset of $M[I,J]$) of the reduct $P^{M[I,J]}$. Thus for each such $F$ there cannot be a model $M\subset M[I,J]$ of $P^{M[I,J]}\cup F=(P\cup F)^{M[I,J]}$. As well, in case $F\subseteq M'[I,J]$, where $w\in F$, $M'[I,J]$ can be shown to be an answer set of $P\cup F$. Note that the case $F\subseteq M'[I,J]$ with $w\notin F$ is already taken care of since for such $F$ we have $F\subseteq M[I,J]$ as well.

It remains to consider the case $F\subseteq O[I]$ for each $I\subseteq X$. We show that $M'[I,J]$ is an answer set of $P\cup F$, for some $J\subseteq Y$. Since $\Phi$ is true, we know that, for each $I\subseteq X$, there exists a $J_I\subseteq Y$ such that, for all $K\subseteq Z$, $I\cup J_I\cup K\models \phi$. As can be verified by the properties of $\Phi$-reductions, then there is no model $M\subset M'[I,J_I]$ of $P^{M'[I,J_I]}$. Consequently, there is also no such model of $(P\cup F)^{M'[I,J_I]}$, and thus $M'[I,J_I]\in{{\mathit AS}}(P\cup F)$.

So in each of these cases ${{\mathit AS}}(P\cup F) \neq \emptyset$ and since these cases cover all possible $F \subseteq U$, we obtain that $P$ is super-coherent.

In total we have shown that $\Phi$ being false implies that any $\Phi$-reduction $P$ is not super-coherent, while $\Phi$ being true implies that any $\Phi$-reduction is super-coherent, which proves the lemma.

It remains to show that for any QBF of the desired form, a $\Phi$-reduction can be obtained in polynomial time (w.r.t. the size of $\Phi$). For the construction below, let us denote a negated atom $a$ in the propositional part of the QBF $\Phi$ as $\overline{a}$.

\[def:phi\_program\] For any QBF $\Phi = \forall X\exists Y\forall Z\phi$ with $\phi=\bigvee_{i=1}^n l_{i,1}\land\cdots\land l_{i,m_i}$ a DNF (i.e., a disjunction of conjunctions over literals), we define $$\begin{aligned}
\label{eq:red:first}
P_\Phi & = & 
\{  x \lor \overline{x} {\leftarrow};\;
u {\leftarrow}x,\overline{x};\;
w {\leftarrow}x,\overline{x};\;
x {\leftarrow}u,w;\;
\overline{x} {\leftarrow}u,w\mid x\in X\}\cup{}\\
&&
\{  y \lor \overline{y} {\leftarrow}v;\;
u {\leftarrow}y,\overline{y};\;
w {\leftarrow}y,\overline{y};\;
y {\leftarrow}u,w;\; \nonumber \\
\label{eq:red:second}
&&\hphantom{\{}
\overline{y} {\leftarrow}u,w;\;
v {\leftarrow}y;\;
v {\leftarrow}\overline{y}
\mid y\in Y\}\cup{}\\
&&
\{  z \lor \overline{z} {\leftarrow}v;\;
u {\leftarrow}z,{{\mathit not}}\ w;\;
u {\leftarrow}\overline{z},{{\mathit not}}\ w;\;
v {\leftarrow}z;\;
v {\leftarrow}\overline{z};\; \nonumber \\
&&\hphantom{\{}
\label{eq:red:third}
z {\leftarrow}w;\;
\overline{z} {\leftarrow}w;\;
z {\leftarrow}u;\;
\overline{z} {\leftarrow}u;\;
w \vee u \leftarrow z, \overline{z}
\mid z\in Z\}\cup{}\\
\label{eq:red:fourth}
&& \{ w \vee u {\leftarrow}l_{i,1},\ldots,l_{i,m_i} \mid 1\leq i \leq  n\} \\
\label{eq:red:fifth}
&& \{
  v {\leftarrow}w;\;
  v {\leftarrow}u;\;
  v {\leftarrow}{{\mathit not}}\ u\}.\end{aligned}$$

The program above contains atoms associated with literals in $\Phi$ and three auxiliary atoms $u,v,w$. Intuitively, truth values for variables in $X$ are guessed by rules in (\[eq:red:first\]), and truth values for variables in $Y \cup Z$ are guessed by rules in (\[eq:red:second\])–(\[eq:red:third\]) provided that $v$ is true. Moreover, rules in (\[eq:red:first\])–(\[eq:red:second\]) derive all atoms in $X \cup \overline{X} \cup Y \cup \overline{Y} \cup \{u,w\}$ whenever both $u$ and $w$ are true, or in case an inconsistent assignment for some propositional variable in $X \cup Y$ is forced by the addition of a set of facts to the program. On the other hand, all atoms associated with variables $Z$ are inferred by rules in (\[eq:red:third\]) if one of $u$ and $w$ is true. Atoms $u$ and $w$ can be inferred for instance by some rule in (\[eq:red:fourth\]) whenever truth values of atoms of $P_\Phi$ represent a satisfying assignment for $\phi$. Furthermore, rules in (\[eq:red:fifth\]) are such that every model of $P_\Phi$ contains $v$, and any answer set of $P_\Phi$ must also contain $w$. We finally observe that $w$ can be derived by some rule in (\[eq:red:fourth\]) in the program reduct, which is the case if truth values of atoms in $X \cup \overline{X} \cup Y \cup \overline{Y}$ represent a consistent assignment for propositional variables in $X \cup Y$ satisfying $\forall Z \phi$.

Obviously, the program from above definition can be constructed in polynomial time in the size of the reduced QBF. To conclude the proof of Theorem \[thm:disj\] it is thus sufficient to show the following relation.

For any QBF $\Phi = \forall X\exists Y\forall Z\phi$, the program $P_\Phi$ is a $\Phi$-reduction.

Obviously, ${{\mathit At}}(P_\Phi)$ contains the atoms as required in 1) of Definition \[def:red\]. We continue to show 2). To see that $U$ is a model of $P_\Phi$ is obvious. We next show that the remaining models $M$ are all of the form $M[I,J]$ or $M'[I,J]$. First we have $v\in M$ because of the rules $v{\leftarrow}u$ and $v{\leftarrow}{{\mathit not}}\ u$ in (\[eq:red:fifth\]). In case $w\in M$, $Z\cup \overline{Z}\subseteq M$ by the rules in (\[eq:red:third\]). In case $w\notin M$, we have $K\cup \overline{(Z\setminus K)} \subseteq M$ for some $K\subseteq Z$, since $v\in M$ and by (\[eq:red:third\]). But then, since $w\notin M$, $u\in M$ holds (rules $u{\leftarrow}z,{{\mathit not}}\ w$ resp.$u{\leftarrow}\overline{z},{{\mathit not}}\ w$). Hence, also here $Z\cup \overline{Z}\subseteq M$. In both cases, we observe that by (\[eq:red:first\]) and (\[eq:red:second\]), $I\cup \overline{(X\setminus I)}\cup J\cup \overline{(Y\setminus J)}\subseteq M$, for some $I\subseteq X$ and $J\subseteq Y$. This yields the desired models, $M[I,J]$, $M'[I,J]$. It can be checked that no other model exists by showing that for $N\not\subseteq M[I,J]$, resp. $N\not\subseteq M'[I,J]$, $N=U$ follows.

We next show that, for each $I\subseteq X$ and $J\subseteq Y$, $P^{M[I,J]}$ and $P^{M'[I,J]}$ possess the required models. Let us start by showing that $O[I]$ is a model of $P^{M[I,J]}$. In fact, it can be observed that all of the rules of the form $x \vee \overline{x} \leftarrow$ in (\[eq:red:first\]) are satisfied because either $x$ or $\overline{x}$ belong to $O[I]$, while all of the other rules in $P^{M[I,J]}$ are satisfied because of a false body literal. We also note that each strict subset of $O[I]$ does not satisfy some rule of the form $x \vee \overline{x} \leftarrow$, and thus it is not a model of $P^{M[I,J]}$. Similarly, any interpretation $W$ such that $O[I] \subset W \subset M[I,J]$ does not satisfy some rule in $P^{M[I,J]}$ (note that rules of the form $u \leftarrow z$ and $u \leftarrow \overline{z}$ occur in $P^{M[I,J]}$ because $w \not\in M[I,J]$; such rules are obtained by rules in (\[eq:red:third\])).

Let us now consider $P^{M'[I,J]}$ and let $W \subseteq M'[I,J]$ be one of its models. We shall show that either $W = M'[I,J]$, or $W = N[I,J,K]$ for some $K \subseteq Z$ such that $I \cup J \cup K \not\models \phi$. Note that $v$ is a fact in $P^{M'[I,J]}$, hence $v$ must belong to $W$. By (\[eq:red:first\]) and (\[eq:red:second\]), since $v \in W$ and $W \subseteq M'[I,J]$, we can conclude that all of the atoms in $I\cup \overline{(X\setminus I)}\cup J\cup \overline{(Y\setminus J)}$ belong to $W$. Consider now the atom $w$. If $w$ belongs to $W$, by the rules in (\[eq:red:third\]) we conclude that all of the atoms in $Z \cup \overline{Z}$ belong to $W$, and thus $W = M'[I,J]$. Otherwise, if $w \not\in W$, by the rules of the form $z \vee \overline{z} \leftarrow v$ in (\[eq:red:third\]), there must be a set $K \subseteq Z$ such that $K \cup \overline{(Z\setminus K)}$ is contained in $W$. Note that no other atoms in $Z \cup \overline{Z}$ can belong to $W$ because of the last rule in (\[eq:red:third\]). Hence, $W = N[I,J,K]$. Moreover, $w \not\in W$ and $u \not\in W$ imply that $I \cup J \cup K \not\models \phi$ holds because of (\[eq:red:fourth\]).

Finally, one can show that $P^U$ does not yield additional models as those which are already present by other models. Let $W \subseteq U$ be a model of $P^U$. By (\[eq:red:first\]), $O[I] \subseteq W$ must hold for some $I \subseteq X$. Consider now the atom $v$. If $v \not\in W$, we conclude that the model $W$ is actually $O[I]$. We can thus consider the other case, i.e. $v \in W$. By (\[eq:red:second\]), $J \cup \overline{(Y \setminus J)} \subseteq W$ must hold for some $J \subseteq Y$. Consider now the atom $u$. If $u \in W$, we have $Z \cup \overline{Z} \subseteq W$ because of (\[eq:red:third\]). If no other atom belongs to $W$, then $W = M[I,J]$ holds. Otherwise, if any other atom belongs to $W$, it can be checked that $W$ must be equal to $U$. We can then consider the case in which $u \not\in W$, and the atom $w$. Again, we have two possibilities. If $w$ belongs to $W$, by (\[eq:red:third\]) we conclude that all of the atoms in $Z \cup \overline{Z}$ belong to $W$, and thus either $W = M'[I,J]$ or $W = U$. Otherwise, if $w \not\in W$, by the rules of the form $z \vee \overline{z} \leftarrow v$ in (\[eq:red:third\]), there must be a set $K \subseteq Z$ such that $K \cup \overline{(Z\setminus K)}$ is contained in $W$. Note that no other atoms in $Z \cup \overline{Z}$ can belong to $W$ because of the last rule in (\[eq:red:third\]). Hence, $W = N[I,J,K]$. Moreover, because of (\[eq:red:fourth\]), $w \not\in W$ and $u \not\in W$ imply that $I \cup J \cup K \not\models \phi$ holds.

Note that the program from Definition \[def:phi\_program\] does not contain constraints. As a consequence, the ${\ensuremath{{\Pi}_{3}^{P}}}$-hardness result presented in this section also holds if we only consider disjunctive [$\rm ASP$]{} programs without constraints.

Proof of Theorem \[thm:norm\] {#sec:proofnorm}
-----------------------------

Membership follows by the straight-forward nondeterministic algorithm for the complementary problem presented in the previous section. We have just to note that a $co-{\ensuremath{\mathrm{NP}}}$ oracle can be used for checking the consistency of a normal program. Thus, ${\ensuremath{{\Pi}_{2}^{P}}}$-membership is established.

For the hardness we reduce the ${\ensuremath{{\Pi}_{2}^{P}}}$-complete problem of deciding whether QBFs of the form $\forall X\exists Y\phi$ are true to the problem of super-coherence. Without loss of generality, we can consider $\phi$ to be in CNF and, indeed, $X\neq\emptyset$, and $Y\neq \emptyset$. We also assume that each clause of $\phi$ contains at least one variable from $X$ and one from $Y$. More precisely, we shall adapt the notion of $\Phi$-reduction to normal programs. In particular, we have to take into account a fundamental difference between disjunctive and normal programs: while disjunctive programs allow for using disjunctive rules for guessing a subset of atoms, such a guess can be achieved only by means of unstratified negation within a normal program. For example, one atom in a set $\{x,y\}$ can be guessed by means of the following disjunctive rule: $x \vee y {\leftarrow}$. Within a normal program, the same result can be obtained by means of the following rules: $x {\leftarrow}{{\mathit not}}\ y$ and $y {\leftarrow}{{\mathit not}}\ x$. However, these last rules would be deleted in the reduced program associated with a model containing both $x$ and $y$, which would allow for an arbitrary subset of $\{x,y\}$ to be part of a model of the reduct. More generally speaking, we have to take Property (P2), as introduced in Section \[sec:preliminaries\], into account. This makes the following definition a bit more cumbersome compared to Definition \[def:red\].

\[def:rednormrefined:2\] Let $\Phi = \forall X\exists Y\phi$ be a QBF with $\phi$ in CNF. We call any program $P$ satisfying the following properties a *$\Phi$-norm-reduction*:

1.  $P$ is given over atoms $U=X\cup Y\cup 
    \overline{X} \cup 
    \overline{Y} \cup 
    \{v,w\}$, where all atoms in sets $\overline{S}=\{\overline{s} \mid s\in S\}$ ($S \in \{X,Y,Z\}$) and $\{v,w\}$ are fresh and mutually disjoint;

2.  $P$ has the following models:

    -   for each $J \subseteq Y$, and for each $J^*$ such that $J \cup \overline{(Y \setminus J)} \subseteq J^* \subseteq Y \cup \overline{Y}$ $$O[J^*] = X \cup \overline{X} \cup J^* \cup \{v,w\};$$

    -   for each $I\subseteq X$, $$M[I]=I\cup \overline{(X\setminus I)}\cup \{v\};$$

    -   for each $I\subseteq X$, $J\subseteq Y$, such that $I\cup J\models \phi$, $$N[I,J]=
        I\cup \overline{(X\setminus I)}\cup 
        J\cup \overline{(Y\setminus J)}\cup 
         \{w\};$$

3.  the only models of a reduct $P^{M[I]}$ are $M[I]$ and $M[I] \setminus \{v\}$; the only model of a reduct $P^{N[I,J]}$ is $N[I,J]$;

4.  each model $M$ of a reduct $P^{O[J^*]}$ satisfies the following properties:

    1.  for each $y \in Y$ such that $y \in O[J^*]$ and $\overline{y} \not\in O[J^*]$, if $w \in M$, then $y \in M$;

    2.  for each $y \in Y$ such that $\overline{y} \in O[J^*]$ and $y \not\in O[J^*]$, if $w \in M$, then $\overline{y} \in M$;

    3.  if $(Y \cup \overline{Y}) \cap M \neq \emptyset$, then $w \in M$;

    4.  if there is a clause $l_{i,1} \vee \cdots \vee l_{i,m_i}$ of $\phi$ such that $\{\overline{l}_{i,1},\ldots,\overline{l}_{i,m_i}\} \subseteq M$, then $v \in M$;

    5.  if there is an $x \in X$ such that $\{x,\overline{x}\} \subseteq M$, or there is a $y \in Y$ such that $\{y,\overline{y}\} \subseteq M$, or $\{v,w\} \subseteq M$, then it must hold that $X \cup \overline{X} \cup \{v,w\} \subseteq M$.

Similarly as in the previous section, the models of the reducts $P^{O[J^*]}$ as given in Item 4 are not specified for particular purposes, but are required to allow for a realization via normal programs taking the set of models specified in Items 2 and 3 as well as properties (P1) and (P2) from Section \[sec:preliminaries\] into account.

For any QBF $\Phi = \forall X\exists Y\phi$ with $\phi$ in CNF, a $\Phi$-norm-reduction is super-coherent if and only if $\Phi$ is true.

Suppose that $\Phi$ is false. Hence, there exists an ${{\mathcal I}}\subseteq X$ such that, for all $J\subseteq Y$, ${{\mathcal I}}\cup J \not\models \phi$. Now, let $P$ be any $\Phi$-norm-reduction and $F_{{\mathcal I}}= {{\mathcal I}}\cup \overline{(X\setminus {{\mathcal I}})}$. We show that ${{\mathit AS}}(P\cup F_{{\mathcal I}})=\emptyset$, thus $P$ is not super-coherent. Let ${{\mathcal M}}$ be a model of $P \cup F_{{\mathcal I}}$. Since $P$ is a $\Phi$-norm-reduction, the only candidates for ${{\mathcal M}}$ are $O[J^*]$ for some $J \subseteq Y$ and $J^*$ such that $J \cup \overline{(Y \setminus J)} \subseteq J^* \subseteq Y \cup \overline{Y}$, $M[{{\mathcal I}}]$, and $N[{{\mathcal I}},J']$, where $J'\subseteq Y$ satisfies ${{\mathcal I}}\cup J'\models \phi$. However, from our assumption (for all $J\subseteq Y$, ${{\mathcal I}}\cup J \not\models \phi$), no such $N[{{\mathcal I}},J']$ exists. Thus, it remains to consider $O[J^*]$ and $M[{{\mathcal I}}]$. By the properties of $\Phi$-norm-reductions, $M[{{\mathcal I}}] \setminus \{v\}$ is a model of $P^{M[{{\mathcal I}}]}$, and hence $M[{{\mathcal I}}] \setminus \{v\}$ is also a model of $P^{M[{{\mathcal I}}]} \cup F_{{\mathcal I}}= (P \cup F_{{\mathcal I}})^{M[{{\mathcal I}}]}$. Thus, $M[{{\mathcal I}}]$ is not an answer set of $P \cup F_{{\mathcal I}}$. Due to property (P1), $M[{{\mathcal I}}] \setminus \{v\}$ is also a model of $P^{O[J^*]} \cup F_{{\mathcal I}}= (P \cup F_{{\mathcal I}})^{O[J^*]}$, for any $O[J^*]$ and so none of these $O[J^*]$ are answer sets of $P \cup F_{{\mathcal I}}$ either. Since this means that no model of $P \cup F_{{\mathcal I}}$ is an answer set, we conclude ${{\mathit AS}}(P \cup F_{{\mathcal I}}) = \emptyset$, and hence $P$ is not super-coherent.

Suppose that $\Phi$ is true. It is sufficient to show that, for each $F\subseteq U$, ${{\mathit AS}}(P\cup F)\neq \emptyset$. We distinguish the following cases for $F\subseteq U$:

$F\subseteq I\cup \overline{(X\setminus I)}\cup \{v\}$ for some $I\subseteq X$: If $v \in F$, then $M[I]$ is the unique model of $P^{M[I]} \cup F = (P \cup F)^{M[I]}$, and thus $M[I] \in {{\mathit AS}}(P\cup F)$. Otherwise, if $v \notin F$, since $\Phi$ is true, there exists a $J \subseteq Y$ such that $I\cup J \models \phi$. Thus, $N[I,J]$ is a model of $P\cup F$, and since no subset of $N[I,J]$ is a model of $(P\cup F)^{N[I,J]}$ (by property 3 of $\Phi$-norm-reductions), $N[I,J]\in {{\mathit AS}}(P\cup F)$.

$I \cup \overline{(X \setminus I)} \subset F \subseteq N[I,J]$ for some $I \subseteq X$ and $J\subseteq Y$ such that $I \cup J \models \phi$: In this case $N[I,J]$ is a model of $P \cup F$ and, by property 3 of $\Phi$-norm-reductions, $N[I,J]$ is also the unique model of $P^{N[I,J]} \cup F = (P \cup F)^{N[I,J]}$.

$I \cup \overline{(X \setminus I)} \subset F \subseteq N[I,J]$ for some $I \subseteq X$ and $J\subseteq Y$ such that $I \cup J \not\models \phi$: We shall show that $O[J]$ is an answer set of $P \cup F$ in this case. Let $M$ be a model of $P^{O[J]} \cup F = (P \cup F)^{O[J]}$. Since $I \cup \overline{(X \setminus I)} \subset F \subseteq N[I,J]$, either $w \in F$ or $(Y \cup \overline{Y}) \cap F \neq \emptyset$. Clearly, $F \subseteq M$ and so $w \in M$ in the first case. Note that $w \in M$ holds also in the second case because of property 4(c) of $\Phi$-norm-reductions. Thus, as a consequence of properties 4(a) and 4(b) of $\Phi$-norm-reductions, $J \cup \overline{(Y \setminus J)} \subseteq M$ holds. Since $I \cup J \not\models \phi$ and because of property 4(d) of $\Phi$-norm-reductions, $v \in M$ holds. Finally, since $\{v,w\} \subseteq M$ and because of property 4(e) of $\Phi$-norm-reductions, $X \cup \overline{X} \subseteq M$ holds and, thus, $M = O[J]$.

In all other cases, either $\{v,w\} \subseteq F$, or there is an $x \in X$ such that $\{x,\overline{x}\} \subseteq F$, or there is a $y \in Y$ such that $\{y,\overline{y}\} \subseteq F$. We shall show that in such cases there is an $O[J^*]$ which is an answer set of $P \cup F$. Let $O[J^*]$ be such that $J^* = F \cap (Y \cup \overline{Y})$ and let $M$ be a model of $P^{O[J^*]} \cup F = (P \cup F)^{O[J^*]}$ such that $M \subseteq O[J^*]$. We shall show that $O[J^*] \subseteq M$ holds, which would imply that $O[J^*] = M$ is an answer set of $P\cup F$. Clearly, $F \subseteq M$ holds. By property 4(e) of $\Phi$-norm-reductions, $X \cup \overline{X} \cup \{v,w\} \subseteq M$ holds. Thus, by property 4(a) of $\Phi$-norm-reductions and because $w \in M$, it holds that $y \in M$ for each $y \in Y$ such that $y \in O[J^*]$ and $\overline{y} \notin O[J^*]$. Similarly, by property 4(b) of $\Phi$-norm-reductions and because $w \in M$, it holds that $\overline{y} \in M$ for each $y \in Y$ such that $\overline{y} \in O[J^*]$ and $y \notin O[J^*]$. Moreover, for all $y \in Y$ such that $\{y,\overline{y}\} \subseteq O[J^*]$, it holds that $\{y,\overline{y}\} \subseteq F \subseteq M$. Therefore, $O[J^*] \subseteq M$ holds and, consequently, $O[J^*] \in {{\mathit AS}}(P\cup F)$.

So in each of these cases ${{\mathit AS}}(P\cup F) \neq \emptyset$ and since these cases cover all possible $F \subseteq U$, we obtain that $P$ is super-coherent.

Summarizing, we have shown that $\Phi$ being false implies that any $\Phi$-norm-reduction $P$ is not super-coherent, while $\Phi$ being true implies that any $\Phi$-norm-reduction is super-coherent, which proves the lemma.

We have now to show that for any QBF of the desired form, a $\Phi$-norm-reduction can be obtained in polynomial time (w.r.t. the size of $\Phi$).

\[def:norm\_phi\_program\] For any QBF $\Phi = \forall X\exists Y\phi$ with $\phi=\bigwedge_{i=1}^n l_{i,1}\lor\cdots\lor l_{i,m_i}$ in CNF, we define $$\begin{aligned}
\label{eq:nred:first}
N_\Phi & = & 
\{  
x {\leftarrow}{{\mathit not}}\ \overline{x};\; 
\overline{x} {\leftarrow}{{\mathit not}}\ x\; \mid x \in X\}
\cup{} \\
\label{eq:nred:second}
&&
\{  
y {\leftarrow}{{\mathit not}}\ \overline{y}, w;\; 
\overline{y} {\leftarrow}{{\mathit not}}\ y, w;\;
w {\leftarrow}y;\; w {\leftarrow}\overline{y}\;
\mid y\in Y\}
\cup{} \\
\nonumber
&& \{z {\leftarrow}v,w;\;
z {\leftarrow}x, \overline{x};\;
z {\leftarrow}y, \overline{y}\; \mid z\in X\cup \overline{X} \cup \{v, w\},\\
\label{eq:nred:third}
&& \hspace{17.5em} x \in X, y \in Y\}
\cup{}\\
\label{eq:nred:fourth}
&& \{ v  {\leftarrow}\overline{l}_{i,1},\ldots,\overline{l}_{i,m_i} \mid 1\leq i \leq  n\} \cup{} \\
\label{eq:nred:fifth}
&& \{
  w {\leftarrow}{{\mathit not}}\ v\}.\end{aligned}$$

The program above contains atoms associated with literals in $\Phi$ and two auxiliary atoms $v,w$. Intuitively, $v$ is derived by some rule in (\[eq:nred:fourth\]) whenever some clause of $\phi$ is violated. Otherwise, if $v$ is not derived, truth of $w$ is inferred by default because of rule (\[eq:nred:fifth\]). Moreover, truth values for variables in $X$ are guessed by rules in (\[eq:nred:first\]), and truth values for variables in $Y$ are guessed by rules in (\[eq:nred:second\]) provided that $w$ is true. Finally, rules in (\[eq:nred:third\]) derive all atoms in $X \cup \overline{X} \cup \{v,w\}$ whenever both $v$ and $w$ are true, or in case an inconsistent assignment for some propositional variable is forced by the addition of a set of facts to the program. It turns out that any answer set for such a program is such that truth values of atoms in $X \cup \overline{X} \cup Y \cup \overline{Y}$ represent a consistent assignment for propositional variables in $X \cup Y$ satisfying $\phi$.

Again, note that the program from the above definition can be constructed in polynomial time in the size of the reduced QBF. To conclude the proof, it is thus sufficient to show the following relation.

For any QBF $\Phi = \forall X\exists Y \phi$ with $\phi$ in CNF, the program $N_\Phi$ is a $\Phi$-norm-reduction.

We shall first show that $N_\Phi$ has the requested models. Let $M$ be a model of $N_\Phi$. Let us consider the atoms $v$ and $w$. Because of the rule $w {\leftarrow}{{\mathit not}}\ v$ in (\[eq:nred:fifth\]), three cases are possible:

1.  $\{v,w\} \subseteq M$. Thus, $X \cup \overline{X} \subseteq M$ holds because of (\[eq:nred:third\]). Moreover, there exists $J \subseteq Y$ such that $J \cup \overline{(Y \setminus J)} \subseteq M$ because of (\[eq:nred:second\]). Note that any other atom in $U$ could belong to $M$. These are the models $O[J^*]$.

2.  $v \in M$ and $w \notin M$. Thus, there exists $I \subseteq X$ such that $I \cup \overline{(X \setminus I)} \subseteq M$ because of (\[eq:nred:first\]). Moreover, no atoms in $Y \cup \overline{Y}$ belong to $M$ because of (\[eq:nred:second\]) and $w \notin M$ by assumption. Thus, $M = M[I]$ in this case.

3.  $v \notin M$ and $w \in M$. Thus, there exist $I \subseteq X$ and $J \subseteq Y$ such that $I \cup \overline{(X \setminus I)} \subseteq M$ and $J \cup \overline{(Y \setminus J)} \subseteq M$ because of (\[eq:nred:first\]) and (\[eq:nred:second\]). Hence, in this case $M = N[I,J]$ and, because of (\[eq:nred:fourth\]), it holds that $I \cup J \models \phi$.

Let us consider a reduct $P^{M[I]}$ and one of its models $M \subseteq M[I]$. First of all, note that $P^{M[I]}$ contains a fact for each atom in $I \cup \overline{(X \setminus I)}$. Thus, $I \cup \overline{(X \setminus I)} \subseteq M$ holds. Note also that, since each clause of $\phi$ contains at least one variable from $Y$, all of the rules of (\[eq:nred:fourth\]) have at least one false body literal. Hence, either $M = M[I]$ or $M = M[I] \setminus \{v\}$, as required by $\Phi$-norm-reductions.

For a reduct $P^{N[I,J]}$ such that $I \cup J \models \phi$ it is enough to note that $P^{N[I,J]}$ contains a fact for each atom of $N[I,J]$.

Let us consider a reduct $P^{O[J^*]}$ and one of its models $M \subseteq O[J^*]$. The first observation is that for each $y \in Y$ such that $y \in O[J^*]$ and $\overline{y} \notin O[J^*]$, the reduct $P^{O[J^*]}$ contains a rule of the form $y {\leftarrow}w$ (obtained by some rule in (\[eq:nred:second\])). Similarly, for each $y \in Y$ such that $\overline{y} \in O[J^*]$ and $y \notin O[J^*]$, the reduct $P^{O[J^*]}$ contains a rule of the form $\overline{y} {\leftarrow}w$ (obtained by some rule in (\[eq:nred:second\])). Hence, $M$ must satisfy properties 4(a) and 4(b) of $\Phi$-norm-reductions. Property 4(c) is a consequence of (\[eq:nred:second\]), property 4(d) follows from (\[eq:nred:fourth\]) and, finally, property 4(e) must hold because of (\[eq:nred:third\]).

Note that the program from Definition \[def:norm\_phi\_program\] does not contain constraints. As a consequence, the ${\ensuremath{{\Pi}_{2}^{P}}}$-hardness result presented in this section also holds if we only consider normal [$\rm ASP$]{} programs without constraints.

Simulating General Answer Set Programs Using Super-Coherent Programs {#sec:embedding}
====================================================================

Since [$\rm ASP^{\rm sc}$]{} programs are a proper subset of [$\rm ASP$]{} programs, a natural question to ask is whether the restriction to [$\rm ASP^{\rm sc}$]{} programs limits the range of problems that can be solved. In this section we show that this is not the case, i.e., all problems solvable in [$\rm ASP$]{} can be encoded in [$\rm ASP^{\rm sc}$]{}, and thus benefit from the optimization potential provided by DMS. Although these results are interesting from a theoretical point of view, we do not suggest that they have to be employed in practice. Often [$\rm ASP$]{} is associated with the decision problem of whether a program $P$ has any answer set (the coherence problem), that is testing whether ${{\mathit AS}}({P}) \neq \emptyset$. Of course, the coherence problem becomes trivial for [$\rm ASP^{\rm sc}$]{} programs. Another type of decision problem associated with [$\rm ASP$]{} is query answering, and indeed in this section we show that using query answering it is possible to simulate both coherence problems and query answering of [$\rm ASP$]{} by query answering over [$\rm ASP^{\rm sc}$]{} programs. Using the same construction, we show that also answer set computation problems for [$\rm ASP$]{} programs can be simulated by appropriate [$\rm ASP^{\rm sc}$]{} programs. While these constructions always yield disjunctive programs, we also show how to adapt them in order to yield normal [$\rm ASP^{\rm sc}$]{} programs when starting from normal programs.

We start by assigning to each disjunctive [$\rm ASP$]{} program a corresponding super-coherent program. In order to simplify the presentation, and without loss of generality, in this section we will only consider programs without constraints.

\[def:strat\] Let ${{P}}$ be a program the atoms of which belong to a countable set ${{\cal U}}$. We construct a new program ${\ensuremath{{P}_\mathit{strat}}}$ by using atoms of the following set: $${\ensuremath{{{\cal U}}_\mathit{strat}}} = {{\cal U}}\cup \{\alpha^T \mid \alpha \in {{\cal U}}\} \cup \{\alpha^F \mid \alpha \in {{\cal U}}\} \cup \{{\ensuremath{\mathit{fail}}}\},$$ where $\alpha^T$, $\alpha^F$ and ${\ensuremath{\mathit{fail}}}$ are fresh symbols not belonging to ${{\cal U}}$. Program ${\ensuremath{{P}_\mathit{strat}}}$ contains the following rules:

-   for each rule ${\ensuremath{r}}$ of ${P}$, a rule ${\ensuremath{{\ensuremath{r}}_\mathit{strat}}}$ such that

    -   ${\ensuremath{H({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} = {\ensuremath{H({\ensuremath{r}})}}$ and

    -   ${\ensuremath{B({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} = {\ensuremath{B^+({\ensuremath{r}})}} \cup \{\alpha^F \mid \alpha \in {\ensuremath{B^-({\ensuremath{r}})}}\};$

-   for each atom $\alpha$ in ${{\cal U}}$, three rules of the form $$\begin{aligned}
    \label{eq:rew:1} \alpha^T \vee \alpha^F & {\leftarrow}\\
    \label{eq:rew:2} \alpha^T & {\leftarrow}& \alpha \\
    \label{eq:rew:3} {\ensuremath{\mathit{fail}}}& {\leftarrow}& \alpha^T,\ {{\mathit not}}~\alpha.\end{aligned}$$

Intuitively, every rule ${\ensuremath{r}}$ of ${P}$ is replaced by a new rule ${\ensuremath{{\ensuremath{r}}_\mathit{strat}}}$ in which new atoms of the form $\alpha^F$ replace negative literals of ${\ensuremath{r}}$. Thus, our translation must guarantee that an atom $\alpha^F$ is true if and only if the associated atom $\alpha$ is false. In fact, this is achieved by means of rules of the form (\[eq:rew:1\]), (\[eq:rew:2\]) and (\[eq:rew:3\]):

-   (\[eq:rew:1\]) guarantees that either $\alpha^T$ or $\alpha^F$ belongs to every answer set of ${\ensuremath{{P}_\mathit{strat}}}$;

-   (\[eq:rew:2\]) assures that $\alpha^T$ belongs to every model of ${\ensuremath{{P}_\mathit{strat}}}$ containing atom $\alpha$; and

-   (\[eq:rew:3\]) derives ${\ensuremath{\mathit{fail}}}$ if $\alpha^T$ is true but $\alpha$ is false, that is, if $\alpha^T$ is only supported by a rule of the form (\[eq:rew:1\]).

It is not difficult to prove that the program ${\ensuremath{{P}_\mathit{strat}}}$ is super-coherent.

\[lem:strat-super\] Let ${P}$ be a disjunctive program. Program ${\ensuremath{{P}_\mathit{strat}}}$ is stratified and thus super-coherent.

All negative literals in ${\ensuremath{{P}_\mathit{strat}}}$ are those in rules of the form (\[eq:rew:3\]), the head of which is ${\ensuremath{\mathit{fail}}}$, an atom not occurring elsewhere in ${P}$.

Proving correspondence between answer sets of ${P}$ and ${\ensuremath{{P}_\mathit{strat}}}$ is slightly more difficult. To this aim, we first introduce some properties of the interpretations of ${\ensuremath{{P}_\mathit{strat}}}$.

\[lem:strat\_relation\] Let $I$ be an interpretation for ${\ensuremath{{P}_\mathit{strat}}}$ such that:

1.  for every $\alpha \in {{\cal U}}$, precisely one of $\alpha^T$ and $\alpha^F$ belongs to $I$;

2.  for every $\alpha \in {{\cal U}}$, $\alpha \in I$ if and only if $\alpha^T \in I$.

Then, for every rule ${\ensuremath{r}}$ of ${P}$, the following relation is established: $$\begin{aligned}
\label{eq:strat_relation}
{\ensuremath{B^+({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} \subseteq I &
\Longleftrightarrow & 
{\ensuremath{B^+({\ensuremath{r}})}} \subseteq (I \cap {{\cal U}}) \mathit{\ and\ } {\ensuremath{B^-({\ensuremath{r}})}} \cap (I \cap {{\cal U}}) = \emptyset.\end{aligned}$$

By combining properties of $I$ (item 1 and 2), we have that $\alpha^F \in I$ if and only if $\alpha \not\in I$. The claim thus follows by construction of ${\ensuremath{{P}_\mathit{strat}}}$. In fact, ${\ensuremath{B^+({\ensuremath{r}})}} = {\ensuremath{B^+({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} \cap {{\cal U}}$ and ${\ensuremath{B^-({\ensuremath{r}})}} = \{\alpha \mid \alpha^F \in {\ensuremath{B^+({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} \setminus {{\cal U}}\}$.

We are now ready to formalize and prove the correspondence between answer sets of ${P}$ and ${\ensuremath{{P}_\mathit{strat}}}$.

\[thm:strat-equiv\] Let ${P}$ be a program and ${\ensuremath{{P}_\mathit{strat}}}$ the program obtained as described in Definition \[def:strat\]. The following relation holds: $${{\mathit AS}}({P}) = \{M \cap {{\cal U}}\mid M \in {{\mathit AS}}({\ensuremath{{P}_\mathit{strat}}}) \wedge {\ensuremath{\mathit{fail}}}\not\in M\}.$$

$(\supseteq)$ Let $M$ be an answer set of ${\ensuremath{{P}_\mathit{strat}}}$ such that ${\ensuremath{\mathit{fail}}}\not\in M$. We shall show that $M \cap {{\cal U}}$ is an answer set of ${P}$.

We start by observing that $M$ has the properties required by Lemma \[lem:strat\_relation\]:

-   The first property is guaranteed by rules of the form (\[eq:rew:1\]) and because atoms of the form $\alpha^F$ occur as head atoms only in these rules;

-   the second property is ensured by rules of the form (\[eq:rew:2\]) and (\[eq:rew:3\]), combined with the assumption ${\ensuremath{\mathit{fail}}}\not\in M$.

Therefore, relation (\[eq:strat\_relation\]) holds for $M$, which combined with the assumption that $M$ is a model of ${\ensuremath{{P}_\mathit{strat}}}$, implies that $M \cap {{\cal U}}$ is a model of ${P}$. We next show that $M \cap {{\cal U}}$ is also a minimal model of the reduct ${P}^{(M \cap {{\cal U}})}$.

Let $(M \cap {{\cal U}}) \setminus \Delta$ be a model of ${P}^{(M \cap {{\cal U}})}$, for some set $\Delta \subseteq {{\cal U}}$. We next prove that $M \setminus \Delta$ is a model of ${\ensuremath{{P}_\mathit{strat}}}^M$, which implies that $\Delta = \emptyset$ since $M$ is an answer set of ${\ensuremath{{P}_\mathit{strat}}}$. All of the rules of ${\ensuremath{{P}_\mathit{strat}}}^M$ obtained from (\[eq:rew:1\]), (\[eq:rew:2\]) and (\[eq:rew:3\]) are satisfied by $M \setminus \Delta$: Rules of ${\ensuremath{{P}_\mathit{strat}}}^M$ obtained from (\[eq:rew:1\]), (\[eq:rew:2\]) remain equal and since $\Delta \subseteq {{\cal U}}$ and since their heads are not in ${{\cal U}}$, satisfaction by $M$ implies satisfaction by $M \setminus \Delta$. Rules of ${\ensuremath{{P}_\mathit{strat}}}^M$ obtained from (\[eq:rew:3\]) are such that $\alpha \not\in M$, in addition since ${\ensuremath{\mathit{fail}}}\not\in M$ also ${\ensuremath{\mathit{fail}}}\not\in M \setminus \Delta$, and since the rule is satisfied by $M$, $\alpha^T \not\in M$ and thus also $\alpha^T \not\in M \setminus \Delta$. Every remaining rule ${\ensuremath{{\ensuremath{r}}_\mathit{strat}}} \in {\ensuremath{{P}_\mathit{strat}}}$ is such that ${\ensuremath{r}}\in {P}$. If ${\ensuremath{B^+({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} \subseteq M \setminus \Delta \subseteq M$, we can apply (\[eq:strat\_relation\]) and conclude ${\ensuremath{B^-({\ensuremath{r}})}} \cap (M \cap {{\cal U}}) = \emptyset$, that is, a rule obtained from ${\ensuremath{r}}$ by removing negative literals belongs to ${P}^{(M \cap {{\cal U}})}$. Moreover, we can conclude that ${\ensuremath{B^+({\ensuremath{r}})}} = {\ensuremath{B^+({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} \cap {{\cal U}}\subseteq (M \cap {{\cal U}}) \setminus \Delta$, and thus $\emptyset \neq {\ensuremath{H({\ensuremath{r}})}} \cap (M \cap {{\cal U}}) \setminus \Delta 
= {\ensuremath{H({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} \cap M \setminus \Delta$.

$(\subseteq)$ Let $M$ be an answer set of ${P}$. We shall show that $$M' = M \cup \{\alpha^T \mid \alpha \in M\} \cup 
\{\alpha^F \mid \alpha \in {{\cal U}}\setminus M\}$$ is an answer set of ${\ensuremath{{P}_\mathit{strat}}}$.

We first observe that relation (\[eq:strat\_relation\]) holds for $M'$, which combined with the assumption that $M$ is a model of ${P}$ implies that $M'$ is a model of ${\ensuremath{{P}_\mathit{strat}}}$. We can then show that $M'$ is also a minimal model for the reduct ${\ensuremath{{P}_\mathit{strat}}}^{M'}$. In fact, we can show that every $N \subseteq M'$ modeling ${\ensuremath{{P}_\mathit{strat}}}^{M'}$ is such that $N = M'$ in two steps:

1.  $N \setminus {{\cal U}}= M' \setminus {{\cal U}}$. This follows by rules of the form (\[eq:rew:1\]) and by construction of $M'$. In fact, rules of the form (\[eq:rew:1\]) belongs to ${\ensuremath{{P}_\mathit{strat}}}^{M'}$, of which $N$ is a model by assumption. For each $\alpha \in {{\cal U}}$, these rules enforce the presence of at least one of $\alpha^T$ and $\alpha^F$ in $N$. By construction, $M'$ contains exactly one of $\alpha^T$ or $\alpha^F$ for each $\alpha \in {{\cal U}}$, and we thus conclude $N \setminus {{\cal U}}= M' \setminus {{\cal U}}$.

2.  $N \cap {{\cal U}}= M' \cap {{\cal U}}$. Note that $M' \cap {{\cal U}}= M$. Moreover, from the assumption $N \subseteq M'$, we have $N \cap {{\cal U}}\subseteq M' \cap {{\cal U}}= M$. Thus, it is enough to show that $N \cap {{\cal U}}$ is a model of ${P}^M$ because in this case $N \cap {{\cal U}}= M$ would be a consequence of the assumption $M \in {{\mathit AS}}({P})$.

    In order to show that $N \cap {{\cal U}}$ is a model of ${P}^M$, let us consider a rule ${\ensuremath{r}}'$ of ${P}^M$ with ${\ensuremath{B^+({\ensuremath{r}}')}} \subseteq N \cap {{\cal U}}$. Such a rule has been obtained from a rule ${\ensuremath{r}}$ of ${P}$ such that ${\ensuremath{B^-({\ensuremath{r}})}} \cap M = \emptyset$. Let us consider ${\ensuremath{{\ensuremath{r}}_\mathit{strat}}} \in {\ensuremath{{P}_\mathit{strat}}}$, recall that ${\ensuremath{{\ensuremath{r}}_\mathit{strat}}}$ has been obtained from ${\ensuremath{r}}$ by replacing negatively occurring atoms $\alpha$ by $\alpha^F$. Clearly, ${\ensuremath{{\ensuremath{r}}_\mathit{strat}}} \in {\ensuremath{{P}_\mathit{strat}}}^{M'}$ because ${\ensuremath{B^-({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} = \emptyset$ by construction. Moreover, since ${\ensuremath{B^+({\ensuremath{r}}')}} \subseteq N \cap {{\cal U}}$, we get ${\ensuremath{B^+({\ensuremath{r}})}} \subseteq N \cap {{\cal U}}$ (recall that ${\ensuremath{r}}'$ is the reduct of ${\ensuremath{r}}$ with respect to $M$, thus ${\ensuremath{B^+({\ensuremath{r}})}}={\ensuremath{B^+({\ensuremath{r}}')}}$) and consequently ${\ensuremath{B^+({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} \cap {{\cal U}}\subseteq N \cap {{\cal U}}$ (since ${\ensuremath{B^+({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} \cap {{\cal U}}= {\ensuremath{B^+({\ensuremath{r}})}}$). Furthermore, ${\ensuremath{B^+({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} \setminus {{\cal U}}= \{\alpha^F \mid \alpha \in
    {\ensuremath{B^-({\ensuremath{r}})}}\}$, and since ${\ensuremath{B^-({\ensuremath{r}})}}\cap M =\emptyset$ we get ${\ensuremath{B^+({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} \setminus {{\cal U}}\subseteq M' \setminus {{\cal U}}$ (since $\alpha^F \in M'$ if and only if $\alpha \not\in M$); given $N
    \setminus {{\cal U}}= M' \setminus {{\cal U}}$ we also have ${\ensuremath{B^+({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}}
    \setminus {{\cal U}}\subseteq N \setminus {{\cal U}}$. In total, we obtain ${\ensuremath{B^+({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} \subseteq N$. Since by assumption $N$ is a model of ${\ensuremath{{P}_\mathit{strat}}}^{M'}$, ${\ensuremath{H({\ensuremath{{\ensuremath{r}}_\mathit{strat}}})}} \cap N \neq \emptyset$ and we can conclude that ${\ensuremath{H({\ensuremath{r}}')}} \cap (N \cap {{\cal U}}) \neq \emptyset$, that is, rule ${\ensuremath{r}}'$ is satisfied by $N \cap {{\cal U}}$.

Summarizing, no $N \subsetneq M'$ is a model of ${\ensuremath{{P}_\mathit{strat}}}^{M'}$, and hence $M'$ is a minimal model of ${\ensuremath{{P}_\mathit{strat}}}^{M'}$ and thus an answer set of ${\ensuremath{{P}_\mathit{strat}}}$.

Let us now consider normal programs. Our aim is to define a translation for associating every normal program with a super-coherent normal program. Definition \[def:strat\] alone is not suitable for this purpose, as rules of the form (\[eq:rew:1\]) are disjunctive. However, it is not difficult to prove that the application of Definition \[def:strat\] to normal programs yields head-cycle free programs.

\[lem:normal-hcf\] If ${P}$ is a normal program, ${\ensuremath{{P}_\mathit{strat}}}$ is head-cycle free.

Since ${P}$ is normal, all disjunctive rules in ${\ensuremath{P_\mathit{strat}}}$ are of the form (\[eq:rew:1\]). Atoms $\alpha^T$ and $\alpha^F$ are not involved in any cycle of dependencies because $\alpha^F$ do not appear in any other rule heads.

Hence, for a normal program ${P}$, we construct a head-cycle free program ${\ensuremath{{P}_\mathit{strat}}}$. It is well known in the literature that a head-cycle free program ${P}$ can be associated to a *uniformly equivalent* normal program ${P}^\rightarrow$, meaning that ${P}\cup F$ and ${P}^\rightarrow \cup F$ are equivalent, for each set of facts $F$. Below, we recall this result.

\[def:shift\] Let ${P}$ be a disjunctive program. We construct a new program ${P}^\rightarrow$ as follows:

-   all the rules ${\ensuremath{r}}\in {P}$ with ${\ensuremath{H({\ensuremath{r}})}} = \emptyset$ belong to ${P}^\rightarrow$;

-   for each rule ${\ensuremath{r}}\in {P}$ with ${\ensuremath{H({\ensuremath{r}})}} \neq \emptyset$, and for each atom $\alpha \in {\ensuremath{H({\ensuremath{r}})}}$, program ${P}^\rightarrow$ contains a rule ${\ensuremath{r}}^\rightarrow$ such that ${\ensuremath{H({\ensuremath{r}}^\rightarrow)}} = \{\alpha\}$, ${\ensuremath{B^+({\ensuremath{r}}^\rightarrow)}} = {\ensuremath{B^+({\ensuremath{r}})}}$ and ${\ensuremath{B^-({\ensuremath{r}}^\rightarrow)}} = {\ensuremath{B^-({\ensuremath{r}})}} \cup ({\ensuremath{H({\ensuremath{r}})}} \setminus \{\alpha\})$.

\[thm:shift-uniform\] For any head-cycle free program ${P}$, and any set of atoms $F$, it holds that ${{\mathit AS}}({P}\cup F) = {{\mathit AS}}({P}^\rightarrow \cup F)$.

Thus, by combining Definitions \[def:strat\] and \[def:shift\], we can associate every normal program with a super-coherent normal program.

For a program ${P}$, let ${\ensuremath{{P}_\mathit{strat}}}^\rightarrow$ be the program obtained by applying the transformation in Definition \[def:shift\] to the program ${\ensuremath{{P}_\mathit{strat}}}$. If ${P}$ is a normal program, ${\ensuremath{{P}_\mathit{strat}}}^\rightarrow$ is super-coherent and such that: $${{\mathit AS}}({P}) = \{M \cap {{\cal U}}\mid M \in {{\mathit AS}}({\ensuremath{{P}_\mathit{strat}}}^\rightarrow) \wedge {\ensuremath{\mathit{fail}}}\not\in M\}.$$

By Lemma \[lem:normal-hcf\] and Theorem \[thm:shift-uniform\], ${{\mathit AS}}({\ensuremath{{P}_\mathit{strat}}} \cup F) = {{\mathit AS}}({\ensuremath{{P}_\mathit{strat}}}^\rightarrow \cup F)$, for any set $F$ of facts. Moreover, with Lemma \[lem:strat-super\], we obtain that ${\ensuremath{{P}_\mathit{strat}}}^\rightarrow$ is super-coherent. Finally, by using Theorem \[thm:strat-equiv\], ${{\mathit AS}}({P}) = \{M \cap {{\cal U}}\mid M \in {{\mathit AS}}({\ensuremath{{P}_\mathit{strat}}}^\rightarrow) \wedge {\ensuremath{\mathit{fail}}}\not\in M\}$ holds.

Note that the program ${\ensuremath{{P}_\mathit{strat}}}^\rightarrow$ can be obtained from ${P}$ by applying the rewriting introduced by Definition \[def:strat\], in which rules of the form (\[eq:rew:1\]) are replaced by rules of the following form: $$\label{eq:rew:1shift}
\alpha^T {\leftarrow}{{\mathit not}}~\alpha^F \qquad
\alpha^F {\leftarrow}{{\mathit not}}~\alpha^T.$$ We also note that it is possible to use rules (\[eq:rew:1shift\]) instead of rules (\[eq:rew:1\]) for the general, disjunctive case, such that Theorem \[thm:strat-equiv\] would still hold. However, the proof is somewhat more involved.

We can now relate the coherence and query answering problems for [$\rm ASP$]{} to corresponding query answering problems for [$\rm ASP^{\rm sc}$]{}, and thus conclude that all of the problems solvable in this way using [$\rm ASP$]{} are also solvable using [$\rm ASP^{\rm sc}$]{}.

Given a program ${P}$ over ${{\cal U}}$,

1.  ${{\mathit AS}}({P}) = \emptyset$ if and only if ${\ensuremath{\mathit{fail}}}$ is cautiously true for ${\ensuremath{{P}_\mathit{strat}}}$;

2.  a query ${\ensuremath{\mathit{q}}}$ is bravely true for ${P}$ if and only if ${\ensuremath{\mathit{q'}}}$ is bravely true for the [$\rm ASP^{\rm sc}$]{} program ${\ensuremath{{P}_\mathit{strat}}} \cup \{ {\ensuremath{\mathit{q'}}}{\leftarrow}{\ensuremath{\mathit{q}}}, {{\mathit not}}~{\ensuremath{\mathit{fail}}}\}$;

3.  a query ${\ensuremath{\mathit{q}}}$ is cautiously true for ${P}$ if and only if ${\ensuremath{\mathit{q'}}}$ is cautiously true for the [$\rm ASP^{\rm sc}$]{} program ${\ensuremath{{P}_\mathit{strat}}} \cup \{ {\ensuremath{\mathit{q'}}}{\leftarrow}{\ensuremath{\mathit{q}}}; {\ensuremath{\mathit{q'}}}{\leftarrow}{\ensuremath{\mathit{fail}}}\}$,

where ${\ensuremath{\mathit{q'}}}$ is a fresh atom, which does not occur in ${P}$ and ${\ensuremath{{P}_\mathit{strat}}}$.

We first observe that programs ${\ensuremath{{P}_\mathit{strat}}} \cup \{ {\ensuremath{\mathit{q'}}}{\leftarrow}{\ensuremath{\mathit{q}}}, {{\mathit not}}~{\ensuremath{\mathit{fail}}}\}$ and ${\ensuremath{{P}_\mathit{strat}}} \cup \{ {\ensuremath{\mathit{q'}}}{\leftarrow}{\ensuremath{\mathit{q}}}; {\ensuremath{\mathit{q'}}}{\leftarrow}{\ensuremath{\mathit{fail}}}\}$ are [$\rm ASP^{\rm sc}$]{}. In fact, rules ${\ensuremath{\mathit{q'}}}{\leftarrow}{\ensuremath{\mathit{q}}}, {{\mathit not}}~{\ensuremath{\mathit{fail}}}$ and $\{ {\ensuremath{\mathit{q'}}}{\leftarrow}{\ensuremath{\mathit{q}}}; {\ensuremath{\mathit{q'}}}{\leftarrow}{\ensuremath{\mathit{fail}}}\}$ do not introduce cycles in these programs as ${\ensuremath{\mathit{q'}}}$ does not occur in ${P}$ and ${\ensuremath{{P}_\mathit{strat}}}$. We now prove the other statements of the theorem.

\(1) If ${{\mathit AS}}({P}) = \emptyset$, by Theorem \[thm:strat-equiv\] either ${{\mathit AS}}({\ensuremath{{P}_\mathit{strat}}})=\emptyset$ (this will not occur because ${\ensuremath{{P}_\mathit{strat}}}$ is super-coherent) or ${\ensuremath{\mathit{fail}}}\in M$ for all $M \in
  {{\mathit AS}}({\ensuremath{{P}_\mathit{strat}}})$. In either case ${\ensuremath{\mathit{fail}}}$ is cautiously true for ${\ensuremath{{P}_\mathit{strat}}}$. If ${\ensuremath{\mathit{fail}}}$ is cautiously true for ${\ensuremath{{P}_\mathit{strat}}}$, then ${\ensuremath{\mathit{fail}}}\in M$ for all $M \in {{\mathit AS}}({\ensuremath{{P}_\mathit{strat}}})$, hence by Theorem \[thm:strat-equiv\], ${{\mathit AS}}({P}) = \emptyset$.

\(2) Let ${P}^+$ denote ${\ensuremath{{P}_\mathit{strat}}} \cup \{ {\ensuremath{\mathit{q'}}}{\leftarrow}{\ensuremath{\mathit{q}}}, {{\mathit not}}~{\ensuremath{\mathit{fail}}}\}$. If ${\ensuremath{\mathit{q}}}$ is bravely true for ${P}$, there is $M \in {{\mathit AS}}({P})$ such that ${\ensuremath{\mathit{q}}}\in M$, and by Theorem \[thm:strat-equiv\] there is an $M' \in {{\mathit AS}}({\ensuremath{{P}_\mathit{strat}}})$ such that ${\ensuremath{\mathit{fail}}}\not \in M'$ and $M =
  M'\cap {{\cal U}}$, and hence ${\ensuremath{\mathit{q}}}\in M'$. Therefore $M' \cup \{{\ensuremath{\mathit{q'}}}\} \in
  {{\mathit AS}}({P}^+)$ and thus ${\ensuremath{\mathit{q'}}}$ is bravely true for ${P}^+$. If ${\ensuremath{\mathit{q'}}}$ is bravely true for ${P}^+$, then there exists one $N \in {{\mathit AS}}({P}^+)$ such that ${\ensuremath{\mathit{q'}}}\in N$. Then $N^- = N \setminus \{{\ensuremath{\mathit{q'}}}\}$ is in ${{\mathit AS}}({\ensuremath{{P}_\mathit{strat}}})$ and ${\ensuremath{\mathit{fail}}}$ is not in $N$ and $N^-$, while ${\ensuremath{\mathit{q}}}$ is in both $N$ and $N^-$. Therefore, by Theorem \[thm:strat-equiv\], $N'= N\cap {{\cal U}}$ is in ${{\mathit AS}}({P})$ and ${\ensuremath{\mathit{q}}}\in N'$, hence ${\ensuremath{\mathit{q}}}$ is bravely true for ${P}$.

\(3) Let ${P}^+$ denote ${\ensuremath{{P}_\mathit{strat}}} \cup \{ {\ensuremath{\mathit{q'}}}{\leftarrow}{\ensuremath{\mathit{q}}}; {\ensuremath{\mathit{q'}}}{\leftarrow}{\ensuremath{\mathit{fail}}}\}$. If ${\ensuremath{\mathit{q}}}$ is cautiously true for ${P}$, then ${\ensuremath{\mathit{q}}}\in M$ for all $M \in {{\mathit AS}}({P})$. By Theorem \[thm:strat-equiv\], each $M' \in
  {{\mathit AS}}({\ensuremath{{P}_\mathit{strat}}})$ either is of the form $M = M'\cap {{\cal U}}$ for some $M
  \in {{\mathit AS}}({P})$ and thus ${\ensuremath{\mathit{q}}}\in M'$ or ${\ensuremath{\mathit{fail}}}\in M'$. In either case we get $M' \cup \{{\ensuremath{\mathit{q'}}}\} \in {{\mathit AS}}({P}^+)$ and hence that ${\ensuremath{\mathit{q'}}}$ is cautiously true for ${P}^+$. If ${\ensuremath{\mathit{q'}}}$ is cautiously true for ${P}^+$, then ${\ensuremath{\mathit{q'}}}\in N$ for each $N\in {{\mathit AS}}(P^+)$. Each of these $N$ contains either (a) ${\ensuremath{\mathit{fail}}}$ or (b) ${\ensuremath{\mathit{q}}}$, and ${{\mathit AS}}({\ensuremath{P_\mathit{strat}}}) =
  \{N \setminus \{{\ensuremath{\mathit{q'}}}\} \mid N \in {{\mathit AS}}(P^+)\}$. By Theorem \[thm:strat-equiv\], each $N^-\in {{\mathit AS}}({P})$ is of the form $N^-=N\cap {{\cal U}}$ for those $N \in {{\mathit AS}}(P^+)$ which do not contain ${\ensuremath{\mathit{fail}}}$, hence are of type (b) and contain ${\ensuremath{\mathit{q}}}$. Therefore ${\ensuremath{\mathit{q}}}$ is in all $N^-\in {{\mathit AS}}({P})$ and is therefore cautiously true for ${P}$.

Some Implications {#sec:impl}
=================

[ ]{} studied the following problem under the name “uniform equivalence with projection:”

-   Given two programs $P$ and $Q$, and two sets $A,B$ of atoms, $P\equiv^A_B Q$ if and only if for each set $F\subseteq A$ of facts, $\{ I\cap B \mid I \in {{\mathit AS}}(P\cup F)\} =
    \{ I\cap B \mid I \in {{\mathit AS}}(Q\cup F)\}$.

Let us call $A$ the context alphabet and $B$ the projection alphabet. As is easily verified the following relation holds.

\[prop:relation\] A program $P$ over atoms $U$ is super-coherent if and only if $P\equiv^U_\emptyset Q$, where $Q$ is an arbitrary definite Horn program.

Note that $P\equiv^U_\emptyset Q$ means $\{ I\cap \emptyset \mid I \in {{\mathit AS}}(P\cup F)\} = \{ I\cap \emptyset \mid I \in {{\mathit AS}}(Q\cup F)\}$ for all sets $F \subseteq U$. Now observe that for any $F \subseteq U$, both of these sets are either empty or contain the empty set, depending on whether the programs (extended by $F$) have answer sets. Formally, we have $$\{ I\cap \emptyset \mid I \in {{\mathit AS}}(P\cup F)\} = \left\{ 
\begin{array}{cl}
\emptyset & \mbox{ iff } {{\mathit AS}}(P\cup F) = \emptyset\\
\{\emptyset\} & \mbox{ iff } {{\mathit AS}}(P\cup F) \neq \emptyset
\end{array}
\right.$$ $$\{ I\cap \emptyset \mid I \in {{\mathit AS}}(Q\cup F)\} = \left\{ 
\begin{array}{cl}
\emptyset & \mbox{ iff } {{\mathit AS}}(Q\cup F) = \emptyset\\
\{\emptyset\} & \mbox{ iff } {{\mathit AS}}(Q\cup F) \neq \emptyset
\end{array}
\right.$$

If $Q$ is a definite Horn program, then ${{\mathit AS}}(Q\cup F) \neq \emptyset$ for all $F \subseteq U$, and therefore the statement of Proposition \[prop:relation\] becomes equivalent to checking whether ${{\mathit AS}}(P\cup F) \neq \emptyset$ for all $F \subseteq U$, and thus whether $P$ is super-coherent.

[ ]{} also investigated the complexity of the problem of deciding uniform equivalence with projection, reporting ${\ensuremath{{\Pi}_{3}^{P}}}$-completeness for disjunctive programs and ${\ensuremath{{\Pi}_{2}^{P}}}$-completeness for normal programs. However, these hardness results use bound context alphabets $A\subset U$ (where $U$ are all atoms from the compared programs). Our results thus strengthen the observations of [ ]{}. Using Proposition \[prop:relation\] and the main results in this paper, we can state the following result.

The problem of deciding $P\equiv^U_\emptyset Q$ for given disjunctive (resp. normal) programs $P$ and $Q$ is ${\ensuremath{{\Pi}_{3}^{P}}}$-complete (resp. ${\ensuremath{{\Pi}_{2}^{P}}}$-complete) even in case $U$ is the set of all atoms occurring in $P$ or $Q$. Hardness already holds if one the programs is the empty program.

Conclusion {#sec:concl}
==========

Many recent advances in ASP rely on the adaptions of technologies from other areas. One important example is the Magic Set method, which stems from the area of databases and is used in state-of-the-art ASP grounders. Recent work showed that the ASP variant of this technique only applies to the class of programs called super-coherent [@alvi-fabe-2011-aicom]. Super-coherent programs are those which possess at least one answer set, no matter which set of facts is added to them. We believe that this class of programs is interesting per se (for instance, since there is a strong relation to some problems in equivalence checking), and also showed that all of the interesting ASP tasks can be solved using super-coherent programs only. For these reasons we have studied the exact complexity of recognizing the property of super-coherence for disjunctive and normal programs. Our results show that the problems are surprisingly hard, viz. complete for ${\ensuremath{{\Pi}_{3}^{P}}}$ and resp. ${\ensuremath{{\Pi}_{2}^{P}}}$. Our results also imply that any reasoning tasks over [$\rm ASP$]{} can be transformed into tasks over [$\rm ASP^{\rm sc}$]{}. In particular, this means that all query answering tasks over [$\rm ASP$]{} can be transformed into query answering over [$\rm ASP^{\rm sc}$]{}, on which the magic set technique can therefore be applied. However, we believe that the magic set technique will often not produce efficient rewritings for programs obtained by the automatic transformation of Section \[sec:embedding\]. A careful analysis of this aspect is however left for future work, as it is also not central to the topics of this article.

[^1]: Preliminary versions of this article have been presented at at the ICLP workshop on Answer Set Programming and Other Computing Paradigms (ASPOCP) and at the Convegno Italiano di Logica Computazionale (CILC). This work is partly supported by Regione Calabria and EU under POR Calabria FESR 2007-2013 and within the PIA project of DLVSYSTEM s.r.l., by MIUR under the PRIN project LoDeN, and by the Vienna University of Technology under the program “Innovative Ideas”. We also thank the anonymous reviewers from ASPOCP and CILC for their valuable comments.

[^2]: Here and below, for a reduct $P^M$ we only list models of the form $N\subseteq M$, since those are the relevant ones for our purposes. Recall that $N=M$ is always a model of $P^M$ in case $M$ is a model of $P$.
