Introduction to Propositional Logic

Ergodic Theorem Prelude

  • An individual variable xix_i can be expressed as a summation over state values jj multiplied by an indicator function:

xi=∑jj⋅I(xi=j)x_i = \sum_j j \cdot \mathbb{I}(x_i = j)

  • By swapping the order of summation and applying the Ergodic Theorem, the long-run proportion of time spent in state jj corresponds to the stationary distribution probability πj\pi_j.

  • When in state jj, the system yields a score of jj, making the long-run expected score equivalent to ∑jj⋅πj\sum_j j \cdot \pi_j

Exam Logistics & Scope

  • Exam Day: Thursday.

  • Covered Scope: Search algorithms and knowledge representation, specifically up to Alpha-Beta Pruning and Symbolic Representation.

  • Excluded Content: Material taught on agent search algorithms introduced in the immediate prior lecture will not be covered on the test.

  • Topic Progression: Propositional Logic is split into two lectures:

    • Lecture 1: Basic fundamentals, including atomic propositions, truth tables, connectives, operator precedence, and material implication.

    • Lecture 2: Advanced reasoning, inference mechanisms, and logical operations built upon basic representations.

Symbolic Representation & Atomic Propositions

  • Knowledge Representation Goal: Enable an autonomous agent to build an internal model of its environment, reason under uncertainty, deduce unknown states, and construct valid plans toward goals without infinite physical trial-and-error.

  • Transition from Natural Language to Symbols: Natural language descriptions (e.g., "there is a breeze here, so an adjacent cell contains a pit") are intuitive for humans but unsuitable for computational algorithms. Automated inference requires exact symbolic representations.

  • Grid World Environment (4×44 \times 4 Matrix):

    • Cells are referenced by Cartesian coordinates (i,j)(i, j), where i∈{1,2,3,4}i \in \{1, 2, 3, 4\} and j∈{1,2,3,4}j \in \{1, 2, 3, 4\}.

    • Atomic Propositions: Indivisible propositions evaluating strictly to true (True\text{True}) or false (False\text{False}).

      • AijA_{ij}: The agent is present at cell (i,j)(i, j).

      • BijB_{ij}: Cell (i,j)(i, j) contains a breeze.

      • PijP_{ij}: Cell (i,j)(i, j) contains a pit.

      • WijW_{ij}: Cell (i,j)(i, j) contains a Wumpus.

      • GijG_{ij}: Cell (i,j)(i, j) contains gold.

  • Concrete Grid World Examples:

    • P13P_{13} asserts that cell (1,3)(1, 3) contains a pit.

    • ¬W22\neg W_{22} asserts that cell (2,2)(2, 2) does not contain a Wumpus.

    • P22∨P13P_{22} \lor P_{13} asserts that either cell (2,2)(2, 2) contains a pit or cell (1,3)(1, 3) contains a pit (or both).

    • If an agent starts at (1,1)(1, 1), then A11=TrueA_{11} = \text{True} while A21=FalseA_{21} = \text{False}.

    • If cell (2,1)(2, 1) senses a breeze while cell (1,1)(1, 1) does not, then B21=TrueB_{21} = \text{True} and B11=FalseB_{11} = \text{False}.

Logical Connectives & Operator Precedence

  • Logical Connectives: Operations used to compose complex propositions from atomic propositions.

    • Negation (¬\neg): Reverses the truth value of a proposition.

    • Conjunction (∧\land / AND): Evaluates to true if and only if both conjuncts are true.

    • Disjunction (∨\lor / OR): Evaluates to true if at least one disjunct is true.

    • Implication (→\rightarrow / IF-THEN): Represents conditional rules (A→BA \rightarrow B).

    • Biconditional / Equivalence (↔\leftrightarrow / IF AND ONLY IF): Evaluates to true if both propositions share the exact same truth value.

  • Precedence Hierarchy (Order of Operations):

    • To evaluate complex expressions without ambiguity, connectives follow a strict order of precedence (similar to algebraic order of operations):

      1. Negation (¬\neg) (Highest priority)

      2. Conjunction (∧\land)

      3. Disjunction (∨\lor)

      4. Implication (→\rightarrow)

      5. Biconditional (↔\leftrightarrow) (Lowest priority)

    • Conjunction (∧\land) has strict priority over disjunction (∨\lor).

    • Disjunction (∨\lor) has strict priority over implication (→\rightarrow).

    • Explicit parentheses/brackets should be added to prevent evaluation errors during manual calculations.

Natural Language Translation Exercises

  • Exercise 1: "Cell (1,1) is safe and the agent has visited it."

    • Atomic Propositions: Let OK11OK_{11} denote that cell (1,1)(1,1) is safe; let V11V_{11} denote that cell (1,1)(1,1) has been visited.

    • Composite Symbolization: OK11∧V11OK_{11} \land V_{11}

  • Exercise 2: "If cell (2,1) has a breeze, then cell (1,1) or cell (3,1) or cell (2,2) has a pit."

    • Atomic Propositions: B21B_{21} (breeze at (2,1)(2,1)), P11P_{11} (pit at (1,1)(1,1)), P31P_{31} (pit at (3,1)(3,1)), P22P_{22} (pit at (2,2)(2,2)).

    • Composite Symbolization: B21→(P11∨P31∨P22)B_{21} \rightarrow (P_{11} \lor P_{31} \lor P_{22})

    • Structural Note: Parentheses enclose the entire right-hand disjunction because disjunction takes precedence over implication, ensuring the antecedent B21B_{21} implies the unified collection of possibilities.

  • Exercise 3: "There is no gold anywhere in the bottom row."

    • Bottom Row Coordinates: (1,1)(1,1), (2,1)(2,1), (3,1)(3,1), (4,1)(4,1).

    • Atomic Propositions: G11G_{11}, G21G_{21}, G31G_{31}, G41G_{41}.

    • Composite Symbolization: ¬G11∧¬G21∧¬G31∧¬G41\neg G_{11} \land \neg G_{21} \land \neg G_{31} \land \neg G_{41}

    • Logical Reason: Conjunction (∧\land) must be used across all negated atomic propositions to guarantee that every single cell in the bottom row is individually verified to contain no gold.

Semantics & Interpretation Functions

  • Syntax vs. Semantics:

    • Syntax: The formal structure and grammar used to construct well-formed formulas/propositions.

    • Semantics: The meaning that propositions express about the state of the world.

  • Interpretation Function (π\pi):

    • A symbolic proposition has no intrinsic truth value on its own; it represents a variable set of possibilities.

    • An interpretation function π\pi maps atomic propositions directly to concrete boolean values (True\text{True} or False\text{False}).

  • Vacuum World Model Example:

    • Let PP represent "Room A is clean" and QQ represent "Room B is clean".

    • If π(P)=False\pi(P) = \text{False} and π(Q)=False\pi(Q) = \text{False}, both Room A and Room B are dirty.

    • If π(P)=False\pi(P) = \text{False} and π(Q)=True\pi(Q) = \text{True}, Room A is dirty and Room B is clean.

  • Combinatorial Growth of Possible Worlds:

    • For nn atomic propositions, there are 2n2^n possible distinct worlds (models).

    • With 2 propositions (P,QP, Q), there are 22=42^2 = 4 possible worlds.

    • If a 3rd proposition RR ("Agent is in Room A") is added, there are 23=82^3 = 8 possible worlds.

    • Strict Inference Warning: If R=FalseR = \text{False} (Agent is not in Room A), one cannot formally infer that the agent is in Room B unless an explicit structural constraint rule is formally added asserting that the agent must reside in either Room A or Room B.

Truth Tables & Logical Operators

  • Truth Table Functionality: An exhaustive enumeration of every possible truth value combination for constituent atomic variables and their complex expressions.

  • Master Truth Table for Standard Binary Connectives:

AA

BB

¬A\neg A

A∧BA \land B

A∨BA \lor B

A→BA \rightarrow B

A↔BA \leftrightarrow B

True\text{True}

True\text{True}

False\text{False}

True\text{True}

True\text{True}

True\text{True}

True\text{True}

True\text{True}

False\text{False}

False\text{False}

False\text{False}

True\text{True}

False\text{False}

False\text{False}

False\text{False}

True\text{True}

True\text{True}

False\text{False}

True\text{True}

True\text{True}

False\text{False}

False\text{False}

False\text{False}

True\text{True}

False\text{False}

False\text{False}

True\text{True}

True\text{True}

Implication, Vacuous Truth, & World Elimination

  • Deep Dive into Material Implication (A→BA \rightarrow B):

    • Example statement: "If it is sunny (AA), I will go sailing (BB").

    • Case 1 (A=True,B=TrueA=\text{True}, B=\text{True}): It is sunny, and I go sailing. The rule holds (True\text{True}).

    • Case 2 (A=True,B=FalseA=\text{True}, B=\text{False}): It is sunny, but I do not go sailing. The rule is broken (False\text{False}).

    • Case 3 (A=False,B=TrueA=\text{False}, B=\text{True}): It is not sunny, but I go sailing anyway. The original statement made no promise regarding non-sunny days; the rule is not violated (True\text{True}).

    • Case 4 (A=False,B=FalseA=\text{False}, B=\text{False}): It is not sunny, and I do not go sailing. The rule is not violated (True\text{True}).

    • Vacuous Truth Principle: Whenever the antecedent AA is false, the implication A→BA \rightarrow B automatically evaluates to True\text{True}, regardless of the truth value of the consequent BB

  • Information and World Elimination:

    • An agent begins with 2n2^n candidate worlds representing complete uncertainty.

    • Determining the precise truth value of an atomic proposition (e.g., establishing that B11=TrueB_{11} = \text{True}) instantly eliminates all candidate worlds where B11=FalseB_{11} = \text{False}.

    • Each concrete observation reduces the remaining world space by half (2n−12^{n-1}), narrowing down candidate models until valid plans can be executed.

Logical Implication vs. Material Implication

  • Material Implication (→\rightarrow):

    • A logical connective inside a formula used to construct a complex proposition (A→BA \rightarrow B).

    • Evaluates directly to a truth value (True\text{True} or False\text{False}) within a single world/model.

  • Logical Implication (⊨\models):

    • A semantic meta-relation between two propositions.

    • A⊨BA \models B ("AA logically implies BB") means that in every model/world where proposition AA is True\text{True}, proposition BB is strictly guaranteed to be True\text{True}.

  • Logical Equivalence (≡\equiv):

    • Two propositions AA and BB are logically equivalent (A≡BA \equiv B) if and only if A⊨BA \models B and B⊨AB \models A

    • Logically equivalent propositions produce identical outputs in every corresponding row of their truth tables.

Fundamental Logical Equivalences

  • Double Negation Elimination:

¬(¬A)≡A\neg(\neg A) \equiv A

  • Implication Elimination:

A→B≡¬A∨BA \rightarrow B \equiv \neg A \lor B

  • Contraposition:

A→B≡¬B→¬AA \rightarrow B \equiv \neg B \rightarrow \neg A

  • De Morgan's Laws:

¬(A∧B)≡¬A∨¬B\neg(A \land B) \equiv \neg A \lor \neg B

¬(A∨B)≡¬A∧¬B\neg(A \lor B) \equiv \neg A \land \neg B

  • Distributive Laws:

A∧(B∨C)≡(A∧B)∨(A∧C)A \land (B \lor C) \equiv (A \land B) \lor (A \land C)

A∨(B∧C)≡(A∨B)∧(A∨C)A \lor (B \land C) \equiv (A \lor B) \land (A \lor C)

  • Commutative Laws:

A∧B≡B∧AA \land B \equiv B \land A

A∨B≡B∨AA \lor B \equiv B \lor A

  • Associative Laws:

(A∧B)∧C≡A∧(B∧C)(A \land B) \land C \equiv A \land (B \land C)

(A∨B)∨C≡A∨(B∨C)(A \lor B) \lor C \equiv A \lor (B \lor C)