Logical Modelling

Context: FIT1058_MOC · encoding real rule sets as a CNF expression · top-level conjunction of conditions · includes counting “how many are true”

Quick Revision

  • 🎯 Objective: turn a set of rules into one Boolean expression ➔ rules hold together ⟹ top-level conjunction ⟹ CNF.
  • 📦 Core Components: one Boolean variable per fact ➔ translate each rule ➔ AND them.
  • ⚡ Key Constraint: counting constraints (at most/least/exactly ) expand to -many clauses.

📝 Core

1. The Model (Conjunction of Conditions)

  • Encode ➔ rules → a single Boolean expression over chosen variables.
  • Together ➔ all rules must hold ⟹ top level is CNF.
  • Translate, don’t solve ➔ modelling builds the constraint; finding an assignment is the separate satisfiability problem.

2. Rule Translation

  • “at least one”
  • “only if”.
  • “none or both”.

3. Counting Constraints (in CNF)

  • At most ➔ every -subset has a False one ➔ AND of (OR of negations).
  • At least ➔ every -subset has a True one ➔ AND of (OR of plain literals).
  • Exactly ➔ (at least ) (at most ).

Key identities:

⚖️ Core Decision Matrix

RuleLogical formCNF
at least one of
only if
none or both
at most one of pairwise not-both

When It Flips: the outermost operator is always — you cannot ignore inconvenient rules. Cardinality constraints use [[Binomial Coefficient|]]-many clauses, so encodings can grow quickly.

📊 Exam Execution Trace

Manual Execution Trace

Encoding three rules:

Step / StateRuleCNF clause(s)
0 (Init)
1at least one of
2 only if
3at most one of

⚠️ Common Mistakes

  • 💡 “At most one” = forbid every pair ➔ a “not both” clause for each pair; AND-ing all parts gives the single CNF.

🧠 Active Recall