CS451CS551EE565 ARTIFICIAL INTELLIGENCE - PowerPoint PPT Presentation

1 / 25
About This Presentation
Title:

CS451CS551EE565 ARTIFICIAL INTELLIGENCE

Description:

... based agents in the wumpus world. A wumpus-world agent using propositional ... Wumpus world requires the ability to represent partial and negated information, ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 26
Provided by: janicets
Category:

less

Transcript and Presenter's Notes

Title: CS451CS551EE565 ARTIFICIAL INTELLIGENCE


1
CS451/CS551/EE565ARTIFICIAL INTELLIGENCE
  • First Order Logic
  • 10-11-2006
  • Prof. Janice T. Searleman
  • jets_at_clarkson.edu, jetsza

2
Outline
  • Knowledge-Based Agents
  • - Propositional (Boolean) logic
  • - Equivalence, validity, satisfiability
  • - Inference rules and theorem proving
  • First order logic
  • Reading Assignment AIMA
  • Chapters 7, 8 9 (FOL inference)
  • HW4 due today
  • Exam1 Wednesday, 10/18, 700 pm, SC356

3
Logical equivalence
  • Two sentences are logically equivalent iff true
    in same models a ß iff a ß and ß a

4
Validity and satisfiability
  • A sentence is valid if it is true in all models,
  • e.g., True, A ??A, A ? A, (A ? (A ? B)) ? B
  • Validity is connected to inference via the
    Deduction Theorem
  • KB a if and only if (KB ? a) is valid
  • A sentence is satisfiable if it is true in some
    model
  • e.g., A? B, C
  • A sentence is unsatisfiable if it is true in no
    models
  • e.g., A??A
  • Satisfiability is connected to inference via the
    following
  • KB a if and only if (KB ??a) is unsatisfiable

5
Proof methods
  • Proof methods divide into (roughly) two kinds
  • Application of inference rules
  • Legitimate (sound) generation of new sentences
    from old
  • Proof a sequence of inference rule
    applications Can use inference rules as
    operators in a standard search algorithm
  • Typically require transformation of sentences
    into a normal form
  • Model checking
  • truth table enumeration (always exponential in n)
  • improved backtracking, e.g., Davis--Putnam-Logeman
    n-Loveland (DPLL)
  • heuristic search in model space (sound but
    incomplete)
  • e.g., min-conflicts-like hill-climbing
    algorithms

6
Forward and backward chaining
  • Horn Form (restricted)
  • KB conjunction of Horn clauses
  • Horn clause
  • proposition symbol or
  • (conjunction of symbols) ? symbol
  • e.g., (C ? B ? A) ? (C ? D ? B)
  • Modus Ponens (for Horn Form) complete for Horn
    KBs
  • a1, ,an, a1 ? ? an ? ß
  • ß
  • Can be used with forward chaining or backward
    chaining.
  • These algorithms are very natural and run in
    linear time

7
Forward chaining
  • Idea fire any rule whose premises are satisfied
    in the KB add its conclusion to the KB repeat
    until query is found

8
Forward chaining algorithm
  • Forward chaining is sound and complete for Horn KB

9
Proof of completeness
  • FC derives every atomic sentence that is entailed
    by KB
  • FC reaches a fixed point where no new atomic
    sentences are derived
  • Consider the final state as a model m, assigning
    true/false to symbols
  • Every clause in the original KB is true in m
  • a1 ? ? ak ? b
  • Hence m is a model of KB
  • If KB q, q is true in every model of KB,
    including m

10
Backward chaining
  • Idea work backwards from the query q
  • to prove q by BC,
  • check if q is known already, or
  • prove by BC all premises of some rule concluding
    q
  • Avoid loops check if new subgoal is already on
    the goal stack
  • Avoid repeated work check if new subgoal
  • has already been proved true, or
  • has already failed

11
Forward vs. backward chaining
  • FC is data-driven, automatic, unconscious
    processing,
  • e.g. object recognition, routine decisions
  • May do lots of work that is irrelevant to the
    goal
  • BC is goal-driven, appropriate for
    problem-solving,
  • e.g., Where are my keys? How do I get into a PhD
    program?
  • Complexity of BC can be much less than linear in
    size of KB

12
Inference-based agents in the wumpus world
  • A wumpus-world agent using propositional logic
  • ?P1,1
  • ?W1,1
  • Bx,y ? (Px,y1 ? Px,y-1 ? Px1,y ? Px-1,y)
  • Sx,y ? (Wx,y1 ? Wx,y-1 ? Wx1,y ? Wx-1,y)
  • W1,1 ? W1,2 ? ? W4,4
  • ?W1,1 ? ?W1,2
  • ?W1,1 ? ?W1,3
  • ? 64 distinct proposition symbols, 155 sentences

13
(No Transcript)
14
Pros and cons of propositional logic
  • ? Propositional logic is declarative
  • ? Propositional logic allows partial/disjunctive/n
    egated information
  • (unlike most data structures and databases)
  • Propositional logic is compositional
  • meaning of B1,1 ? P1,2 is derived from meaning of
    B1,1 and of P1,2
  • ? Meaning in propositional logic is
    context-independent
  • (unlike natural language, where meaning depends
    on context)
  • ? Propositional logic has very limited expressive
    power
  • (unlike natural language)
  • e.g., cannot say "pits cause breezes in adjacent
    squares except by writing one sentence for each
    square

15
Summary
  • Logical agents apply inference to a knowledge
    base to derive new information and make decisions
  • Basic concepts of logic
  • syntax formal structure of sentence
  • semantics truth of sentences wrt models
  • entailment necessary truth of one sentence given
    another
  • inference deriving sentences from other
    sentences
  • soundness derivations produce only entailed
    sentences
  • completeness derivations can produce all
    entailed sentences

16
Summary (cont.)
  • Wumpus world requires the ability to represent
    partial and negated information, reason by cases,
    etc.
  • Resolution is complete for propositional
    logicForward, backward chaining are linear-time,
    complete for Horn clauses
  • Propositional logic lacks expressive power

17
Expressiveness
  • Consider expressing the idea Johns father is a
    diplomat.
  • Propositional logic symbol JFIAD represents
    this (either is true or false)
  • problem cant reason about any of the parts
  • e.g. fatherhood, being a diplomat, John, etc.
  • solution First Order Logic (aka the Predicate
    Calculus)

18
First Order Logic
  • Prof. Janice T. Searleman
  • jets_at_clarkson.edu

19
First-order logic
  • Whereas propositional logic assumes the world
    contains facts,
  • first-order logic (like natural language) assumes
    the world contains
  • Objects people, houses, numbers, colors,
    baseball games, wars,
  • Relations red, round, prime, brother of, bigger
    than, part of, comes between,
  • Functions father of, best friend, one more than,
    plus,

20
Expressiveness
  • Johns father is a diplomat.
  • Propositional logic symbol JFIAD represents
    this (either is true or false)
  • First Order Logic diplomat(father-of(John)).
  • variable X refers to an element of the domain
  • predicate diplomat(X) means X is a diplomat
  • function father-of(X) returns the person who is
    Xs father
  • constant the symbol John refers to a particular
    person named John in the domain

21
Syntax of FOL Basic elements
  • Constants KingJohn, 2, NUS,...
  • Predicates Brother, gt,...
  • Functions Sqrt, LeftLegOf,...
  • Variables x, y, a, b,...
  • Connectives ?, ?, ?, ?, ?
  • Equality
  • Quantifiers ?, ?

22
Atomic sentences
  • Atomic sentence predicate (term1,...,termn)
    or term1 term2
  • Term function (term1,...,termn)
    or constant or variable
  • e.g. Brother(KingJohn,RichardTheLionheart) gt
    (Length(LeftLegOf(Richard)), Length(LeftLegOf(King
    John)))

23
Complex sentences
  • Complex sentences are made from atomic sentences
    using connectives
  • ?S, S1 ? S2, S1 ? S2, S1 ? S2, S1 ? S2,
  • E.g. Sibling(KingJohn,Richard) ?
    Sibling(Richard,KingJohn)
  • gt(1,2) ? (1,2)
  • gt(1,2) ? ? gt(1,2)

24
Truth in first-order logic
  • Sentences are true with respect to a model and an
    interpretation
  • Model contains objects (domain elements) and
    relations among them
  • Interpretation specifies referents for
  • constant symbols ? objects
  • predicate symbols ? relations
  • function symbols ? functional relations
  • An atomic sentence predicate(term1,...,termn) is
    true
  • iff the objects referred to by term1,...,termn
  • are in the relation referred to by predicate

25
Interpretation
  • Must interpret variables, constants, functions,
    and predicate symbols by associating them with
    objects, functions and relations in the world.
  • Truth values are relative to an interpretation
    (model)
  • Example
  • p(X,Y) means X is above Y
  • p(X,Y) means X is on top of and touching Y
Write a Comment
User Comments (0)
About PowerShow.com