Propositional Logic and the Satisfiability Problem
I Propositional Logic
I The Satisfiability Problem
I Semantic Equivalence
I Normal Forms
I Complexity
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
1
Propositional Logic
I Definition An alphabet of propositional logic consists of
. a (countably) infinite set R = {p1, p2, . . .} of propositional variables,
. the set {¬/1, ∧/2, ∨/2, → /2, ↔ /2} of connectives, and
. the special characters “(” and “)”.
I Indices are sometimes omitted.
I We will occasionally use other letters to denote variables.
I Different alphabets of propositional logic differ in R.
I Instead of pi we could have used i as propositional variable.
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
2
Propositional Formulas
I Definition An atomic formula, briefly called atom, is a propositional variable.
I Definition The set of propositional formulas is the smallest set L(R) of strings
over an alphabet of propositional logic with the following properties:
1. If F is an atomic formula, then F ∈ L(R).
2. If F ∈ L(R), then ¬F ∈ L(R).
3. If ◦/2 is a binary connective, F, G ∈ L(R), then (F ◦ G) ∈ L(R).
I Notation
A
F , G, H
(possibly indexed) denotes an atom,
(possibly indexed) denote propositional formulas.
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
3
3.2 Semantics
I The set of truth values W is the set {>, ⊥}.
I We consider the following functions on W :
. Negation ¬∗/1.
. Conjunction ∧∗/2.
. Disjunction ∨∗/2.
. Implication →∗ /2.
. Equivalence ↔∗ /2.
>
>
⊥
⊥
>
⊥
>
⊥
¬∗
⊥
⊥
>
>
∧∗
>
⊥
⊥
⊥
∨∗
>
>
>
⊥
→∗
>
⊥
>
>
↔∗
>
⊥
⊥
>
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
4
3.2.2 Interpretations, Models and Logic Consequences
I Definition An interpretation I = (W, ·I ) consists of the set W and a mapping
·I : L(R) → W with:
8
if F ∈ R,
< w∈W
I
∗
I
[F ] =
¬ [G]
if F is of the form ¬G,
:
([G1]I ◦∗ [G2]I ) if F is of the form (G1 ◦ G2).
I Definition An interpretation I = (W, ·I ) is called a model for a propositional
formula F , in symbols I |= F , if [F ]I = >; in this case we say that I satisfies F .
F is unsatisfiable if it has no models.
I Definition An interpretation I = (W, ·I ) is called a model for a set G of
propositional formulas, in symbols I |= G , if [F ]I = > for all F ∈ G ;
in this case we say that I satisfies G .
I Definition A propositional formula F is a logical consequence
of a set of propositional formulas G , in symbols G |= F ,
if every model for G is also a model for F .
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
5
Remarks and Notation
I An interpretation I = (W, ·I ) is uniquely defined by specifying how ·I acts on
propositional variables.
I We will sometimes identify an interpretation I = (W, ·I ) with
{A ∈ R | [A]I = >}.
I I (possibly indexed) denotes an interpretation.
I We often write F I instead of [F ]I .
I We define the following precedence hierarchy among connectives:
¬ {∨, ∧} → ↔ .
I We sometimes omit parentheses taking into account that conjunction and
disjunction are associative and commutative.
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
6
Propositional Satisfiability Problems
I Definition A propositional satisfiability problem, briefly called SAT, consists of a
formula F ∈ L(R), and is the problem to decide whether F is satisfiable.
I SAT is a combinatorial decision problem.
. Decision variant yes/no answer.
. Search variant find a model if F is satisfiable.
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
7
A Simple SAT Instance
I Let R ⊇ {p1, p2, p3, p4, p5}.
I Let F = (¬p1 ∨ p2)
∧ (¬p2 ∨ p1)
∧ (¬p1 ∨ ¬p2 ∨ ¬p3)
∧ (p1 ∨ p2)
∧ (¬p4 ∨ p3)
∧ (¬p5 ∨ p3) .
I {p1, p2} is a model for F .
I Hence, F is satisfiable.
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
8
Subformulas
I Definition Let F be a propositional formula. The set of subformulas of F is the
smallest set of formulas S (F ) satisfying the following conditions:
1. F ∈ S (F ).
2. If ¬G ∈ S (F ), then G ∈ S (F ).
3. If (G1 ◦ G2) ∈ S (F ), then G1, G2 ∈ S (F ).
I Example
S (¬((p1 → p2) ∨ p1))
= {¬((p1 → p2) ∨ p1), ((p1 → p2) ∨ p1), (p1 → p2), p1, p2}.
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
9
Semantic Equivalence
I Definition Two propositional formulas F and G are semantically equivalent,
in symbols F ≡ G, if for all interpretations I we have: I |= F iff I |= G.
I Some equivalence laws:
¬¬F
≡
F
double negation
¬(F ∧ G )
¬(F ∨ G )
≡
≡
(¬F ∨ ¬G)
(¬F ∧ ¬G)
de Morgan
(F ∧ (G ∨ H ))
(F ∨ (G ∧ H ))
≡
≡
((F ∧ G) ∨ (F ∧ H ))
((F ∨ G) ∧ (F ∨ H ))
distributivity
(F ↔ G )
≡
((F ∧ G) ∨ (¬G ∧ ¬F ))
equivalence
(F → G )
≡
(¬F ∨ G)
implication
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
10
Generalized Disjunctions and Conjunctions
I Generalized disjunction
[F1, . . . , Fn] = (. . . ((F1 ∨ F2) ∨ F3) ∨ . . . ∨ Fn)
I Generalized conjunction
hF1, . . . , Fni = (. . . ((F1 ∧ F2) ∧ F3) ∧ . . . ∧ Fn)
I Empty generalized disjunction: [ ] with [ ]I = ⊥ for all I .
I Empty generalized conjunction: hi with hiI = > for all I .
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
11
Normal Forms
I Definition A literal is a propositional variable, or a negated propositional variable.
The complement of a literal is defined as follows:
. If the literal is a propositional variable A, then its complement is ¬A,
. if it is a negated propositional letter ¬A, then its complement is A.
I Definition
. A clause is a generalized disjunction [L1, . . . , Ln], n ≥ 0,
where every Li, 1 ≤ i ≤ n, is a literal.
. A dual clause is a generalized conjunction hL1, . . . , Lni, n ≥ 0,
where every Li, 1 ≤ i ≤ n, is a literal.
. A formula is in conjunctive normal form (clause form, CNF) iff it is of the
form hC1, . . . , Cmi, m ≥ 0, and if every Cj , 1 ≤ j ≤ m, is a clause.
. A formula is in disjunctive normal form (dual clause form, DNF) iff it is of
the form [C1, . . . , Cm], m ≥ 0, and if every Cj , 1 ≤ j ≤ m, is a dual
clause.
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
12
More on Normal Forms
I A formula F in CNF is said to be in n-CNF
if each clause occurring in F has at most n literals.
I A clause is a Horn clause if at most one disjunct is an atom.
I A formula F in CNF is a Horn formula if it contains only Horn clauses.
I A clause is a unit clause if it contains precisely one literal.
I Notation
. L (possibly indexed) denotes a literal and L its complement.
. C (possibly indexed) denotes a clause.
. Clauses and formulas in CNF are sometimes considered as
sets of literals and clauses, respectively, in which case
• Li, 1 ≤ i ≤ n, are said to be elements of [L1, . . . , Ln] and
• Cj , 1 ≤ j ≤ m, are said to be elements of hC1, . . . , Cmi.
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
13
Transformation into Clause Form
I Theorem
1. There is an algorithm which transforms any propositional formula into a
semantically equivalent formula in clause form.
2. There is an algorithm which transforms any propositional formula into a
semantically equivalent formula in dual clause form.
I Observation
. All equivalences can be eliminated using the law
F ↔ G ≡ (F ∧ G) ∨ (¬F ∧ ¬G).
. All implications can be eliminated using the law
F → G ≡ ¬F ∨ G.
. Hence, we can assume that only the connectives ¬, ∧ and ∨ occur in
formulas.
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
14
An Algorithm for the Transformation into Clause Form
I Input: A propositional formula F .
Output: A formula, which is in conjunctive normal form and is equivalent to F .
G := h[F ]i. (G is a conjunction of disjunctions.)
While G is not in conjunctive normal form do:
Select a non-clausal element H from G.
Select a non-literal element K from H .
Apply the rule among the following ones which is applicable.
¬¬D
D
( D1 ∧ D2 )
D1 | D2
¬ ( D1 ∧ D2 )
¬D1, ¬D2
( D1 ∨ D2 )
D1 , D 2
¬ ( D1 ∨ D2 )
¬D1 | ¬D2
D
I A rule D
0 is applicable to K if K is of the form D .
If applied, then K is replaced by D 0.
I A rule D D|D is applicable to K if K is of the form D .
1 2
If applied, H is replaced by two disjunctions:
The first one is obtained from H by replacing the occurrence of D by D1.
The second one is obtained from H by replacing the occurrence of D by D2.
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
15
An Example
. Let F = (p ∧ (p → q )) → q .
. F is valid, i.e., all interpretations are models.
. Eliminating implications yields:
¬(p ∧ (¬p ∨ q )) ∨ q.
. Applying the algorithm yields:
h[¬(p ∧ (¬p ∨ q )) ∨ q ]i
h[¬(p ∧ (¬p ∨ q ), q ]i
h[¬p, ¬(¬p ∨ q ), q ]i
h[¬p, ¬¬p ∧ ¬q, q ]i
h[¬p, ¬¬p, q ], [¬p, ¬q, q ]i
h[¬p, p, q ], [¬p, ¬q, q ]i
. Both clauses in the final formula contain a complementary pair of literals.
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
16
Definitional Transformation
I The size of a formula may grow exponentially during normalization.
I Can we do better?
. Unfortunately, the shortest CNF of some F is exponential in the size of F .
. Luckily, we may use a weaker concept.
I Definitional transformation (Eder, 1985)
. Let F be a formula, G ∈ S (F ) and p 6∈ S (F ) a propositional variable.
. Replace F by F dG 7→ pe ∧ (p ↔ G).
I Some observations
. F 6≡ F dG 7→ pe ∧ (p ↔ G).
. F is satisfiable iff F dG 7→ pe ∧ (p ↔ G) is satisfiable.
. The above mentioned exponential growth can be avoided.
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
17
Computational Complexity
I Let P be the class of problems that can be solved by a deterministic Turing
machine in polynomial time.
I Let N P be the class of problems that can be solved by a nondeterministic Turing
machine in polynomial time.
I Obviously, P ⊆ N P .
I The question whether N P ⊆ P holds is open.
I A problem that is at least as hard as any other problem in N P is called N P -hard
(in the sense that each problem in N P can by polynomially reduced to it).
I An N P -hard problem which is in N P is called N P -complete.
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
18
Computational Complexity and SAT
I Let F be a formula containing 1000 different propositional variables.
I There are 21000 different interpretations for F .
I A truth table for F has 21000 rows.
I SAT is N P -complete.
I This holds even if SAT is restricted to CNF or even 3-CNF formulae
(Garey, Johnson 1979).
I SAT is decidable in linear time for DNF, for 2-CNF (Cook 1971) or for Horn formulae
(Dowling, Gallier 1984; Scutella 1990).
Satisfiability Testing or How to Solve Sudoko Puzzles – Propositional Logic and the SAT Problem (16th April 2007)
19
© Copyright 2026 Paperzz