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-
2Conjunctionpqp \land qpp and qqTFFF
3Disjunctionpqp \lor qpp or qqTTTF
4Exclusive orpqp \oplus qpp or qq but not both (XOR)FTTF
5Implicationpqp \rightarrow qIf pp then qqTFTT
6Bi-conditionalspqp \leftrightarrow qpp if and only if qq (XNOR)TFFT

Why implication | ..T. |? The statement can still hold true even if FTF \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: pqrsp((qr)s)p \rightarrow q \land r \lor s \equiv p\rightarrow ((q \land r)\lor s)

For an implication pqp \rightarrow q:

  • Converse: qpq \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
  • ppp \rightarrow p is always true

Contradiction

Proposition that is always false.

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

Logical Equivalence

If pqp \leftrightarrow q is a tautology, then pp and qq are logically equivalent, denoted as pqp \equiv q.

Examples
  • pqqpp \land q \equiv q \land p
  • pqqpp \lor q \equiv q \lor p

The following are the methods & laws of propositional logic:

Laws

CategoryRule
IdentitypTpp \land \mathbf{T} \equiv p
pFpp \lor \mathbf{F} \equiv p
DominationpTTp \lor \mathbf{T} \equiv \mathbf{T}
pFFp \land \mathbf{F} \equiv \mathbf{F}
Idempotentpppp \lor p \equiv p
pppp \land p \equiv p
Negationp¬pTp \lor \neg p \equiv \mathbf{T}
p¬pFp \land \neg p \equiv \mathbf{F}
Commutativepqqpp \lor q \equiv q \lor p
pqqpp \land q \equiv q \land p
Associative(pq)rp(qr)(p \lor q) \lor r \equiv p \lor (q \lor r)
(pq)rp(qr)(p \land q) \land r \equiv p \land (q \land r)
Double Negation¬¬pp\neg \neg p \equiv p
Bi-Implicationpq(pq)(qp)p \leftrightarrow q \equiv (p \rightarrow q) \land (q \rightarrow p)
Contrapositivepq¬q¬pp \rightarrow q \equiv \neg q \rightarrow \neg p
Implicationpq¬pqp \rightarrow q \equiv \neg p \lor q
Distributivep(qr)(pq)(pr)p \land (q \lor r) \equiv (p \land q) \lor (p \land r)
p(qr)(pq)(pr)p \lor (q \land r) \equiv (p \lor q) \land (p \lor r)
De Morgan's¬(pq)¬p¬q\neg (p \land q) \equiv \neg p \lor \neg q
¬(pq)¬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
  • pqp \land q is satisfiable when p=T,q=Tp = T, q = T
  • p¬pp \land \neg p is unsatisfiable

On this page