• No results found

Definition.About sets Π1, Π2 of propositional rules we say that they arestrongly equiva-

lentto each other if, for every propositional program Π, the program Π∪Π1 has the same stable models as Π∪Π2.

From this definition we see that replacing any group of rules within a propositional program by a strongly equivalent group of rules does not affect the set of stable models of the program. For example, in Section 5.4 we claimed that the set of stable models of a propositional program does not change if we break a rule with a conjunction in the head into several rules. That claim can be expressed by saying that a rule of the form

F1∧ · · · ∧Fn←G (5.46)

is strongly equivalent to the set ofn rules

F1 ←G, . . . , Gn←G. (5.47)

The observation, in the same section, that the law of double negationp← ¬¬p has a stable model that is not a stable model ofp←pshows that these two propositional rules are not strongly equivalent.

In the last example we do not even need to combine Π1and Π2 with any additional rules to see that they are not strongly equivalent. In other words, the empty set Π can serve in this case as a counterexample. Similarly, we can see that the three equivalent rules

p← ¬q, q← ¬p, p∨q (5.48)

are not strongly equivalent to each other by observing that these rules have different stable models if we think of each of them as a one-rule program. (The only stable model of the

5.8. STRONG EQUIVALENCE 99

first rule is{p}; the only stable model of the second is{q}; the third has two stable models.) On the other hand, the one-rule programs q ← p and s← r are not strongly equivalent, even though they have the same stable model ∅. To see why, combine each of them with the atomic formulap. The stable model of the former will turn into{p, q}; the stable model of the latter into {p}.

The last of rules (5.48) has the same stable models as the combination of the first two rules, but it is not strongly equivalent to that combination. Indeed, adding the rules

p←q, q←p

to the rulep∨qgives a program with the stable model{p, q}, but adding the same rules to

p← ¬q,q← ¬p gives a program without stable models (Exercise 5.8 on page 85). Exercise 5.24. Prove that ¬¬pis not strongly equivalent to p.

Exercise 5.25. Prove that ¬q← ¬p is not strongly equivalent top←q.

The use of the term “strongly equivalent” is justified by the fact that any two sets of propositional rules that are strongly equivalent to each other are also equivalent—that is, have the same models. To prove this assertion, assume that Π1 is strongly equivalent to Π2, and take Π to be the set of the excluded middle formulas p∨ ¬p for all atomic formulasp. Then Π∪Π1and Π∪Π2have the same stable models. But by Theorem on Excluded Middle, the set of stable models of Π∪Π1 is the set of all models of Π1, and the set of stable models of Π∪Π2 is the set of all models of Π2. It follows that Π1 and Π2 have the same models.

We can assert that propositional programs Π1 and Π2 are strongly equivalent to each other whenever we can show that the reduct of Π1relative to any interpretation is equivalent to the reduct of Π2 relative to the same interpretation. Indeed, let Π0, Π01, and Π02 be the reducts of programs Π, Π1, and Π2, respectively, relative to the same interpretation I. Whether I is a stable model of Π∪Πi (i= 1,2) is completely determined by the set of all models of Π0∪Π0i. If Π01 and Π02 have the same models then Π0∪Π01 and Π0∪Π02 have the same models as well.

For example, this reasoning can be used to prove that (5.46) is strongly equivalent to (5.47). Indeed, if the reduct of (5.46) relative to some interpretation I is

F10 ∧ · · · ∧Fn0 ←G0 (5.49)

then the reduct of (5.47) relative to I is

F10 ←G0, . . . , Fn0 ←G0. (5.50)

It is clear that (5.49) is equivalent to (5.50).

In a similar way, we can check that any rule of the formF ←G∧>is strongly equivalent to F ← G. Indeed, the reducts of these rules relative to the same interpretation are the equivalent formulas F0 ←G0∧ >and F0 ←G0.

Exercise 5.26. Prove that if two sets of positive propositional rules are equivalent to each other then they are strongly equivalent.

Let us check now that¬¬¬Fis strongly equivalent to¬F. Consider any interpretationI. The reduct of each of the two formulas relative to an interpretation I is⊥ ifI satisfies F, and> otherwise. In either case, both formulas have the same reduct.

A similar calculation shows that G← ¬¬¬F is strongly equivalent to G ← ¬F. More generally, removing two of three successive negations anywhere within a propositional rule is a strongly equivalent transformation. This is why allowing more than two negations in a row within aclingorule would be pointless.

In Section 2.7 we claimed that replacing the clingoconstraint

:- f(X,Y1), f(X,Y2), Y1! = Y2.

by the rule

Y1 = Y2 :- f(X,Y1), f(X,Y2).

does not affect the stable models of a program. More generally, replacing a constraint of the form

:- . . . , t1 != t2 . (5.51)

by

t1 = t2 :- . . . . (5.52)

within any clingo program does not affect its stable models. To see why, note that the propositional image of a ground rule of form (5.51) has the form

⊥ ←F∧ ⊥

if the set of values oft1 is the same as the set of values oft2, and

⊥ ←F∧ >

otherwise. The propositional image of (5.52) is

> ←F

or

⊥ ←F

depending on the same condition. In either case, the propositional images are strongly equivalent to each other.

Exercise 5.27. Replacing a rule of the form

. . . :- t1 != t2 . (5.53)

by

5.8. STRONG EQUIVALENCE 101

within any clingo program does not affect its stable models. True or false?

In Section 5.4 we observed that the rulep← ¬¬p has the same stable models asp∨ ¬p. In fact, these two rules are strongly equivalent to each other. More generally, any rule of the form F ← ¬¬F is strongly equivalent to F ∨ ¬F. Indeed, if the reduct of the former relative to some interpretation is F0 ← >then the reduct of the latter relative to the same interpretation is F0∨ ⊥; if the reduct of the former is F0← ⊥then the reduct of the latter is F0∨ >. Either way, the two reducts are equivalent to each other.

Exercise 5.28. Any rule of the form

F ← ¬¬F∧G (5.55)

is strongly equivalent to

F∨ ¬F ←G. (5.56)

True or false?

In Section 5.4 we claimed that all simplification steps listed in Table 4.1 preserve the stable models of a program. For one of these steps, the validity of this claim is more difficult to establish than for the others: it is not immediately clear that any constraint ⊥ ← F is strongly equivalent to¬F. This assertion is, however, a special case of the general theorem stated below.

A propositional rule isnegativeif every occurrence of every atomic formula in its head is in the scope of negation. For example, all constraints are negative—the head of a constraint does not contain atomic formulas. If the head of a rule has the form¬F or¬F∨ ¬Gthen the rule is negative.

Theorem on Negative Rules. If two sets of negative propositional rules are equivalent to each other then they are strongly equivalent.

The fact that ⊥ ←F is strongly equivalent to ¬F immediately follows, because these formulas are equivalent. Theorem on Negative Rules shows also that every negative rule is strongly equivalent to a constraint, because F ←G is equivalent to⊥ ← ¬F∧G.

A propositional rule is strongly tautological if the set of stable models of a program never changes when this rule is removed. In other words, a rule is strongly tautological rule if it is strongly equivalent to the empty program.

We can assert that a propositional rule is strongly tautological if we can show that all its reducts are tautologies. For instance, any rule of the formF ←G∧⊥is strongly tautological, because its reducts have the form F0 ←G0∧ ⊥ and consequently are tautological.

If a rule is a positive tautology or a negative tautology then it is strongly tautological. This fact follows from the assertion of Exercise 5.26 and from Theorem on Negative Rules. Exercise 5.29. For each of the given expressions, determine whether every propositional rule of this form is strongly tautological.

(a) F ∨ ¬F, (b) ¬F ∨ ¬¬F,

(c) ⊥ ←F∧ ¬F, (d) F ←F∧G,

(e) F ∨G←F.