Encoding Problems in Propositional Logic

Context: FIT2014_MOC · turning a real-world problem into a logical formula · the clause recipes live in CNF Encoding Patterns (At Least, At Most, Exactly) Problem it solves: given an English scenario, define propositions and write a CNF formula whose satisfying assignments are exactly the valid solutions.

Quick Revision

  • 🎯 Trigger: “write a Boolean expression representing …” ➔ run the four-step pipeline: choose propositions → state constraints in English → formalise each → convert to CNF.
  • ⚡ Key Constraint: you cannot assume physical common sense — with propositions all assignments are candidates, so every “obvious” impossibility (one person in two seats) must be explicitly forbidden by a clause.

🔧 The four-step pipeline

  1. Choose propositions ➔ strip extraneous detail; index by the things that matter. Seating example: = “friend is seated in seat ” for , propositions, hence truth assignments.
  2. State constraints in English ➔ list rules that exactly characterise a valid solution:
    • (1) Each friend gets a seat.
    • (2) No friend occupies more than one seat.
    • (3) No seat is occupied by more than one friend.
  3. Formalise each rule ➔ translate one rule at a time (below).
  4. Convert to CNF ➔ push negations inward with De Morgan (Boolean Algebra Laws).

📐 Worked encoding (seating)

Rule 1 — each friend gets a seat (already a clause, hence already CNF):

Rule 2 — no friend takes two seats (forbid every pair of seats): De Morgan on each conjunct gives CNF:

Rule 3 — no seat holds two friends (same shape, over friend pairs):

  • Recognise the shapes ➔ Rule 1 is “at least one”; Rules 2–3 are “at most one” (pairwise negated clauses) — exactly the templates in CNF Encoding Patterns (At Least, At Most, Exactly).
  • Why CNF ➔ a uniform encoding makes problems comparable and machine-checkable; this is the standard input shape used later in complexity theory and SAT.

🔀 Translating common English forms

EnglishFormulaCNF form
at least one of already CNF
only if
none or both of
no more than one of pairwise not-both

✍️ Practice

⚠️ Common Mistakes

  • 💡 Nothing is implied by physics (Alice in two seats) is a perfectly legal truth assignment unless a clause forbids it; enumerate the impossibilities.
  • 💡 and are not CNF ➔ a formula containing them is not yet in CNF; rewrite as and .
  • 💡 “No more than one” one negated clause merely forbids all three together; the correct encoding is pairwise.
  • 💡 Encoding is not unique ➔ many equivalent encodings exist; aim for one that follows directly from the English rules, which is easier to check and less error-prone.

🧠 Active Recall