Foundations of Artificial Intelligence
30. Propositional Logic: Reasoning and Resolution
Malte Helmert
University of Basel
April 26, 2021
Reasoning Resolution Summary
Propositional Logic: Overview
Chapter overview: propositional logic 29. Basics
30. Reasoning and Resolution 31. DPLL Algorithm
32. Local Search and Outlook
Reasoning Resolution Summary
Reasoning
Reasoning Resolution Summary
Reasoning: Intuition
Reasoning: Intuition
Generally, formulas only represent an incomplete description of the world.
In many cases, we want to know
if a formula logically follows from (a set of) other formulas.
What does this mean?
Reasoning Resolution Summary
Reasoning: Intuition
example: ϕ= (P ∨Q)∧(R∨ ¬P)∧S S holds in every model of ϕ.
What about P,Q andR?
consider all models of ϕ:
P Q R S F T F T F T T T T F T T T T T T
Observation
In all models ofϕ, the formulaQ∨R holds as well.
We say: “Q∨R logically follows fromϕ.”
Reasoning Resolution Summary
Reasoning: Formally
Definition (logical consequence)
Let Φ be a set of formulas. A formulaψlogically follows from Φ (in symbols: Φ|=ψ) if all models of Φ are also models of ψ.
German: logische Konsequenz, folgt logisch In other words: for each interpretationI, ifI |=ϕfor all ϕ∈Φ, then alsoI |=ψ.
Question
How can we automatically compute if Φ|=ψ?
One possibility: Build a truth table. (How?)
Are there “better” possibilities that (potentially) avoid generating the whole truth table?
Reasoning Resolution Summary
Reasoning: Deduction Theorem
Proposition (deduction theorem)
LetΦbe a finite set of formulas and let ψbe a formula. Then
Φ|=ψ iff (^
ϕ∈Φ
ϕ)→ψ is a tautology.
German: Deduktionssatz Proof.
iff
Φ|=ψ
iff for each interpretationI: ifI |=ϕ for all ϕ∈Φ, then I |=ψ iff for each interpretationI: ifI |=V
ϕ∈Φϕ, then I |=ψ iff for each interpretationI: I 6|=V
ϕ∈Φϕor I |=ψ iff for each interpretationI: I |= (V
ϕ∈Φϕ)→ψ iff (V
ϕ∈Φϕ)→ψ is tautology
Reasoning Resolution Summary
Reasoning: Deduction Theorem
Proposition (deduction theorem)
LetΦbe a finite set of formulas and let ψbe a formula. Then
Φ|=ψ iff (^
ϕ∈Φ
ϕ)→ψ is a tautology.
German: Deduktionssatz Proof.
iff
Φ|=ψ
ifffor each interpretation I: ifI |=ϕ for all ϕ∈Φ, then I |=ψ ifffor each interpretation I: ifI |=V
ϕ∈Φϕ, then I |=ψ ifffor each interpretation I: I 6|=V
ϕ∈Φϕor I |=ψ ifffor each interpretation I: I |= (V
ϕ∈Φϕ)→ψ iff(V
ϕ∈Φϕ)→ψ is tautology
Reasoning Resolution Summary
Reasoning
Consequence of Deduction Theorem
Reasoning can be reduced to testing validity.
Algorithm
Question: Does Φ|=ψhold?
1 test if (V
ϕ∈Φϕ)→ψ is tautology
2 if yes, then Φ|=ψ, otherwise Φ6|=ψ
In the following: Can we test for validity “efficiently”, i.e., without computing the whole truth table?
Reasoning Resolution Summary
Resolution
Reasoning Resolution Summary
Sets of Clauses
for the rest of this chapter:
prerequisite: formulas in conjunctive normal form clause represented as aset C of literals
formula represented as a set ∆ of clauses
Example
Letϕ= (P∨Q)∧ ¬P.
ϕin conjunctive normal form
ϕconsists of clauses (P ∨Q) and¬P
representation ofϕas set of sets of literals: {{P,Q},{¬P}}
Distinguish(empty clause) vs.∅ (empty set of clauses).
Reasoning Resolution Summary
Resolution: Idea
Observation
Testing for validity can be reduced to testing unsatisfiability.
formulaϕvalid iff¬ϕ unsatisfiable
Resolution: Idea
method to test formula ϕfor unsatisfiability
idea: derive new formulas fromϕthat logically follow fromϕ if empty clausecan be derived ϕunsatisfiable
German: Resolution
Reasoning Resolution Summary
The Resolution Rule
C1∪ {`},C2∪ {`}¯ C1∪C2
“From C1∪ {`} andC2∪ {`}, we can conclude¯ C1∪C2.”
C1∪C2 is resolventof parent clausesC1∪ {`} andC2∪ {`}.¯ The literals `and ¯`are called resolution literals,
the corresponding proposition is called resolution variable.
resolvent follows logically from parent clauses (Why?) German: Resolutionsregel, Resolvent, Elternklauseln, Resolutionsliterale, Resolutionsvariable
Example
resolvent of {A,B,¬C} and{A,D,C}?
resolvents of {¬A,B,¬C} and{A,D,C}?
Reasoning Resolution Summary
Resolution: Derivations
Definition (derivation)
Notation: R(∆)= ∆∪ {C |C is resolvent of two clauses in ∆}
A clauseD can be derivedfrom ∆ (in symbols∆`D) if there is a sequence of clausesC1, . . . ,Cn=D such that for all i ∈ {1, . . . ,n}
we haveCi ∈R(∆∪ {C1, . . . ,Ci−1}).
German: Ableitung, abgeleitet Lemma (soundness of resolution) If∆`D, then ∆|=D.
Does the converse direction hold as well (completeness)?
German: Korrektheit, Vollst¨andigkeit
Reasoning Resolution Summary
Resolution: Completeness?
The converse of the lemma does not hold in general.
example:
{{A,B},{¬B,C}} |={A,B,C}, but {{A,B},{¬B,C}} 6` {A,B,C}
but: converse holds for special case of empty clause (no proof) Theorem (refutation-completeness of resolution)
∆is unsatisfiable iff∆`
German: Widerlegungsvollst¨andigkeit consequences:
Resolution is a complete proof method for testing unsatisfiability.
Resolution can be used for general reasoning by reducing to a test for unsatisfiability.
Reasoning Resolution Summary
Example
Let Φ ={P∨Q,¬P}. Does Φ|=Q hold?
Solution
test if ((P ∨Q)∧ ¬P)→Q is tautology
equivalently: test if ((P ∨Q)∧ ¬P)∧ ¬Q is unsatisfiable resulting set of clauses: Φ0: {{P,Q},{¬P},{¬Q}}
resolving {P,Q}with {¬P} yields{Q}
resolving {Q} with {¬Q} yields observation: empty clause can be derived, hence Φ0 unsatisfiable
consequently Φ|=Q
Reasoning Resolution Summary
Resolution: Discussion
Resolution is a complete proof method to test formulas for unsatisfiability.
In the worst case, resolution proofs can take exponential time.
In practice, a strategywhich determines the next resolution step is needed.
In the following chapter, we discuss theDPLL algorithm, which is a combination of backtracking and resolution.
Reasoning Resolution Summary
Summary
Reasoning Resolution Summary
Summary
Reasoning: the formulaψ follows from the set of formulas Φ if all models of Φ are also models of ψ.
Reasoning can be reduced to testing validity (with the deduction theorem).
Testing validity can be reduced to testing unsatisfiability.
Resolution is arefutation-completeproof method applicable to formulas in conjunctive normal form.
can be used to test if a set of clauses is unsatisfiable