The simplest formal logic β and where its limits become visible.
π Where this lives: propositional logic is what a SAT solver reasons in, and SAT solvers are everywhere: your package manager resolving dependency versions, hardware verification proving a circuit correct, program analysers finding unreachable code. The formalism is deliberately weak, and that weakness is what makes it decidable and therefore automatable at enormous scale β millions of variables in practice. Search "SAT solver dependency resolution hardware verification".
Syntax and semantics
PROPOSITIONAL LOGIC deals with PROPOSITIONS β statements that are
either TRUE or FALSE, with no internal structure visible to the
logic.
SYNTAX β what counts as a sentence:
ATOMIC SENTENCES a single PROPOSITION SYMBOL: P, Q, R,
Wβ,β, and the fixed symbols True and
False
COMPLEX SENTENCES built with the five LOGICAL CONNECTIVES:
Β¬ NOT negation Β¬P
β§ AND conjunction P β§ Q
β¨ OR disjunction P β¨ Q
β IMPLIES implication P β Q
β IFF biconditional P β Q
PRECEDENCE, highest to lowest: Β¬, β§, β¨, β, β
So Β¬P β¨ Q β§ R β S reads ((Β¬P) β¨ (Q β§ R)) β S.
SEMANTICS β what a sentence means:
A MODEL is an assignment of true or false to EVERY
proposition symbol. With n symbols there are 2^n models.
The TRUTH VALUE of a complex sentence in a model is computed
from its parts by the truth tables:
P Q β Β¬P β Pβ§Q β Pβ¨Q β PβQ β PβQ
ββββββββββΌβββββΌββββββΌββββββΌββββββΌβββββ
T T β F β T β T β T β T
T F β F β F β T β F β F
F T β T β F β T β T β F
F F β T β F β F β T β T
THE IMPLICATION ROW THAT CONFUSES EVERYONE: P β Q is TRUE
whenever P is FALSE, regardless of Q. "If 2+2=5 then the moon is
cheese" is TRUE in propositional logic.
WHY: P β Q is equivalent to Β¬P β¨ Q. It is a claim about
truth values, NOT about causation. It says "it is not the case
that P holds and Q fails" β and if P never holds, the claim is
trivially satisfied. This is called a VACUOUS TRUTH, and
forgetting it is the commonest source of confusion in
exercises.
KEY DEFINITIONS β these must be precise:
SATISFIABLE true in at least one model
UNSATISFIABLE true in no model β a CONTRADICTION
e.g. P β§ Β¬P
VALID true in EVERY model β a TAUTOLOGY
e.g. P β¨ Β¬P
ENTAILMENT Ξ± β¨ Ξ² means: in every model where Ξ± is true,
Ξ² is also true. "Ξ² follows from Ξ±."
EQUIVALENCE Ξ± β‘ Ξ² means Ξ± β¨ Ξ² and Ξ² β¨ Ξ±
THE DEDUCTION THEOREM links them:
Ξ± β¨ Ξ² if and only if (Ξ± β Ξ²) is VALID
AND THE REFUTATION FORM, which is what proof procedures use:
α ⨠β if and only if (α ⧠¬β) is UNSATISFIABLE
THIS SECOND FORM IS THE BASIS OF RESOLUTION: to prove
something, assume its negation and derive a contradiction.
MODEL CHECKING β the brute-force method: enumerate all 2^n
models and check. Sound and complete, and hopeless beyond small
n:
3 symbols β 8 rows
10 symbols β 1,024
20 symbols β 1,048,576
30 symbols β 1,073,741,824
PROPOSITIONAL SATISFIABILITY IS NP-COMPLETE β it was the FIRST
problem proved so (Cook, 1971) β so no algorithm is known that
avoids exponential worst-case behaviour.
Inference rules and equivalences
THE STANDARD INFERENCE RULES. Each is sound: if the premises are
true, the conclusion must be.
MODUS PONENS Ξ± β Ξ², Ξ±
ββββββββββ
Ξ²
MODUS TOLLENS Ξ± β Ξ², ¬β
βββββββββββ
¬α
AND-ELIMINATION Ξ± β§ Ξ²
βββββ
Ξ±
AND-INTRODUCTION Ξ±, Ξ²
βββββ
Ξ± β§ Ξ²
OR-INTRODUCTION Ξ±
βββββ
Ξ± β¨ Ξ²
UNIT RESOLUTION α ⨠β, ¬β
βββββββββββ
Ξ±
RESOLUTION α ⨠β, ¬β ⨠γ
βββββββββββββββ
Ξ± β¨ Ξ³
HYPOTHETICAL SYLLOGISM Ξ± β Ξ², Ξ² β Ξ³
βββββββββββββββ
Ξ± β Ξ³
TWO FALLACIES that look like rules and are not β knowing these
is worth marks:
AFFIRMING THE CONSEQUENT from Ξ± β Ξ² and Ξ², concluding Ξ±.
INVALID. Counterexample: Ξ± false, Ξ² true satisfies both
premises and falsifies the conclusion.
"If it rains the ground is wet; the ground is wet;
therefore it rained" β the sprinkler was on.
DENYING THE ANTECEDENT from Ξ± β Ξ² and ¬α, concluding ¬β.
INVALID, by the same model.
THE LOGICAL EQUIVALENCES β needed for converting to normal form:
DE MORGAN ¬(α ⧠β) ①¬α ⨠¬β
¬(α ⨠β) ①¬α ⧠¬β
IMPLICATION Ξ± β Ξ² ①¬α β¨ Ξ²
ELIMINATION
CONTRAPOSITION Ξ± β Ξ² ①¬β β ¬α
BICONDITIONAL Ξ± β Ξ² β‘ (Ξ± β Ξ²) β§ (Ξ² β Ξ±)
ELIMINATION
DOUBLE NEGATION ¬¬α ①α
DISTRIBUTIVITY Ξ± β§ (Ξ² β¨ Ξ³) β‘ (Ξ± β§ Ξ²) β¨ (Ξ± β§ Ξ³)
Ξ± β¨ (Ξ² β§ Ξ³) β‘ (Ξ± β¨ Ξ²) β§ (Ξ± β¨ Ξ³)
COMMUTATIVITY, as expected for β§ and β¨
ASSOCIATIVITY
CONVERTING TO CONJUNCTIVE NORMAL FORM (CNF) β a conjunction of
clauses, each clause a disjunction of literals. Required by
resolution. THE PROCEDURE, in order:
1. eliminate β using biconditional elimination
2. eliminate β using Ξ± β Ξ² ①¬α β¨ Ξ²
3. move Β¬ inwards using De Morgan and double negation, so
negations apply only to atoms
4. distribute β¨ over β§
5. flatten nested β§ and β¨
WORKED CNF CONVERSION of (P β¨ Q) β R:
step 2: Β¬(P β¨ Q) β¨ R
step 3: (Β¬P β§ Β¬Q) β¨ R De Morgan
step 4: (Β¬P β¨ R) β§ (Β¬Q β¨ R) distribute
RESULT: two clauses, {Β¬P, R} and {Β¬Q, R}.
Note that CNF conversion can cause EXPONENTIAL GROWTH in the
worst case from step 4 β which is why practical tools use the
Tseitin transformation, introducing new variables to keep the
result linear in size.
RESOLUTION β the single complete inference rule for PL:
from (ββ β¨ β¦ β¨ ββ) and (mβ β¨ β¦ β¨ mβ)
where βα΅’ and mβ±Ό are COMPLEMENTARY literals,
infer the disjunction of all the remaining literals.
RESOLUTION IS REFUTATION-COMPLETE: it can always derive a
contradiction from an unsatisfiable set of clauses. So to prove
KB β¨ Ξ±:
1. convert KB ⧠¬α to CNF
2. apply resolution repeatedly
3. if the EMPTY CLAUSE is derived, KB β¨ Ξ±
4. if no new clauses can be derived and no empty clause
appeared, KB β Ξ±
A WORKED PROOF. KB: (1) P β Q (2) Q β R (3) P.
Prove R.
CNF of KB: {Β¬P, Q}, {Β¬Q, R}, {P}
negate the goal: {Β¬R}
resolve {Β¬P, Q} with {P} β {Q}
resolve {Q} with {Β¬Q, R} β {R}
resolve {R} with {Β¬R} β { } the EMPTY CLAUSE
CONTRADICTION FOUND, therefore KB β¨ R. β
THE EMPTY CLAUSE IS THE POINT: a clause is a disjunction, and a
disjunction of nothing is false. Deriving it means the assumed
premises cannot all hold.
HORN CLAUSES β the restricted case that is efficient:
A HORN CLAUSE has AT MOST ONE POSITIVE LITERAL. A DEFINITE
clause has exactly one. Written as implications, definite
clauses look like
Pβ β§ Pβ β§ β¦ β§ Pβ β Q
which is the natural form of a rule.
WHY IT MATTERS: inference with Horn clauses is decidable in
TIME LINEAR IN THE SIZE OF THE KNOWLEDGE BASE, using
FORWARD CHAINING or BACKWARD CHAINING. That is the
difference between intractable and cheap, and it is why
Prolog and every rule-based expert system are built on Horn
clauses.
Forward and backward chaining, and the limits of PL
TWO DIRECTIONS OF REASONING with definite clauses:
FORWARD CHAINING β DATA-DRIVEN
Start from the known facts. Whenever all the premises of a
rule are satisfied, add its conclusion. Repeat until the
query appears or nothing more can be added.
β derives everything derivable, so it answers many queries
at once
β may derive a great deal that is irrelevant to the query
BACKWARD CHAINING β GOAL-DRIVEN
Start from the query. Find rules concluding it, and try to
prove their premises, recursively.
β touches only what is relevant to the query
β this is how Prolog works
β may re-derive the same subgoal repeatedly without
memoisation, and can loop on recursive rules
WORKED, on a small rule base:
R1: A β§ B β C
R2: C β§ D β E
R3: A β D
FACTS: A, B. QUERY: E?
FORWARD: A, B known β R1 fires β add C
A known β R3 fires β add D
C, D known β R2 fires β add E. β
derived C, D, E β three new facts, all needed here
BACKWARD: goal E β R2 needs C and D
goal C β R1 needs A and B β both known β
goal D β R3 needs A β known β
therefore E. β
the SAME work here, because everything was
relevant. In a knowledge base with 500 rules where
only 3 matter, forward chaining would fire
hundreds of irrelevant rules and backward chaining
would touch 3.
THE LIMITATIONS OF PROPOSITIONAL LOGIC β the reason first-order
logic exists:
1. NO STRUCTURE INSIDE A PROPOSITION. "Socrates is a man" is a
single symbol with no visible parts, so the logic cannot see
that it is about Socrates or about men.
2. NO QUANTIFICATION, and this is the decisive failure.
"All men are mortal" cannot be stated. It must be expanded
into one sentence per man:
Man(Socrates) β Mortal(Socrates)
Man(Plato) β Mortal(Plato)
β¦
WITH n INDIVIDUALS AND m PREDICATES, a single quantified
statement needs up to n SEPARATE SENTENCES, and a statement
about pairs needs nΒ². For 1,000 individuals, "everyone loves
someone" would need 1,000,000 propositions to express what
first-order logic says in eight symbols.
AND IF THE DOMAIN IS INFINITE OR UNKNOWN, no finite expansion
exists at all.
3. NO WAY TO REFER TO OBJECTS, so no functions and no equality.
"The father of John" has no expression.
4. NO GENERALISATION. Learning that one bird flies tells the
logic nothing about other birds, because there is no
connection between the symbols.
WHAT PL KEEPS, and it is not nothing:
Β· DECIDABLE β satisfiability is always determinable, though
NP-complete
Β· a COMPLETE and practical proof procedure (resolution,
DPLL, CDCL)
Β· genuinely enormous practical scale in SAT solvers
FIRST-ORDER LOGIC BUYS EXPRESSIVENESS AND PAYS WITH
DECIDABILITY: FOL is only SEMI-decidable β if a sentence is
entailed, a proof procedure will find it eventually, but if it
is not, the procedure may never terminate. THAT IS THE
EXPRESSIVENESS/TRACTABILITY TRADE-OFF ONCE MORE, in its
sharpest form.
The refutation identity is the one to carry into every proof question: α ⨠β if and only if α ⧠¬β is unsatisfiable. It converts "show this follows" into "assume the opposite and find a contradiction", which is what resolution mechanises and why the empty clause is the goal.
π Go further: the practical descendant of resolution is DPLL with conflict-driven clause learning, and its central trick is worth knowing. When the search hits a contradiction, the solver analyses why, derives a new clause forbidding that combination, and adds it to the knowledge base β so the same dead end is never re-entered anywhere in the search. That single idea took SAT from a textbook curiosity to a tool handling millions of variables, and it is why your package manager can resolve dependency constraints that are formally NP-complete in milliseconds. Search "DPLL conflict driven clause learning SAT".
π‘ Exam angle: give the syntax and the five connectives with their precedence, and reproduce the truth tables β the implication rows are the ones examiners probe, so be ready to explain why P β Q is true when P is false. Define satisfiable, unsatisfiable, valid, entailment and equivalence, and state the refutation identity. Know the inference rules (modus ponens, modus tollens, resolution, and-elimination) and the two fallacies with counterexamples. Be ready to convert a sentence to CNF step by step and to complete a resolution proof ending in the empty clause. State the limitations of PL β no internal structure, no quantification β and that Horn clauses give linear-time inference.
Syllabus points
Syntax, semantics, connectives
Tautology, validity, well-formed formula
Inference using resolution (numerical)
Create a free account to tick topics off, take notes as you read, watch the video lessons and get a day-by-day study plan built around your exam date.