Notes@HKU by Jax

Logic & Satisfiability

Propositional Logic

The area of Logic that deals with propositions:

Propositions

A proposition pp is a statement that is either true or false, but not both, which must delcare a fact and must have a truth value.

e.g. "It is raining", "2 + 2 = 4", "The sky is blue"

The following logic operators are similar to the ones in digital logic:

Definitions

PrecedenceDefinitionSymbolMeaningTruth table TLRF
1Negation¬p\neg pNot pp-
2Conjunctionp∧qp \land qpp and qqTFFF
3Disjunctionp∨qp \lor qpp or qqTTTF
4Exclusive orp⊕qp \oplus qpp or qq but not both (XOR)FTTF
5Implicationp→qp \rightarrow qIf pp then qqTFTT
6Bi-conditionalsp↔qp \leftrightarrow qpp if and only if qq (XNOR)TFFT

Why implication | ..T. |? The statement can still hold true even if F→TF \rightarrow T: Consider: "Bob goes to work, it's Monday." The day can still be Monday even if bob doesn't go to work.

Presedence: p→q∧r∨s≡p→((q∧r)∨s)p \rightarrow q \land r \lor s \equiv p\rightarrow ((q \land r)\lor s)

For an implication p→qp \rightarrow q:

  • Converse: q→pq \rightarrow p
  • Inverse: ¬p→¬q\neg p \rightarrow \neg q
  • Contrapositive: ¬q→¬p\neg q \rightarrow \neg p (Same truth value as the original)

Logic Equivalences

Tautology

Proposition that is always true, regardless of the truth values of the propositions it contains.

Examples
  • p∨¬pp \lor \neg p is always true
  • p→pp \rightarrow p is always true

Contradiction

Proposition that is always false.

Examples
  • p∧¬pp \land \neg p is always false

Logical Equivalence

If p↔qp \leftrightarrow q is a tautology, then pp and qq are logically equivalent, denoted as p≡qp \equiv q.

Examples
  • p∧q≡q∧pp \land q \equiv q \land p
  • p∨q≡q∨pp \lor q \equiv q \lor p

The following are the methods & laws of propositional logic:

Laws

CategoryRule
Identityp∧T≡pp \land \mathbf{T} \equiv p
p∨F≡pp \lor \mathbf{F} \equiv p
Dominationp∨T≡Tp \lor \mathbf{T} \equiv \mathbf{T}
p∧F≡Fp \land \mathbf{F} \equiv \mathbf{F}
Idempotentp∨p≡pp \lor p \equiv p
p∧p≡pp \land p \equiv p
Negationp∨¬p≡Tp \lor \neg p \equiv \mathbf{T}
p∧¬p≡Fp \land \neg p \equiv \mathbf{F}
Commutativep∨q≡q∨pp \lor q \equiv q \lor p
p∧q≡q∧pp \land q \equiv q \land p
Associative(p∨q)∨r≡p∨(q∨r)(p \lor q) \lor r \equiv p \lor (q \lor r)
(p∧q)∧r≡p∧(q∧r)(p \land q) \land r \equiv p \land (q \land r)
Double Negation¬¬p≡p\neg \neg p \equiv p
Bi-Implicationp↔q≡(p→q)∧(q→p)p \leftrightarrow q \equiv (p \rightarrow q) \land (q \rightarrow p)
Contrapositivep→q≡¬q→¬pp \rightarrow q \equiv \neg q \rightarrow \neg p
Implicationp→q≡¬p∨qp \rightarrow q \equiv \neg p \lor q
Distributivep∧(q∨r)≡(p∧q)∨(p∧r)p \land (q \lor r) \equiv (p \land q) \lor (p \land r)
p∨(q∧r)≡(p∨q)∧(p∨r)p \lor (q \land r) \equiv (p \lor q) \land (p \lor r)
De Morgan's¬(p∧q)≡¬p∨¬q\neg (p \land q) \equiv \neg p \lor \neg q
¬(p∨q)≡¬p∧¬q\neg (p \lor q) \equiv \neg p \land \neg q

Satisfiability

Satisfiability

Proposition can be made true by some sort of assignment of truth values to its variables, called the solution.

Examples
  • p∧qp \land q is satisfiable when p=T,q=Tp = T, q = T
  • p∧¬pp \land \neg p is unsatisfiable

On this page