• Keine Ergebnisse gefunden

We first prove that ENTAILMENT3 is co-NP-hard with a reduction from “3-DNF Tautology”. This reduction will be reused to prove theP||N P-hardness of ENTAILMENT3. Theorem 6 The problemENTAILMENT3is co-NP-hard.

Proof:To prove that ENTAILMENT3is co-NP-hard, we define a reduction from the co-NP-complete problem 3-DNF Tautology to ENTAILMENT3.

3-DNF Tautology

Input:a 3-DNF propositional formulaΦ, i.e., a propositionΦin disjunctive normal form (disjunction of conjunctions of literals) such that each conjunction inΦhas at most 3 literals.

Question:IsΦa tautology?

The reduction uses Prop. 12. Let Φbe a 3-DNF proposition. By Prop. 12, it is sufficient to build two PGsGandH in polynomial time, withHbeing consistent and containing at most 3 exchangeable pairs, such that for some completion sub-graphG0ofGcontained inGs,DG0(G, H)is a tautology iffΦalso is.

It is rather easy to build such PGsGand H with at most 9 exchangeable pairs.

To ensure that they have at most 3 exchangeable pairs, we have to refine the con-struction. For this, we introduce the notion ofexchange-reducingmapping w.r.t.

Φ(standing for “mapping allowing to reduce the number of exchangeable pairs in the graphGbuilt by the reduction”). We will build a graphGwith 3 positive literals and 3 negative literals with relation namep. Using an exchange-reducing mapping in the construction of graphH will make each positive literal+p(u)in Gbe potentially exchangeable with only one negative literal, which reduces the number of potential exchangeable pairs from 9 to 3. This will be explained in the last paragraph of this proof.

LetP be the set of atoms occurring inΦ. A mappingαfromP to{1,2,3}is said to beexchange-reducing(w.r.t. Φ) if for any conjunctionC inΦand any positive literalspandp0(resp. negative literals¬pand¬p0) inC,α(p)6=α(p0).

For instance, ifΦ = (¬p∧ ¬s)∨(s∧ ¬q∧ ¬r)∨(p∧q∧r)then the mapping α={(p,1),(q,2),(r,3),(s,2)}is exchange-reducing. Note that there may be no exchange-reducing mapping w.r.t. a givenΦ. For instance, ifΦ = (p∧q∧r)∨(p∧ q∧s)∨(r∧s)then an exchange-reducing mappingαshould satisfyα(r) =α(s) from the two first conjunctions, andα(r)6=α(s)from the third conjunction.

In the first step of the proof, we will describe how to build in polynomial time from a 3-DNF propositionΦboth a 3-DNF propositionΦ0, such thatΦ0is a tautology iff Φis, and an exchange-reducing mappingαw.r.t.Φ0(which will necessarily exist).

In the second step, we will describe how to build PGs GandH with at most 3 exchangeable pairs from a 3-DNFΦand an exchange-reducing mapping w.r.t. Φ, such that for some completion subgraphG0 ofGcontained inGs,DG0(G, H)is a tautology iffΦis.

1. Construction ofΦ0 andα

For each atom p in P, leth be the number of occurrences of p in Φ. These h occurrences are replaced byhnew atomsp1,p2, . . . ,ph, and the 3-DNF formula N EQ(p1, . . . , ph) = (p1∧ ¬p2)∨(p2∧ ¬p3)∨. . .∨(ph−1∧ ¬ph)∨(ph∧ ¬p1) is added to the disjunction. Φ0 is the obtained formula. For instance, if Φ = (¬p∧ ¬s)∨(s∧ ¬q∧ ¬r)∨(p∧q∧r)thenΦ0 = (¬p1∧ ¬s1)∨(s2∧ ¬q1∧ ¬r1)∨ (p2∧q2∧r2)∨N EQ(p1, p2)∨N EQ(q1, q2)∨N EQ(r1, r2)∨N EQ(s1, s2). Note that a truth assignment satisfiesN EQ(p1, . . . , ph)iff it does not assign the same truth value to allp1, . . . , ph. It follows thatΦ0 is a tautology iff it is satisfied by each truth assignment assigning the same truth value top1, . . . , phfor each atomp inPH. ThusΦ0is a tautology iffΦis.

An exchange-reducing mapping α w.r.t. Φ0 is built as follows: for each con-junction inΦ0 coming from a conjunction inΦ(considered independently of the others), atoms of positive (resp. negative) literals are mapped to consecutive in-tegers starting from 1; α is the union of the mappings obtained for these con-junctions. For instance, ifΦ0 = (¬p1 ∧ ¬s1)∨(s2 ∧ ¬q1∧ ¬r1)∨(p2∧q2 ∧ r2)∨N EQ(p1, p2)∨N EQ(q1, q2)∨N EQ(r1, r2)∨N EQ(s1, s2)then we in-dependently define α1 = {(p1,1),(s1,2)}, α2 = {(s2,1),(q1,1),(r1,2)} and α3 ={(p2,1),(q2,2),(r2,3)}, andα =α1∪α2∪α3. It is easy to check thatΦ0 andαcan be computed in polynomial time and thatαis exchange-reducing w.r.t.

Φ0.

2. Construction ofGandH

LetΦbe a 3-DNF formula andαbe an exchange-reducing mapping w.r.t. Φ. PGs GandHare defined as follows (see Figure 6 for an illustration).

Gis independent ofΦandα. It has 6 variable nodesx1,x2,x3,y1,y2andy3, and 7 literals: +r(x1, x2, x3, y1, y2, y3) and, for alliin1, . . . ,3,+p(xi)and−p(yi).

Hdepends fromΦandα. Letp1, . . . , phbe the atoms inΦ, and letC1, . . . , Cqbe the conjunctions inΦ. Hhash+ 2constant nodes labeled witha1, . . . , ah,cand d, and it hasq+ 2 literals: +p(c), −p(d)and, for alliin1, . . . , q, +r(ui), with ui = (si,1, si,2, si,3, ti,1, ti,2, ti,3)being defined as follows. For alliin1, . . . , qand alljin1, . . . ,3:

- ifj=α(pk)for some positive literalpkinCi(there is at most one such literalpk sinceαis exchange-reducing) thensi,j =akelsesi,j =c,

- ifj =α(pk)for some negative literal¬pkinCi(there is at most one such literal

¬pksinceαis exchange-reducing) thenti,j =akelseti,j =d.

For instance, consider the formula of the previous example:(¬p∧ ¬s)∨(s∧ ¬q∧

¬r) ∨(p∧q ∧r). Let us rename p, q, r and sinto p1, p2, p3 andp4 respec-tively. We obtainΦ = (¬p1 ∧ ¬p4)∨(p4∧ ¬p2∧ ¬p3)∨(p1 ∧p2 ∧p3). Let α ={(p1,1),(p2,2),(p3,3),(p4,2)}. Then the literals ofH labeled with+r are +r(c, c, c, a1, a4, d),+r(c, a4, c, d, a2, a3) and+r(a1, a2, a3, d, d, d), as pictured in Figure 6.

GandHcan be constructed in polynomial time. The completion vocabulary is

re-stricted to{p}. LetG0be the subgraph ofGrestricted to its literal+r(x1, x2, x3, y1, y2, y3).

G0 is a completion subgraph ofGcontained inGs. Let us show thatDG0(G, H) is a tautology iffΦis. There are exactlyq extensible homomorphismsπ1, . . . ,πq fromG0 toH such that for alliin1, . . . , q,πi mapsG0 to the literal+r(ui)and C(πi)is the formula obtained fromCiby replacing each atompj byp(aj). It fol-lows thatDG0(G, H)is obtained fromΦby replacing each atompjbyp(aj). For instance, in the example of Figure 6, there are 3 extensible homomorphisms from G0 toH, andDG0(G, H) = (¬p(a1)∧ ¬p(a4))∨(p(a4)∧ ¬p(a2)∧ ¬p(a3))∨ (p(a1)∧p(a2)∧p(a3)). HenceDG0(G, H)is a tautology iffΦis.

It remains to show that there are at most 3 exchangeable pairs w.r.t.(G, H). There are 9 pairs ofp-opposite literals inG, namely the pairs{+p(xi),−p(yj)}fori, jin 1, . . . ,3. However, ifxiandyj are mapped to the same nodezinHby two homo-morphisms fromGto completions ofH, then there is an integerkin1, . . . , hsuch thatzis labeled ak, withi = j =α(pk). Thus, each exchangeable pair must be of the form{+p(xi),−p(yi)}, withiin1, . . . ,3. As announced at the beginning of this proof, using an exchange-reducing mapping w.r.t. Φto defineH allows to bound the number of exchangeable pairs to 3 instead of 9.

Theorem 7 The problemENTAILMENT3isP||N P-complete.

+r

Figure 6: Reduction from 3-DNF Tautology to ENTAILMENT3

Th. 5 showsP||N P-membership. We thus proveP||N P-hardness. We will rely on the following lemmas.

Lemma 3 For any problemA inN P, there is a translationf mapping every in-stanceIofAto an instancef(I) = (fG(I), fH(I))ofENTAILMENTsuch that:

• fG(I)is entailed byfH(I)if and only ifIis a positive instance ofA,

• fG(I)andfH(I)do not contain any negative literal,

• fG(I)andfH(I)do not contain any constant node.

Proof: As ENTAILMENT on PGs that do not contain any negative literal is NP-complete, there is a translationf satisfying the two first conditions onf(I). In order to satisfy the third condition, we modify G = fG(I) andH = fH(I) as follows: for each constanta appearing inG or in H, replace the constant node labeledainG(respectivelyH) by a variable node x and add the literal+pa(x) toG(respectivelyH), wherepais a new unary relation name, i.e., that does not

occur inGnor inH.

Lemma 4 There is a PGGand a setQof 3 pairs ofp-opposite literals inGsuch that for any problemB inco-N P, there is a translationgmapping every instance JofB to an instanceg(J) = (gG(J), gH(J))ofENTAILMENT3 such that:

• gG(J)is entailed bygH(J)if and only ifJis a positive instance ofB,

• gG(J) = G, each exchangeable pair w.r.t. (G, gH(J))is inQ, and the set of relation node labels ingH(J)is the same as inG,

• GandgH(J)do not contain any constant node.

Proof: As 3-DNF Tautology is co-NP-complete, it is sufficient to prove the exis-tence of the translationg in the case whereB is 3-DNF Tautology. In that case it is sufficient to define the translationg as in the proof of Th. 6, except that the term nodes of H are defined as variable nodes instead of constant nodes, with Q={(+p(xi),−p(yi)), 1≤i≤3}, the set of relation node labels being equal to

{+p,−p,+r}ingH(J)and inG.

Proof:[of Theorem 7] We build a reduction from the following problem, known to beP||N P-complete [SV00]:

Min-card-vertex cover compare

Input:two undirected graphsF1= (V1, E1)andF2= (V2, E2).

Question:Doesmin-vc(F1) ≤min-vc(F2), wheremin-vc(Fi)denotes the min-imum cardinality of a vertex cover10ofFi?

Let(F1, F2) be an instance of Min-card-vertex cover compare. We have to build two PGsG0andH0such that (1)G0has at most 3 exchangeable pairs w.r.t.(G0, H0) and (2)min-vc(F1)≤min-vc(F2)if and only ifG0is entailed byH0.

Letibe an integer. Since deciding whether the minimum size of a vertex cover of F1 is less than i is in NP, from Lemma 3, there is an instance of ENTAIL

-MENTf(F1, i) = (fG(F1, i), fH(F1, i))such thatmin-vc(F1) ≤ iifffG(F1, i) is entailed byfH(F1, i), andfG(F1, i)andfH(F1, i)do not contain any negative literal or constant node. Similarly, since deciding whether the minimum size of a vertex cover ofF2 is more thani is in co-NP, from Lemma 4, there is a PGG, a set Qof 3 pairs of p-opposite literals inG and an instance of ENTAILMENT3

g(F2, i) = (gG(F2, i), gH(F2, i))such that i ≤ min-vc(F2) iffgG(F2, i)is en-tailed bygH(F2, i), gG(F2, i) = G, each exchangeable pair w.r.t. (G, gH(F2, i)) is in Q, the set of relation node labels ingH(F2, i) is the same as in G, and G andgH(F2, i)do not contain any constant node, withGandQbeing independent ofi. LetGi = fG(F1, i), Hi = fH(F1, i)andHi0 = gH(F2, i). Comparing the sizes of the minimum vertex covers forF1 andF2 can be done by askingq+ 1 questions, whereq =|V2|: is there somei,0≤i≤q, such thatmin-vc(F1)≤i andi≤min-vc(F2), i.e., such thatGiis entailed byHiandGis entailed byHi0? Thus we have to buildG0andH0from the PGsGi,Hi,GandHi0such that (1)G0 has at most 3 exchangeable pairs w.r.t.(G0, H0)and (2)G0is entailed byH0if and only if there is somei,0≤i≤q, such thatGiis entailed byHiandGis entailed byHi0. This construction is illustrated by Figures 7 and 8. Letp0, . . . , pqbeq+ 1 new binary relation names, i.e., that do not appear in anyGi,Hi,GandHi0. G0 is the PG obtained from the disjoint union of theGj and ofGby adding:

• q+ 1variables nodesv0, . . . , vq(vi allows to linkGtoGi),

• q+ 1literals+p0(v0), . . . ,+pq(vq),

• for eachjin[0, q]and each term nodexinG, the literal+out(x, vj),

• for eachjin[0, q]and each term nodexinGi, the literal+in(vj, x).

H0is the disjoint union of theAi,0 ≤i≤q, whereAiis built asG0, except that Gis replaced byHi0,Gi is replaced byHi and variable nodesvj are renamedvji. Note that since noGi,HiandHi0contains any constant node,H0is normal.

10A vertex cover ofFis a setSof vertices such that each edge is adjacent to at least a vertex ofS.

G0

Gq G1

Gj Gi

. . .

. . . G

•v0

• • vj vi v•q

v•1

Figure 7: A sketch ofG0

G0

Gq G1

Gj Hi ..

.

. . . H0i

•vi0

• • vij vii v•qi

v•i1

. . . .

A0 Aq

Ai

Figure 8: A sketch ofH0

In the following, exchangeable pairs ofGi (respectivelyG,G0) and comple-tions ofHi(respectivelyHi0,H0) are implicitly defined w.r.t.(Gi, Hi)(respectively (G, Hi0),(G0, H0)). For any subgraphK and any completionH0cofH0, the part K ofH0cdenotes the subgraph ofH0cobtained fromK by adding the literals of H0c\H0whose terms are inK. We first prove the following lemma.

Lemma 5 For any completionH0c of H0 and any homomorphism π from G0 to H0c, there exist an integeriin[0, q], a completionHicofHi and a completionHi0c ofHi0 such thatHicis a subgraph of the partHi ofH0c,Hi0cis a subgraph of the partHi0ofH0c, andπmapsGitoHicandGtoHi0c.

Proof: LetH0cbe a completion ofH0 and let π be a homomorphism fromG0 to H0c. As G0 is connected, there is an integeriin[0, q]such thatπ mapsG0 to the partAi ofH0c. Because of the relation namepi, the literal+pi(vi)is mapped to +pi(vii), so because of the relation nodes labeled+inand+outadjacent tovi in G0and toviiinH0c,π mapsGto the partHi0ofH0candGi to the partHiofH0c. As the sets of relation names appearing in the different pairs (Gj, Hj) and inG are pairwise disjoint and the set of relation node labels inHj0 is the same as inG for eachj, the completion vocabulary w.r.t. (G0, H0)is the disjoint union of the completion vocabularies w.r.t. the different pairs(Gj, Hj)and of the pair(G, Hi0).

LetHic be the subgraph of the partHi ofH0cobtained by removing all relation nodes whose relation name does not appear in(Gi, Hi).Hicis a completion ofHi, andπ mapsGi to Hic. Similarly, let Hi0cbe the subgraph of the partHi0 ofH0c obtained by removing all relation nodes whose relation name does not appear inG.

Hi0cis a completion ofHi0, andπmapsGtoHi0c. We first check thatG0has at most 3 exchangeable pairs w.r.t.(G0, H0). For this it is sufficient to show that each exchangeable pair ofG0is inQ. Let{+p(u),−p(v)}

be an exchangeable pair ofG0. As noGihas any negative literal and the sets of re-lation names in the pairs(Gi, Hi)and inGare pairwise disjoint,{+p(u),−p(v)}

is inG. Letπ1be a homomorphism fromG0to a completionH0c1ofH0andπ2be a homomorphism fromG0 to a completionH0c2 ofH0 such thatπ1(u) = π2(v).

Letw = π1(u) = π2(v). By Lemma 5, there exist an integeriin[0, q]and two completionsHi0c1 andHi0c2ofHi0such thatwis in the partHi0ofH0c1(andH0c2), Hi0c1 is a subgraph of the partHi0 ofH0c1, Hi0c2 is a subgraph of the partHi0 of H0c21 mapsGtoHi0c1 andπ2 mapsGtoHi0c2. Hence{+p(u),−p(v)}is an exchangeable pair of G0 w.r.t. (G, Hi0), and therefore is in Q by hypothesis on (G, Hi0), which completes the proof thatG0has at most 3 exchangeable pairs w.r.t.

(G0, H0).

It remains to prove that G0 is entailed byH0 if and only if there is some i, 0≤i≤q, such thatGiis entailed byHiandGis entailed byHi0.

⇒: By contradiction: we assume thatG0is entailed byH0but that there is noisuch thatGiis entailed byHiandGis entailed byHi0. Then for eachiin[0, q]there is a completionHicofHisuch thatGicannot be mapped toHicor there is a completion Hi0cofHi0 such thatGcannot be mapped toHi0c. LetH0cbe a completion of H0 such that for eachiin[0, q], ifHicexists thenHicis a subgraph of the part Hi of H0c, otherwiseHi0cis a subgraph of the partHi0 ofH0c. AsG0 is entailed byH0, there is a homomorphismπ fromG0 toH0c. By Lemma 5, there exist an integer iin[0, q], a completionHid ofHi and a completionHi0dofHi0 such thatHid is a subgraph of the partHiofH0c,Hi0dis a subgraph of the partHi0ofH0candπmaps GitoHidandGtoHi0d. If someHicas described above exists thenHicandHidare completions ofHi that are both subsets of the partHi ofH0c, hence Hic = Hid andπmapsGitoHic, a contradiction. OtherwiseHi0cexists, similarlyHi0c=Hi0d andπmapsGtoHi0c, a contradiction.

⇐: We assume that there is someisuch thatGiis entailed byHiandGis entailed byHi0. Let us show thatG0is entailed byH0. LetH0cbe a completion ofH0. Let us show thatG0 can be mapped toH0c. LetHicbe the completion ofHisuch thatHic is a subgraph of the partHiofH0c, and letπ1be a homomorphism fromGitoHic. LetHi0cbe the completion ofHi0such thatHi0cis a subgraph of the partHi0ofH0c, and letπ2 be a homomorphism fromGtoHi0c. Then there is a homomorphismπ fromG0toH0extendingπ1andπ2:πmaps eachvj tovji and eachGj, withj 6=i, to the partGj insideAiofH0c.

We have thus built a polynomial reduction from Min-card-vertex cover

com-pare to ENTAILMENT3, which proves the theorem.