• Keine Ergebnisse gefunden

Foundations of Artificial Intelligence 30. Propositional Logic: Reasoning and Resolution Malte Helmert

N/A
N/A
Protected

Academic year: 2022

Aktie "Foundations of Artificial Intelligence 30. Propositional Logic: Reasoning and Resolution Malte Helmert"

Copied!
19
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Foundations of Artificial Intelligence

30. Propositional Logic: Reasoning and Resolution

Malte Helmert

University of Basel

April 26, 2021

(2)

Reasoning Resolution Summary

Propositional Logic: Overview

Chapter overview: propositional logic 29. Basics

30. Reasoning and Resolution 31. DPLL Algorithm

32. Local Search and Outlook

(3)

Reasoning Resolution Summary

Reasoning

(4)

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?

(5)

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ϕ.”

(6)

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?

(7)

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

(8)

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

(9)

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?

(10)

Reasoning Resolution Summary

Resolution

(11)

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).

(12)

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

(13)

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}?

(14)

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

(15)

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.

(16)

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

(17)

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.

(18)

Reasoning Resolution Summary

Summary

(19)

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

Referenzen

ÄHNLICHE DOKUMENTE

heuristics estimate distance of a state to the goal can be used to focus search on promising states soon: search algorithms that

Dealing with Local Optima Outlook: Simulated Annealing Outlook: Genetic Algorithms Summary.. Combinatorial

Propositional formulas combine atomic formulas with ¬, ∧, ∨, → to more complex statements. Interpretations determine which atomic formulas are true and which ones

if splitting rule applied, then current formula satisfiable, and if a wrong decision is taken, then this will be recognized without applying further splitting rules (i.e., only

in every clause, choose the variables randomly literals positive or negative with equal probability critical parameter: #clauses divided by #variables phase transition at ratio ≈

basic idea of abstraction heuristics: estimate solution cost by considering a smaller planning task. formally: abstraction function α maps states to abstract states and thus

Hence the objective of our landmark heuristics is to approximate the optimal delete relaxed heuristic h + as accurately as possible.. More advanced landmark techniques work directly

initialize first RL policy network to SL policy network in each iteration, pick a former RL policy network uniformly randomly prevents overfitting to the current policy play with