🧪 Practical: Interactive Propositional Logic Demos

🎯 What You'll Do

  • Build and explore truth tables interactively
  • Evaluate propositional formulas under custom assignments
  • Practice with connectives and precedence

1. Truth Table Generator

Enter a propositional formula using variables (P, Q, R, S) and connectives. The tool will generate the complete truth table.

Syntax: Use P, Q, R, S for variables. Connectives: ¬ (NOT), ∧ (AND), ∨ (OR), → (IMPLIES), ↔ (IFF)

You can also use: ! for ¬, & for ∧, | for ∨, -> for →, <-> for ↔

Click "Generate Truth Table" to see the result.

2. Formula Evaluator

Set specific truth values for variables and evaluate a formula step by step.

Set Variable Values:

Click "Evaluate" to see the step-by-step evaluation.

3. Equivalence Checker

Enter two formulas and check if they are logically equivalent (have the same truth table).

Click "Check Equivalence" to compare the two formulas.

4. Practice Exercises

Use the tools above to solve these exercises:

Exercise 1: Truth Table Classification

Generate truth tables for each formula and classify as tautology, contradiction, or contingency:

  1. P ∨ ¬P
  2. P ∧ ¬P
  3. (P → Q) ↔ (¬Q → ¬P)
  4. P → (Q → P)
  5. (P → Q) → (¬P → ¬Q)

Exercise 2: Equivalence Verification

Use the equivalence checker to verify:

  1. ¬(P ∧ Q) ≡ ¬P ∨ ¬Q (De Morgan's)
  2. P → Q ≡ ¬P ∨ Q (Material Implication)
  3. P ↔ Q ≡ (P → Q) ∧ (Q → P)
  4. P ∨ (Q ∧ R) ≡ (P ∨ Q) ∧ (P ∨ R) (Distribution)

Exercise 3: SAT Counting

For each formula, count the number of satisfying assignments using the truth table:

  1. (P ∨ Q) ∧ (¬P ∨ R) — how many of the 8 assignments satisfy it?
  2. (P → Q) ∧ (Q → R) ∧ (R → P) — how many satisfying assignments?
  3. P ↔ Q ↔ R — how many?

5. Quick Reference: Connective Symbols

ConnectiveSymbolKeyboard ShortcutMeaning
NOT¬!Negation
AND∧&Conjunction
OR∨|Disjunction
IMPLIES→->Implication
IFF↔<->Biconditional