Formale Methoden der Informatik
Introduction and a
Short Review of Propositional Logic
Uwe Egly
Vienna University of Technology
Institute of Information Systems
Knowledge-Based Systems Group
Outline
Introduction
Motivation
The Circuit Example
Formalizing a Logical System
Inductive Definitions Recap
Syntax of PL0
Tree Notation of Propositional Formulas
Semantics of PL0
Notations
Useful Equivalences
Entailment
Checking Entailment
Satisfiability Checking
Translation to Normal Forms
DLL
Why Logic in CS Studies?
◮
Programming
PROLOG, boolean expressions in if-then, assertions, . . .
◮
Languages for and reasoning about specifications,
dynamic behavior (temporal logics), consistency, . . .
◮
Knowledge representation
Web ontologies, description logics, reasoning under
incomplete/uncertain information, . . .
◮
Hardware
circuit specification, (automated) verification of circuits, . . .
◮
and much more!!!
Types of Logics Interesting for CS
There is not the logic for CS, but many of them
◮
Besides classical logic, there are non-classical logics
◮
◮
◮
◮
minimal and intuitionistic logic (“constructive” logics)
modal logics, temporal logics, . . .
many-valued logics, fuzzy logics
Many of these logics come in different “levels”
◮
◮
◮
◮
Propositional logics (PL0)
First-order (PL1): (quantifiers over object variables)
Second-order (quantifiers over function/predicate symbols)
and even higher-order logics
Example: Correct Implementation of a Circuit
Does the implemented circuit compute specified function
Spec : ((p ∧ q) ∨ r ) ∧ (¬(p ∧ q) ∨ s)
p
q
&
≥1
&
A1
r
O1
A2
1
≥1
N1
s
O2
Example: Correct Implementation of a Circuit
Does the implemented circuit compute specified function
Spec : ((p ∧ q) ∨ r ) ∧ (¬(p ∧ q) ∨ s)
p
q
&
A1
A1 ↔ p ∧ q
r
≥1
O1 ↔ A1 ∨ r
&
O1
A2
1
N1 ↔ ¬A1
≥1
N1
s
O2
O2 ↔ N1 ∨ s
A2 ↔ O1 ∧ O2
How to Model and Solve the Problem?
◮
Modeling: Abstract a given problem P into logic PL0 (
◮
The implemented function Impl is:
P ′)
Impl = (A1 ↔ p ∧ q) ∧ (O1 ↔ A1 ∨ r ) ∧ (N1 ↔ ¬A1) ∧
(O2 ↔ N1 ∨ s) ∧ (A2 ↔ O1 ∧ O2) → A2
◮
Is the implementation correct (does Impl comply w. Spec)?
◮
P ′ is now a reasoning problem, not a test problem!
Proof: Use automatic decision procedures to determine
the solution of P, i.e., compute satisfiability/validity of P ′
◮
◮
◮
◮
SAT Solvers and BDDs
Model Checker
Theorem Provers
Formalizing a Logical System
. . . or the ingredients for an (automated) inference system
◮
Old dream of mankind
(at least of some “logicians” like G. W. Leibniz (1646–1716))
◮
What is needed?
◮
◮
◮
◮
◮
◮
Syntax (= a formal language for constructing formulas)
Semantics (= meaning of formulas)
Inference rules (syntacticly derive “correct” statements)
Correctness (no false conclusions are drawn)
Completeness (all correct conclusions are drawn)
Is this all what we need?
Other Important Questions
◮
Expressive power of the representation language (RL)
Are we able to represent our problem in the given RL?
◮
Decidability of the reasoning procedure (on the given RL)
Is there a terminating algo providing the correct answer for
a given reasoning task?
◮
Complexity
What amount of resources (time, space) are required (in
the worst case) to answer the question?
Basic Ideas Underlying Inductive Definitions
◮
◮
Inductive definitions widely used in CS (recursion!!!)
Basic idea: given basic set A0 ⊆ B
rule f : B n 7→ B
◮
Incremental construction of sets
Ai+1 = Ai ∪ {f (a1 , . . . , an ) | a1 , . . . , an ∈ Ai }
◮
Limes of Ai (when i goes to infinity)
[
Ai
A=
i≥0
◮
A set A is closed under f , if the following holds:
a1 , . . . , an ∈ A
⇒
f (a1 , . . . , an ) ∈ A
Basic Ideas Underlying Inductive Definitions (2)
Schema of the inductive definition
A is the smallest set for which (a) and (b) holds:
(a) A0 ⊆ A
(b) a1 , . . . , an ∈ A ⇒ f (a1 , . . . , an ) ∈ A
(A is closed under f )
Often simple induction is used:
1. You want to prove ∀n : nat. P(n)
(i.e., a property P holds for all natural numbers)
2. You show the base case P(0)
3. In the induction step, you prove ∀n : nat. (P(n) → P(n + 1))
(i.e., if you had a proof of P(n) (induction hypothesis), you
could prove P(n + 1))
The Syntax of PL0 (Alternative 1)
◮
Given a countable set, BV, of boolean variables
◮
Boolean variables like p, q, r , p1 , . . . represent facts:
e.g., r represents “it is raining”
◮
◮
Use p, q, . . . as metavariables for BVs and φ, ψ, . . . as
metavariables for formulas
Inductive definition of the set of propositional formulas L0
B1:
B2:
S1:
S2:
◮
Every p ∈ BV is a formula (called atomic formula or atom)
⊤ (verum) and ⊥ (falsum) are formulas
If φ is a formula, then so is (¬φ) (negation)
If φ1 and φ2 are formulas, then so are (φ1 ∧ φ2 )
(conjunction), (φ1 ∨ φ2 ) (disjunction), (φ1 → φ2 )
(implication), (φ1 ↔ φ2 ) (equivalence) and (φ1 ⊕ φ2 )
(exclusive-or)
What is A0 , f , and A here?
The Syntax of PL0 (Alternative 2)
L ::= ⊤ | ⊥ | BV | (¬L) | (L∧L) | (L∨L) | (L → L) | (L ↔ L) | (L⊕L)
◮
Read this as: L is the smallest set such that 1. and 2. hold:
1. If p ∈ BV, p is ⊤ or p is ⊥, then p ∈ L
2. If φ, ψ ∈ L then
(¬φ), (φ ∧ ψ), (φ ∨ ψ), (φ → ψ), (φ ↔ ψ), (φ ⊕ ψ) ∈ L
◮
To save parenthesis, use the following ranking of binding
strength: ¬, ∧, ∨, →, ↔, ⊕ (¬ binds stronger than ∧, etc.)
◮
Example: ¬p ∧ q → r ∨ s means (((¬p) ∧ q) → (r ∨ s))
The Syntax of PL0 Cont’d
◮
A literal is ⊤, ⊥, an atom or the negation thereof
◮
A clause is a disjunction of literals
Immediate subformula (relation)
◮
◮
◮
φ is an immediate subformula (isf) of ¬φ
φ1 and φ2 are isfs of (φ1 ◦ φ2 ) for ◦ ∈ {∧, ∨, →, ↔, ⊕}
◮
Subformula relation: reflexive-transitive closure of the
immediate subformula relation
◮
Example: all subformulas of ¬p ∧ q → r ∨ s
¬p ∧ q → r ∨ s, ¬p ∧ q, r ∨ s, ¬p, q, r , s, p
The Syntax of PL0 Cont’d
◮
A literal is ⊤, ⊥, an atom or the negation thereof
◮
A clause is a disjunction of literals
Immediate subformula (relation)
◮
◮
◮
φ is an immediate subformula (isf) of ¬φ
φ1 and φ2 are isfs of (φ1 ◦ φ2 ) for ◦ ∈ {∧, ∨, →, ↔, ⊕}
◮
Subformula relation: reflexive-transitive closure of the
immediate subformula relation
◮
Example: all subformulas of ¬p ∧ q → r ∨ s
¬p ∧ q → r ∨ s, ¬p ∧ q, r ∨ s, ¬p, q, r , s, p
The Syntax of PL0 Cont’d
◮
A literal is ⊤, ⊥, an atom or the negation thereof
◮
A clause is a disjunction of literals
Immediate subformula (relation)
◮
◮
◮
φ is an immediate subformula (isf) of ¬φ
φ1 and φ2 are isfs of (φ1 ◦ φ2 ) for ◦ ∈ {∧, ∨, →, ↔, ⊕}
◮
Subformula relation: reflexive-transitive closure of the
immediate subformula relation
◮
Example: all subformulas of ¬p ∧ q → r ∨ s
¬p ∧ q → r ∨ s, ¬p ∧ q, r ∨ s, ¬p, q, r , s, p
The Syntax of PL0 Cont’d
◮
A literal is ⊤, ⊥, an atom or the negation thereof
◮
A clause is a disjunction of literals
Immediate subformula (relation)
◮
◮
◮
φ is an immediate subformula (isf) of ¬φ
φ1 and φ2 are isfs of (φ1 ◦ φ2 ) for ◦ ∈ {∧, ∨, →, ↔, ⊕}
◮
Subformula relation: reflexive-transitive closure of the
immediate subformula relation
◮
Example: all subformulas of ¬p ∧ q → r ∨ s
¬p ∧ q → r ∨ s, ¬p ∧ q, r ∨ s, ¬p, q, r , s, p
The Syntax of PL0 Cont’d
◮
A literal is ⊤, ⊥, an atom or the negation thereof
◮
A clause is a disjunction of literals
Immediate subformula (relation)
◮
◮
◮
φ is an immediate subformula (isf) of ¬φ
φ1 and φ2 are isfs of (φ1 ◦ φ2 ) for ◦ ∈ {∧, ∨, →, ↔, ⊕}
◮
Subformula relation: reflexive-transitive closure of the
immediate subformula relation
◮
Example: all subformulas of ¬p ∧ q → r ∨ s
¬p ∧ q → r ∨ s, ¬p ∧ q, r ∨ s, ¬p, q, r , s, p
Propositional Formulas as Trees
◮
Formulas can be depicted as formula trees
◮
Example: ((p ∧ q) → r ) ↔ (p → (q → r ))
↔
→
→
∧
p
r
q
→
p
q
r
The Semantics of PL0
◮
A boolean value (or truth value) is either 0 (false) or 1 (true)
◮
An interpretation function for a set P of boolean variables:
mapping I : P 7→ {0, 1}
◮
Interpretation functions are often called truth assignments
e.g., I assigns 1 to p ∈ P, i.e., I(p) = 1
◮
Since we want to “evaluate” formulas under I, we have to
extend I to formulas
The Extension of I to Formulas
◮
I(⊤) = 1 and I(⊥) = 0
◮
I(¬φ) = 1 iff I(φ) = 0
◮
I(φ ∧ ψ) = 1 iff I(φ) = I(ψ) = 1
◮
I(φ ∨ ψ) = 1 iff I(φ) = 1 or I(ψ) = 1
◮
I(φ → ψ) = 1 iff I(φ) = 0 or I(ψ) = 1
◮
I(φ ↔ ψ) = 1 iff I(φ) = I(ψ)
◮
I(φ ⊕ ψ) = 1 iff I(φ) 6= I(ψ)
Equivalent notations:
φ is true under I iff I satisfies φ
iff I(φ) = 1 iff I |= φ
φ is false under I iff I does not satisfy φ iff I(φ) = 0 iff I 6|= φ
Truth Tables
◮
Another representation of the extension of I from above
◮
One table for each connective (What is the table for ⊕?)
¬
1
0
0
1
∧
1
0
1
1
0
0
0
0
∨
1
0
1
1
1
0
1
0
→
1
0
1
1
1
0
0
1
↔
1
0
1
1
0
0
0
1
Even More Notations
◮
If I satisfies φ, then we call I a model of φ
◮
Mod(ψ) is the set of all models of ψ
◮
φ is satisfiable (valid) if φ is true in some (all) interpretations
◮
φ is unsatisfiable if φ is false in all interpretations
◮
Formulas φ and ψ are equivalent, denoted by φ ≡ ψ, iff
they have exactly the same models, i.e., Mod(φ) = Mod(ψ)
◮
Example: (φ → ψ) ≡ (¬ψ → ¬φ): Take I ∈ Mod(φ → ψ)
I(φ → ψ) = 1 iff I(φ) = 0 or I(ψ) = 1
iff I(¬φ) = 1 or I(ψ) = 1
iff I(¬φ) = 1 or I(¬ψ) = 0
iff I(¬ψ → ¬φ) = 1
Some Useful Equivalences
Commutativity
Idempotence
Tautology
Unsatisfiability
Neutrality
Negation
Double Negation
Implication
φ◦ψ
φ◦φ
φ∨⊤
φ∧⊥
φ∧⊤
φ∨⊥
φ ∨ ¬φ
φ ∧ ¬φ
¬¬φ
φ→ψ
≡
≡
≡
≡
≡
≡
≡
≡
≡
≡
ψ◦φ
φ
⊤
⊥
φ
φ
⊤
⊥
φ
¬φ ∨ ψ
for ◦ ∈ {∨, ∧, ↔}
for ◦ ∈ {∨, ∧}
Some Useful Equivalences Cont’d
De Morgan
Absorption
Distributivity
Associativity
¬(φ ∨ ψ)
¬(φ ∧ ψ)
φ ∨ (φ ∧ ψ)
φ ∧ (φ ∨ ψ)
φ ∧ (ψ ∨ χ)
φ ∨ (ψ ∧ χ)
φ ∨ (ψ ∨ χ)
φ ∧ (ψ ∧ χ)
≡
≡
≡
≡
≡
≡
≡
≡
¬φ ∧ ¬ψ
¬φ ∨ ¬ψ
φ
φ
(φ ∧ ψ) ∨ (φ ∧ χ)
(φ ∨ ψ) ∧ (φ ∨ χ)
(φ ∨ ψ) ∨ χ
(φ ∧ ψ) ∧ χ
Connections Between the Different Notations
◮
Distinguish between
◮
◮
◮
tautologies: all interpretations are models
satisfiable formulas: some interpretations are models
contradictions: no interpretation is a model
◮
A formula φ is valid iff ¬φ is unsatisfiable
Recall that this is the basis for a “proof by contradiction”
◮
A formula φ is satisfiable iff ¬φ is not valid
◮
Two formulas φ and ψ are equivalent iff φ ↔ ψ is valid
◮
A formula φ is valid iff φ is equivalent to ⊤
◮
A formula φ is unsatisfiable iff φ is equivalent to ⊥
Entailment (or Logical Implication)
◮
So far, |= relates an interpretation and a formula
◮
Allow also a set of formulas on the left side
◮
Important: a set of formulas coincides
V with the conjunction
of its elements, i.e., {φ1 , . . . , φn } is ni=1 φi
◮
Important: an empty conjunction is 1 in all interpretations
i.e., it is equivalent to ⊤
◮
W entails φ, W |= φ, iff Mod(W ) ⊆ Mod(φ)
◮
W |= φ iff I |= φ for all models I of W (for all I ∈ Mod(W ))
Properties of Entailment
◮
W |= ψ implies W ∪ {φ} |= ψ
Monotonicity for PL0
◮
W ∪ {φ} |= ψ iff W |= φ → ψ
Deduction Thm
◮
W ∪ {φ} |= ¬ψ iff W ∪ {ψ} |= ¬φ
◮
W ∪ {φ} is unsatisfiable iff W |= ¬φ
Contraposition Thm
Contradiction Thm
Important Questions to Answer
Q1 How can we algorithmicly check whether I |= φ holds?
➥ Evaluation of a formula φ under a given interpretation I
Q2 When does W |= φ hold?
Q2’ When does |= φ hold?
◮
◮
This is a special case of Q2 with empty W !
Q2’ asks: when is φ a tautology (1 in all interpretations)?
Q3 Can we define deduction (based on syntactic rules), s.t.
the results of deduction and entailment coincide?
◮
◮
◮
Write W ⊢i φ if φ is derived from W by deduction proc. i
i is sound: if W ⊢i φ holds, then W |= φ also holds
i is complete: if W |= φ holds, then W ⊢i φ also holds
Evaluation of a Formula Under an Interpretation
Evaluate φ : (p → q) ∧ (p ∧ q → r ) → (p → r ) under
I = {p 7→ 1, q 7→ 0, r 7→ 1} starting with r
1
2
3
4
5
6
7
8
9
(p
(p
p
p
formula
→ q) ∧ (p ∧ q → r ) → (p → r )
p→r
→ q) ∧ (p ∧ q → r )
p∧q →r
→q
p∧q
p
p
q
q
r
r
Try other evaluation orders!
value
1
1
0
1
0
0
1
0
1
Evaluation of a Formula Under an Interpretation
Evaluate φ : (p → q) ∧ (p ∧ q → r ) → (p → r ) under
I = {p 7→ 1, q 7→ 0, r 7→ 1} starting with r
1
2
3
4
5
6
7
8
9
(p
(p
p
p
formula
→ q) ∧ (p ∧ q → r ) → (p → r )
p→r
→ q) ∧ (p ∧ q → r )
p∧q →r
→q
p∧q
p
p
q
q
r
r
Try other evaluation orders!
value
1
1
0
1
0
0
1
0
1
Evaluation of a Formula Under an Interpretation
Evaluate φ : (p → q) ∧ (p ∧ q → r ) → (p → r ) under
I = {p 7→ 1, q 7→ 0, r 7→ 1} starting with r
1
2
3
4
5
6
7
8
9
(p
(p
p
p
formula
→ q) ∧ (p ∧ q → r ) → (p → r )
p→r
→ q) ∧ (p ∧ q → r )
p∧q →r
→q
p∧q
p
p
q
q
r
r
Try other evaluation orders!
value
1
1
0
1
0
0
1
0
1
Evaluation of a Formula Under an Interpretation
Evaluate φ : (p → q) ∧ (p ∧ q → r ) → (p → r ) under
I = {p 7→ 1, q 7→ 0, r 7→ 1} starting with r
1
2
3
4
5
6
7
8
9
(p
(p
p
p
formula
→ q) ∧ (p ∧ q → r ) → (p → r )
p→r
→ q) ∧ (p ∧ q → r )
p∧q →r
→q
p∧q
p
p
q
q
r
r
Try other evaluation orders!
value
1
1
0
1
0
0
1
0
1
How to Check Entailments W |= φ and |= φ
How can we use the evaluation procedure to answer Q2’?
◮
Consider formula φ with {p1 , . . . , pn } as prop. variables
◮
Generate all 2n I over these n variables one after the other
Test each of the generated interpretation I
◮
◮
◮
◮
Evaluate with the above procedure φ under the current I
If I(φ) = 0 then STOP and answer “φ is not a tautology”
If I(φ) = 1 for all I then STOP and answer “φ is a tautology”
How is Q2 handled (i.e., W |= φ)?
◮
Assume W is {ψ1 , . . . , ψm } and apply the Deduction Thm
◮
Obtain, e.g., |= ψ1 → (ψ2 → (· · · (ψm → φ) · · · )
Decision Procedure for PL0
◮
Check proc. is based on enumeration of interpretations
◮
◮
◮
Check procedure for validity is a Decision Procedure
◮
◮
◮
◮
For n atoms in the input formula: 2n interpretations possible
Worst case: all 2n interpretations have to be generated
Possible answer is either yes or no
Decides entailment (and validity)
Decides satisfiability by reduction approach:
φ is satisfiable iff ¬φ is not valid (i.e., ¬φ is not a tautology)
Can we do better/differently?
Reduction to Satisfiability
Reduce validity, entailment, equivalence to satisfiability
1 Validity
◮
¬φ is unsatisfiable iff φ is valid
2 Entailment
◮
◮
φ entails ψ (φ |= ψ) iff φ → ψ is valid (apply Deduction Thm)
Hence, φ |= ψ iff φ ∧ ¬ψ (i.e., ¬(φ → ψ)) is unsatisfiable
3 Equivalence
◮
◮
◮
φ is equivalent to ψ (φ ≡ ψ) iff φ ↔ ψ is valid
Hence, φ ≡ ψ iff φ |= ψ and ψ |= φ hold
Consequently, φ ≡ ψ iff φ ∧ ¬ψ and ψ ∧ ¬φ are unsatisfiable
Sound and complete procedure for satisfiability is sufficient!
Table of Synonym Notions
All four statements in each line amount the same
entailment(s)
φ |= ψ
⊤ |= ψ
⊤ 6|= ¬ψ
φ |= ψ and ψ |= φ
validity
φ → ψ valid
ψ valid
¬ψ not valid
φ ↔ ψ valid
satisfiability
φ ∧ ¬ψ unsat
¬ψ unsat
ψ sat
φ ↔ ¬ψ unsat
equivalence
(φ → ψ) ≡ ⊤
ψ≡⊤
¬ψ 6≡ ⊤
φ≡ψ
Normal Forms: NNF and CNF
◮
◮
Restricted syntax, but retain the important properties
(application-dependent, e.g., provability)
Negation Normal Form (NNF): A formula in NNF has
◮
◮
◮
negation signs only in front of atoms and
the only connectives are ∧ and ∨
Conjunctive Normal Form (CNF): A formula in CNF
◮
◮
consists of a conjuction of clauses (=disjunction of literals)
(often represented as a set of clauses)
Clauses sometimes represented as sets of literals
(can cause problems)
◮
Every PL0-formula has an equivalent formula in NNF/CNF!
◮
But how do we construct them?
Preparatory Concept: Tree Replacements
◮
Let φ[ψ] denote that ψ occurs in φ
◮
This means that ψ occurs as zero, one or more subtree(s)
in the formula tree of φ
◮
Possibility to perform subtree replacements
Example: φ : ¬(p ∧ q) ∨ r and ψ1 : ¬(p ∧ q)
◮
◮
◮
Then φ[ψ1 ] indicates occurrence(s) of ψ1 in φ
Construct φ[ψ2 ] with ψ2 : ¬p ∨ ¬q by a tree replacement
∨
¬
r
∧
p
∨
q
=⇒
∨
r
¬
¬
p
q
Equivalent Replacement
Lemma (Equivalent Replacement Lemma)
Let I be an interpretation and I |= ψ1 ↔ ψ2 . Then
I |= φ[ψ1 ] ↔ φ[ψ2 ].
Theorem (Equivalent Replacement Theorem)
Let ψ1 ≡ ψ2 . Then φ[ψ1 ] ≡ φ[ψ2 ].
Basics of the NNF Translation
◮
Replace ↔ by → using (φ ↔ ψ) ≡ ((φ → ψ) ∧ (ψ → φ))
◮
Replace ⊕ using (φ ⊕ ψ) ≡ ((φ ∨ ψ) ∧ (¬φ ∨ ¬ψ))
◮
Replace → using (φ → ψ) ≡ (¬φ ∨ ψ)
◮
Replace the left side of the following equivalences by the
right side (order does not matter!)
¬(φ ∨ ψ)
φ∨⊤
φ∧⊥
φ∧⊤
φ∨⊥
¬¬φ
≡
≡
≡
≡
≡
≡
¬φ ∧ ¬ψ
⊤
⊥
φ
φ
φ
¬(φ ∧ ψ)
⊤∨φ
⊥∧φ
⊤∧φ
⊥∨φ
≡
≡
≡
≡
≡
(why?)
¬φ ∨ ¬ψ
⊤
⊥
φ
φ
◮
Translation process is terminating with the NNF
◮
For any PL0-formulas λ, nnf(λ) ↔ λ holds
Basics of the CNF Translation
◮
Based on the application of distributivity laws
◮
Start with the formula φ and translate it to NNF
◮
Take nnf(φ) and replace the left side of the following
equivalences by the right side (order does not matter!)
1
φ ∨ (ψ ∧ χ) ≡ (φ ∨ ψ) ∧ (φ ∨ χ)
2
(ψ ∧ χ) ∨ φ ≡ (ψ ∨ φ) ∧ (χ ∨ φ)
Observe that nnf(φ) ≡ cnf(φ) ≡ φ holds
◮
Exa: Transform φ : (p ∧ q → r ) → (q → r ) to CNF
nnf(φ) : (p ∧ q ∧ ¬r ) ∨ (¬q ∨ r )
Formula
(p ∧ q ∧ ¬r ) ∨ (¬q ∨ r )
(p ∨ ¬q ∨ r ) ∧ (q ∧ ¬r ∨ (¬q ∨ r ))
(p ∨ ¬q ∨ r ) ∧ (q ∨ ¬q ∨ r ) ∧ (¬r ∨ ¬q ∨ r )
(why?)
Rule
2
2
Two disadvantages:
1. Disruption of the formula’s structure
2. cnf(φ) can be exponentially longer than φ
Take a formula in disjunctive NF and translate it to CNF!
Can be avoided: use definitional translation (
circuit exa)
The Method of Davis, Logeman and Loveland
◮
M. Davis, G. Logeman, D. Loveland A machine program for
theorem proving, CACM, Vol. 5, No. 7, pp. 394-397, 1962
◮
Basic framework for all modern SAT solvers
(require additional features like learning and
non-chronological backtracking to be competitive)
◮
DLL is search-based (rather than resolution-based as DP)
Basic Idea: Given a clause set C
◮
◮
◮
◮
Try all (partial) assignments and test whether C is sat
Stop enlarging the current partial assignment I when there
is a conflict (i.e., C cannot be satisfied with extensions of I)
Stop if I satisfying C is found or all possible I have been tried
The Basic DLL Procedure: An Example
a′ ∨ b ∨ c
a∨c∨d
a ∨ c ∨ d′
a ∨ c′ ∨ d
a ∨ c′ ∨ d ′
b′ ∨ c ′ ∨ d
a′ ∨ b ∨ c ′
a′ ∨ b ′ ∨ c
p′ means ¬p
The Basic DLL Procedure: An Example
a′ ∨ b ∨ c
a∨c∨d
a ∨ c ∨ d′
a ∨ c′ ∨ d
a ∨ c′ ∨ d ′
b′ ∨ c ′ ∨ d
a′ ∨ b ∨ c ′
a′ ∨ b ′ ∨ c
p′ means ¬p
a
The Basic DLL Procedure: An Example
a′ ∨ b ∨ c
a∨c∨d
a ∨ c ∨ d′
a ∨ c′ ∨ d
a ∨ c′ ∨ d ′
b′ ∨ c ′ ∨ d
a′ ∨ b ∨ c ′
a′ ∨ b ′ ∨ c
p′ means ¬p
←
←
←
a
0
The Basic DLL Procedure: An Example
a′ ∨ b ∨ c
a∨c∨d
a ∨ c ∨ d′
a ∨ c′ ∨ d
a ∨ c′ ∨ d ′
b′ ∨ c ′ ∨ d
a′ ∨ b ∨ c ′
a′ ∨ b ′ ∨ c
p′ means ¬p
a
←
0
b
←
←
The Basic DLL Procedure: An Example
a′ ∨ b ∨ c
a∨c∨d
a ∨ c ∨ d′
a ∨ c′ ∨ d
a ∨ c′ ∨ d ′
b′ ∨ c ′ ∨ d
a′ ∨ b ∨ c ′
a′ ∨ b ′ ∨ c
p′ means ¬p
a
←
0
b
0
←
←
←
The Basic DLL Procedure: An Example
a′ ∨ b ∨ c
a∨c∨d
a ∨ c ∨ d′
a ∨ c′ ∨ d
a ∨ c′ ∨ d ′
b′ ∨ c ′ ∨ d
a′ ∨ b ∨ c ′
a′ ∨ b ′ ∨ c
p′ means ¬p
a
←
0
b
0
c
←
←
←
The Basic DLL Procedure: An Example
a′ ∨ b ∨ c
a∨c∨d
a ∨ c ∨ d′
a ∨ c′ ∨ d
a ∨ c′ ∨ d ′
b′ ∨ c ′ ∨ d
a′ ∨ b ∨ c ′
a′ ∨ b ′ ∨ c
←
←
←
←
←
←
←
←
a
0
b
0
c
0
Conflict between ← clauses wrt d and d ′
p′ means ¬p
The Basic DLL Procedure: An Example
a′ ∨ b ∨ c
a∨c∨d
a ∨ c ∨ d′
a ∨ c′ ∨ d
a ∨ c′ ∨ d ′
b′ ∨ c ′ ∨ d
a′ ∨ b ∨ c ′
a′ ∨ b ′ ∨ c
p′ means ¬p
a
←
0
b
←
←
←
←
←
0
c
0
The Basic DLL Procedure: An Example
a′ ∨ b ∨ c
a∨c∨d
a ∨ c ∨ d′
a ∨ c′ ∨ d
a ∨ c′ ∨ d ′
b′ ∨ c ′ ∨ d
a′ ∨ b ∨ c ′
a′ ∨ b ′ ∨ c
a
←
0
b
←
←
←
←
←
0
c
0
1
Conflict between ← clauses wrt d and d ′
p′ means ¬p
The Basic DLL Procedure: An Example
a′ ∨ b ∨ c
a∨c∨d
a ∨ c ∨ d′
a ∨ c′ ∨ d
a ∨ c′ ∨ d ′
b′ ∨ c ′ ∨ d
a′ ∨ b ∨ c ′
a′ ∨ b ′ ∨ c
p′ means ¬p
a
←
0
b
0
c
←
←
←
0
1
The Basic DLL Procedure: An Example
a′ ∨ b ∨ c
a∨c∨d
a ∨ c ∨ d′
a ∨ c′ ∨ d
a ∨ c′ ∨ d ′
b′ ∨ c ′ ∨ d
a′ ∨ b ∨ c ′
a′ ∨ b ′ ∨ c
a
0
1
b
b
0
0
1
c
c
1 0
0
1
1
I(c) = I(d) = 1 forced by I(a) = I(b) = 1 by UNIT
p′ means ¬p
The Basic DLL Procedure: An Example
a′ ∨ b ∨ c
a∨c∨d
a ∨ c ∨ d′
a ∨ c′ ∨ d
a ∨ c′ ∨ d ′
b′ ∨ c ′ ∨ d
a′ ∨ b ∨ c ′
a′ ∨ b ′ ∨ c
a
0
1
b
b
0
0
1
c
c
1 0
0
1
1
Easy to check: I(a) = I(b) = I(c) = I(d) = 1 is a model
p′ means ¬p
The Basic DLL Procedure
◮
Inference rules in DLL:
◮
◮
◮
UNIT: In an unsatisfied clause C ∈ C (by the current partial
assignment), if there is only one literal unassigned, then C
is unit (Value of unit clause is implied: Make the literal true!)
Boolean Constraint Propagation (BCP)
Apply UNIT until no more unit clause is available in C
PURE: (Seldom used in practice)
If a variable occurs in one polarity only: Make its literal true
The Basic DLL Procedure: The Destructive Version
◮
Sometimes, “destructive” version of DLL is considered
(seen in former lecture on theoretical CS)
◮
Apply assignment of variable to formula and simplify
◮
Simplification: Use rules below to eliminate truth constants
φ∨⊤
φ∧⊥
φ∧⊤
φ∨⊥
◮
≡
≡
≡
≡
⊤
⊥
φ
φ
⊤∨φ
⊥∧φ
⊤∧φ
⊥∨φ
Two possible results on clause set C
◮
◮
Delete clauses with true literal from C
Delete false literal from clauses in C
≡
≡
≡
≡
⊤
⊥
φ
φ
The Features of the DLL Procedure
◮
Polynomial memory requirement (exponential in DP!)
◮
Exponential time requirement remains
(except for restricted inputs like 2-CNF)
◮
Chronological backtracking
Ok for random instances, bad for practical problems w. structure
◮
Need extensions to be of practical value
◮
◮
◮
Heuristics to select variables to branch next
(including the assignment to consider first)
“Intelligent” (non-chronological) backtracking
Learning from successful and unsuccessful decisions
© Copyright 2026 Paperzz