• No results found

Backjumping and Extended Graph

In document SAT-based Answer Set Programming (Page 111-115)

Chapter 9 Background: Loop Formulas

10.3 Backjumping and Extended Graph

Recall the transition rule Backjump GT of gtlF,G

Backjump GT :

P lΔ Q||Γ =⇒ P l||Γ if

P lΔ Q is inconsistent and F ∧ G |= l∨ P

A state in the graph gtlF,G is a backjump state if it is inconsistent, contains a decision literal, and is reachable from ∅||∅. Note that it may not be clear a priori whether Backjump GT is applicable to a backjump state and if so to which state the edge due to the application of Backjump GT leads. These questions are important if we want to base an algorithm on this framework. Theorem 14 (Section 10.2) asserts that Backjump GT is always applicable to a backjump state, so that a backjump state in gtlF,Gis never semi-terminal. In the end of this section we show how Theorem 14 can be derived from the results proved later in this dissertation. The next question to answer is how to continue choosing a path in the graph after reaching a backjump state. To answer this question we introduce the notions of a reason and an extended graph.

For a formula H, we say that a clause l ∨ C is a reason for l to be in a list P l Q of literals with respect to H if H |= l ∨ C and C ⊆ P . We can equivalently restate the second condition of Backjump GT “F ∧ G |= l∨ P ” as “there exists a reason for l to be in P l with respect to F ∧ G” (note that l∨ P is a reason for l to be in P l). We call a reason for l to be in P l a backjump clause. Note that Theorem 14 asserts that a backjump clause always exists for a backjump state. It is clear that we may continue choosing a path in the graph after reaching a backjump state if we know how to compute a backjump clause for this state. We now define a graph gtl↑F,G that shares many properties of gtlF,Gbut allows us to give a simpler procedure for computing a backjump clause.

An (extended) record M relative to a formula H is a list of literals over the set of atoms occurring in H where

(i) each literal l in M is annotated either by Δ or by a reason for l to be in M with respect to H,

(ii) M contains no repetitions,

(iii) for any inconsistent prefix of M , its last literal is annotated by a reason. For instance, let H be a formula

The following lists of literals

bΔ aΔ ¬ b¬b∨¬a, bΔ¬ a¬b∨¬a

are extended records relative to H. On the other hand, the lists of literals aΔ¬aΔ, aΔ ¬ b¬b∨¬a bΔ, bΔaΔ ¬ b¬b∨¬a cΔ are not extended records.

An (extended) state relative to a CNF formula F , and a formula G formed from atoms occurring in F is either the distinguished state FailState or a pair of the form M ||Γ, where M is an extended record relative to F ∧ G, and Γ is the same as in the definition of an augmented state (i.e., Γ is a (multi)set of clauses formed from atoms occurring in F that are entailed by F ∧ G.) It is easy to see that for any extended state S relative to F and G, the result of removing annotations from all nondecision literals of S is a state of gtlF,G: we will denote this state by S↓.

For instance, let formula F be a ∨ b and G be . All pairs FailState ∅||∅ ¬aΔ bb∨a||∅ ¬bΔaa∨b||∅

are among valid extended states relative to these formulas. The corresponding

states S↓ are

FailState ∅||∅ ¬aΔb||∅ ¬bΔ a||∅.

We now define a graph gtl↑F,G for any CNF formula F and any formula G

formed from atoms occurring in F . The set of the nodes of gtl↑F,G consists of the extended states relative to F and G. The transition rules of gtlF,Gare extended to

gtl↑

F,G as follows: S1 =⇒ S2 is an edge in gtl↑F,G justified by a transition rule T

if and only if S1↓ =⇒ S2↓ is an edge in gtlF,G justified by T .

The definitions of Basic transition rules and semi-terminal states in gtl↑F,G are similar to their definitions for gtlF,G .

Theorem 13. For any CNF formula F and a formula G formed from atoms occurring in F ,

(a) every path in gtl↑F,G contains only finitely many edges labeled by Basic tran- sition rules,

(b) for any semi-terminal state M ||Γ of gtl↑F,G, M is a model of F ∧ G,

(c) gtl↑F,G contains an edge leading to FailState if and only if F ∧ G is unsatisfi- able.

Note that Theorem 13↑ (b), unlike Theorem 13 (b), does not require a semi-terminal state to be reachable from ∅||∅. As in the case of the graph gtlF,G, gtl↑F,G can be used for deciding whether a formula F ∧ G has a model. Furthermore, the new graph provides the means for computing a backjump clause that permits practical application of the transition rule Backjump GT : Sections 10.4.3 and 10.5 describe the BackjumpClause (Algorithm 3) and BackjumpClauseFirstUIP (Algorithm 4) procedures that compute Decision and FirstUIP backjump clauses respectively.

We say that a state in the graph gtl↑F,G is a backjump state if its record is inconsistent and contains a decision literal. Unlike the definition of a backjump state in gtlF,G, this definition does not require a backjump state to be reachable from∅||∅ in gtl↑F,G. As in case of the graph gtlF,G, any backjump state in gtl↑F,G is not semi-terminal:

Theorem 14. For any CNF formula F and a formula G formed from atoms occurring in F , the transition rule Backjump GT is applicable to any backjump state in gtl↑F,G.

The lemma below formally states the relationship between nodes of the graphs gtlF,Gand gtl↑

F,G:

Lemma 8. For any CNF formula F and a formula G formed from atoms occurring in F , if S is a state reachable from ∅||∅ in the graph gtlF,G then there is a state S in the graph gtl↑F,G such that S= S.

Theorems 13 (b), (c), and 14 easily follow from Lemma 8, Theorems 13↑(b), (c), and 14↑ respectively. The proof of Theorem 13 (a) is similar to the proof of Theo- rem 13↑ (a).

Section 10.4 will present the proofs for Theorem 13↑, Lemma 8, and The-

orem 14↑. It is interesting to note that the proofs of Lemma 8 and Theorem 14↑

implicitly provide the means for following a path in the graph gtl↑F,G:

• given a state M||Γ and a transition rule Unit Propagate λ, Test applicable to M ||Γ, the proof of Lemma 8 describes a clause that may be used to construct

a record M so that there is an edge M ||Γ =⇒ M||Γ due to this transition rule,

• given a backjump state M||Γ, the proof of Theorem 14↑ describes a backjump

clause that can be used to construct a record M so that there is an edge

M ||Γ =⇒ M||Γ due to Backjump GT.

Furthermore, the construction of the proof of Theorem 14↑ paves the way for the

procedure BackjumpClause presented in Algorithm 3.

In document SAT-based Answer Set Programming (Page 111-115)