Logic for Computer Scientists/Propositional Logic/Resolution: Difference between revisions

From testwiki
Jump to navigation Jump to search
imported>ShakespeareFan00
mNo edit summary
 
(No difference)

Latest revision as of 18:05, 22 November 2023

Resolution

In this subsection we will develop a calculus for propositional logic. Until now we have a language, i.e. a set of formulae and we have investigated into semantics and some properties of formulae or sets of clauses. Now we will introduce an inference rule, namely the resolution rule, which allows to derive new clauses from given ones.

Definition 10

A clause R is a resolvent of clauses C1 and C2, if there is a literal LC1 and LC2 and

R=(C1{L})(C2{L})

where L={¬A if L=AA if L=¬A

Note that there is a special case, if we construct the resolvent out of two literals, i.e. L and L can be resolved upon and yield the empty set. This empty resolvent is depicted by the special symbol .
denotes an unsatisfiable formula. We define a clause set, which contains this empty clause to be unsatisfiable,

In the following we investigate in properties of the resolution rule and the entire calculus. The following Lemma is stating the correctness of one single application of the resolution rule.

Theorem 7

If S is a set of clauses and R a resolvent of C1,C2S, then SS{R}

Proof: Let 𝒜 be an assignment for S; hence it is an assignment for SS{R} as well. Assume 𝒜S: hence for all clauses C from S, we have that 𝒜C. The resolvent R of C1 and C2 looks like:

R=(C1{L})(C2{L})

where LC1 and LC2. Now there are two cases:

  • 𝒜L: From 𝒜C2 and 𝒜⊭L, we conclude 𝒜(C2{L}) and hence 𝒜R.
  • 𝒜⊭L: From 𝒜C1 we conclude 𝒜(C1{L}) and hence 𝒜R. The opposite direction of the lemma is obvious.

Definition 11

Let S be s set of clauses and

Res(S)=S{RR is a resolvent of two clauses in S}

then

Res0(S)=S
Resn+1(S)=Res(Resn(S)),n0
Res*(S)=n0Resn(S)

If we understand the process of iterating the Res-operator as a procedure for deriving new clauses from a given set, and in particular to derive possibly the empty clause, we have to ask, under which circumstances we get the empty clause, and vice versa, what does it mean if we get it. These properties are investigates in the following two Theorems.

Theorem 8 (Correctness)

Let S be a set of clauses. If Res*(S) then S is unsatisfiable.

Proof: From Res*(S) we conclude, that is obtained by resolution from two clauses C1={L} and C2={L}. Hence there is a n0 such that Resn(S) and C1,C2Resn(S) and therefore Resn(S) is unsatisfiable. From Theorem (resolution-lemma) we conclude that Resn(S)S and hence S is unsatisfiable.

Theorem 9 (Completeness)

Let S be a finite set of clauses. If S is unsatisfiable then Res*(S).

Proof: Induction over the number n of atomic formulae in S. With n=0 we have S={}and hence SRes*(S).

Assume n fixed and for every unsatisfiable set of clauses S with n atomic formulae A1,,An it holds that Res*(S).

Assume a set of clauses S with atomic formulae A1,,An,An+1. In the following we construct two clause sets Sf and St:

  • Sf is received from S by deleting every occurrence of An+1 in a clause and by deleting every clause which contains an occurrence of ¬An+1. This transformation obviously corresponds to interpreting the atom An+1 with false,
  • St results from a similar transformation, where occurrences of ¬An+1 and clauses containing An+1 are deleted, hence An+1 is interpreted with true.

Let us show, that both Sf and St are unsatisfiable: Assume an assignment 𝒜 for the atomic formale {A1,,An} which is a model for Sf. Hence the assignment 𝒜(B)={𝒜(B) if B{A1,,An}false if B=An+1 is a model for S, which leads to a contradiction. A similar construction shows that St is unsatisfiable. Hence then we can use the induction assumption to conclude that Res*(St) and Res*(Sf). Hence there is a sequence of clauses

C1,,Cm=

such that 1im it holds CiSf or Ci is a resolvent of two clauses Ca and Cb with a,b<i.There is an analog sequence for St:

C1,,Ct=

Now we are going to reintroduce the previously deleted literals An+1 and ¬An+1 in the two sequences:

  • Clause Ci which has been the result of deleting An+1 from the original clause in S are again modified to Ci{An+1}. This results in a sequence
    C1,,Cm

where Cm is either or An+1.

  • Analogous we introduce ¬An+1 in the second sequence, such that Ct is either or ¬An+1

In any of the above cases we get Res*(S) latest after one resolution step with Cm and Ct.


Based on the theorems for correctness and completeness, we give a procedure for deciding the satisfiability of propositional formulae.

Template:Box

Theorem 10

If S is a finite set of clauses, then there exists a k0 such that

Resk(S)=Resk+1(S)


Until now, we have been dealing with sets of clauses. In the following it will turn out, that it is helpful to talk about sequences of applications of the resolution rule.

Definition 12

A deduction of a clause C from a set of clauses S is a sequence C1,,Cn, such that

  • Cn=C and
  • 1in:(CiS or l,r<i:Ci is a resolvent of Cl=and=Cr)


A deduction of the empty clause from S is called a refutation of S.


Example We want to show, that the formula K=((B¬A)C) is a logical consequence of F=((A(BC))(C¬A)). For this negate K and prove the unsatisfiability of F¬K

For this you can use the interaction in this book in various forms:

  • Use the interaction Truth Tables for proving the unsatisfiability, or
  • use the interaction CNF Transformation for transforming the formula into CNF, and then
  • use the following interaction Resolution.


Problems

Problem 23 (Propositional)

Compute Resn(M) for all n0 and Res*(M) for the following set of clauses:

  1. M={{A},{B},{¬A,C},{B,¬C,¬D},{¬C,D},{¬D}
  2. M={{A,¬B},{A,B},{¬A}}
  3. M={{A,B,C},{¬B,¬C},{¬A,C}}
  4. M={{¬A,¬B},{B,C},{¬C,A}}

Which formula is satisfiable or which is unsatisfiable?

Problem 24 (Propositional)

Indicate all resolvent of the clauses in S, where S={{A,¬B,C},{A,B,E},{¬A,C,¬D},{A,¬E}}

Problem 25 (Propositional)

Prove: A resolvent R of two clauses C1 and C2 is a logical consequence from C1 and C2. Note: Use the definition of "consequence".

Problem 26 (Propositional)

Let M be a set of formulae and F a formula. Prove:

MF iff M{¬F} is unsatisfiable.


Problem 27 (Propositional)

Compute Resn(S) with n=0,1,2 and

S={{A,¬B,C},{B,C},A{¬,C},{B,¬C},{¬C}}

Problem 28 (Propositional)

Show that the following set S of formulae is unsatisfiable, by giving a refutation.
S=(BCD)(¬C)(¬BC)(B¬D)

Problem 29 (Propositional)

Show by using the resolution rule, that ¬A¬BC is an inference from the set of clauses F={{A,C},{¬B,¬C},{¬A}}.

Problem 30 (Propositional)

Show by using the resolution rule, that ((PQ is )P)Q is a tautology.

Template:BookCat