CH 10 Propositionl Logic

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 13

Artificial Intelligence

Propositional (Boolean) Logic

The University of Faisalabad 1


What is Boolean Satisfiability(SAT)?
• Example:
– You are instructed to organize the embassy hall
• the ambassador wants to invite Peru, but exclude Qatar
• the vice-ambassador wants Qatar, Romania, or both
• recent diplomatic events make it impossible to invite both
• Romania and Peru

• What do you invite?

• An assignment of truth values to predicates which evaluates to


true is a model of the formula
• A model of φ, is {P = T, Q = T, R= F}
The University of Faisalabad 2
What is Boolean Satisfiability?
• Instance: a set U of variables and a collection of C of clauses
over the variables U
– variables: all boolean, i.e., domains are all [T, F]
– clauses: are disjunction or conjunction of literals
– literals: a variable or its negation
– conjunctive normal form (CNF): formula is conjunction of clauses,
clauses are disjunctions of literals, e.g.,

– disjunctive normal form (DNF): formula is disjunction of clauses,


clauses are conjunction of literals, e.g.,

– Question: is there a model for C?


• model: truth assignment to variables that satisfies all clauses (if
CNF) or at least one clause (if DNF)

The University of Faisalabad 3


Boolean Satisfiability (SAT)
• Recall a few important operations with booleans

The University of Faisalabad 4


Clausal Normal Form (CNF)
• DNF and CNF, as normal forms, are useful for automated
problem solving
• In both CNF and DNF, negation (~) can only be used as part
of a literal (i.e., it can only precede a propositional variable)
• Every propositional formula can be converted to an
equivalent formula in CNF or DNF
• k-CNF: each clause has k lilterals

The University of Faisalabad 5


Why Reduce to SAT(SATISFIABILITY)?
• There are many interesting problems that can be reduced to
SAT instances
– Planning, scheduling, circuit design, model verification . . .
– Model leads to solution of original problem

• Efficient algorithms can often decide large, interesting


problems
• SAT is simple
• SAT solvers employ very sophisticated search techniques
• SAT solvers are the workhorses of AI

The University of Faisalabad 6


Reduction of SAT: Example
• Correspondence between digital logic circuit and propositional
logic

The University of Faisalabad 7


Reduction of SAT: Example
• Correspondence between digital logic circuit and propositional
logic

• Are the two circuits equivalent?


• Is SAT?

The University of Faisalabad 8


Transforming to CNF
• Unfortunately applying distribution can cause the size of the
formula to grow exponentially
– Original formula:

– Transformation gives:

• However, we are not usually interested in equivalent CNF


formulations
• We only care about satisfiability and possibly a simple way
to extract the model of the original formula

The University of Faisalabad 9


DPLL Procedure
• Davis-Putnam-Logeman-Loveland Procedure
• DPLL benefits from propagation
– propagation in SAT: transform the set of clauses while preserving
satisfiability
• Propagation in DPLL is based on two transformations on the
set of clauses:
– unit propagation (UP): if a unit clause p appears, remove ~ from
other clauses and remove all clauses including p
– pure-literal elimination: if p occurs only negated, or only unnegated,
delete all clauses involving p

The University of Faisalabad 10


DPLL Procedure
• Unit propagation and pure-literal elimination is a Boolean
Constraint Propagation (BCP) procedure.

• DPLL: recursive depth-first enumeration of possible models

The University of Faisalabad 11


Conflict-Driven Backjumping and clause learning

• BCP detects conflicts when a clause becomes empty


• Chronological backtracking: go back to most recent
branching and flip value of variable
• Notice that we can make a more informed choice on where to
• backtrack
– most recent decision is not necessarily what has caused the conflict
– can deduce the culprit when BCP finds a conflict
• Clause learning: learn clauses that will avoid repeating
mistakes
• Conflict-driven backjumping: backtrack to the culprit

The University of Faisalabad 12


Conflict-Driven Backjumping and clause learning

• Conflict-driven backjumping can significantly reduce the


search space
• Notice that clauses learned through conflict (conflict clauses)
never cease to be useful
• Also, conflict clauses are useful in generating new conflict
clauses
– BCP picks up more conflicts, therefore learns more
• All modern systematic SAT solvers employ these strategies
– real-world applications
– thousands, even millions of variables
– research direction changes towards more efficient implementations

The University of Faisalabad 13

You might also like