Untitled

Artificial Intelligence

  • Knowledge-based agents: React based on stored knowledge.
  • Wumpus world: Example of a logical environment for AI.

Outline

  • Knowledge-based agents
  • Wumpus world
  • Logic in general - models, entailment
  • Propositional (Boolean) logic
  • Equivalence
  • Inference rules
    • Forward chaining
    • Backward chaining
    • Resolution

Knowledge Bases

  • Definition: A knowledge base (KB) is a formal language set of sentences.
  • Declarative approach: Specify what the agent must know, allowing self-questioning.
  • Levels of agents: Knowledge level (what they know) vs implementation level (how data is structured and algorithms).

A Simple Knowledge-Based Agent

  • Must:
    • Represent states and actions
    • Incorporate new percepts
    • Update world representation
    • Deduce hidden properties
    • Deduce appropriate actions.

The Wumpus World

  • Description: A maze with a Wumpus monster, pits, and gold.
    • Elements:
    • Stench from adjacent squares to the Wumpus
    • Breeze from adjacent pits
    • Glitter from gold visible in the same square.

Sensing and Actions

  • Sensing: Detect stench, breeze, glitter, bumps (walls).
  • Actions: Turn left/right, move forward, grab, release, shoot.

Performance Measure in Wumpus World

  • Actions yield scores:
    • Gold: +1000
    • Death: -1000
    • Step: -1
    • Arrow usage: -10

Logic in General

  • Definition: Formal languages that allow information representation and conclusion derivation.
  • Syntax: Defines sentences; Semantics: Defines truth of sentences in a model.

Propositional Logic (PL)

  • Syntax: Logical constants (True, False), atomic sentences (P, Q…), logical connectives (¬, ∧, ∨, →).
  • Semantics: Models specify truth values for variables.

Truth Table Definitions for PL Operators

  • Negation: (
    eg P ) is true iff ( P ) is false.
  • Conjunction: ( P \land Q ) is true iff both ( P ) and ( Q ) are true.
  • Disjunction: ( P \lor Q ) is true iff at least one is true.

Inference and Entailment

  • Entailment: A knowledge base (KB) entails a sentence if it is true in all models where KB is true.
  • Truth-table evaluation allows validation of statements within a model.

Inference Rules

  • Modus Ponens: From ( P \rightarrow Q ) and ( P ), infer ( Q ).
  • Resolution: Uses disjunctions to determine truth in a logical implication.

Forward and Backward Chaining

  • Forward Chaining: Data-driven approach adding conclusions based on known premises until the goal is found.
  • Backward Chaining: Goal-directed approach working backwards from the desired outcome, seeking rules that entail it.

Horn Sentences and Clauses

  • Defined as implications where certain premises lead to conclusions, allowing simpler proofs using Modus Ponens.

Exercises

  • Practice forming truth tables for sentences and proving their validity.

Resolution Refutation Example

  • Used to demonstrate contradictions in a proof, leading to the establishment of true conclusions based on prior premises.

Summary

  • Logic forms fundamentals of AI reasoning, allowing agents to derive conclusions from a KB.
  • Different methods (Forward/Backward Chaining and Resolution) enable reasoning in structured environments, demonstrating a powerful ability to model and respond to conditions through logical analysis.