Representation:  Issues and Practice

Quantifier scoping and the order of quantifiers

Quantifiers and implications:  some unlikely sentence forms

Getting the benefits of higher-order logic without the added complexity

  • Variables and constants with different names need not designate different objects
  • Now, on to a specific representation scheme...


    Situation Calculus   A way to describe change in first-order logic:  what changes and doesn't change as a result of performing actions.

    Conceives of the world as broken into snapshots, called situations

    Similar to states in state-space search

    Motivation:  suppose a robot observes another  moving from the den to the kitchen

    First, he is at(robot1, den); then he is at(robot1,kitchen).  But robots can only
    be at one place at one  time...

    Introduce times? He's at the den at 3, then at the kitchen at 4.

    But what if we don't know when exactly he began the move and when he
    accomplished it?   We would have to use a vague description such as ``before now''.
    The knowledge base would be a mixture of vague and specific times, etc., making reasoning
    complicated.

    A situation is a more abstract unit with less committment to detail,allowing less complex representation of the basic things we need.  Example:


    Example: The Wumpus World

    We will illustrate general types of axioms with the Wumpus World used in the text
    To make the presentation feasible, we will solve a simpler problem
         (Note:  the set of axioms in the text illustrate additional issues, but do not as a whole solve the problem)
     
    Our problem:  get from start to home, picking up the gold along the way.
                          actions : just forward and grab.
     Types of axioms: effect, frame, precondition, and closure

    We saw effect axioms above:
          LHS checks the preconditions.
          RHS specifies the effects (ignore ``bestaction'' for now)



    effect axiom: forward
    all(S,L1,L2)(bestaction(forward,S) and at(me,L1,S) and toward(L1,L2) =>
                   at(me,L2,result(forward,S)))

    effect axiom: grab
    all(S,L)(bestaction(grab,S) and at(gold,L,S) and at(me,L,S) =>   holding(me,gold,result(grab,S)))


    Suppose that, in some situation S, the robot is holding the gold, and then the robot goes straight home, executing only move actions. He will be in a new situation when he gets there. How do we know he is holding the gold in that situation? After all, he is no longer at his original position.

    The frame problem: what stays the same?

    Effect axioms specify what changes as a result of an action;
    Frame axioms specify what does not  change.

    Frame axioms for our simple problem:

    all(S)(holding(me,gold,S) =>
            holding(me,gold,result(forward,S)))
    all(S)(~holding(me,gold,S) =>
            ~holding(me,gold,result(forward,S)))
    all(S,A,L) (at(A,L,S) => at(A,L,result(grab,S))

    Frame axioms if there were many actions, including release (text, p. 206):

    all (A,X,S)(holding(me,X,S) and ~equal(A,release) -->
                  holding(me,X,result(A,S)))
    all (A,X,S)(~holding(me,X,S) and ~equal(A,grab) -->
                   ~holding(me,X,result(A,S)))
    etc.

    Closure axiom for at (we are not making the closed-world assumption,
    so we provide the means to infer that something is not the case):

    all(A,L1,L2,S)(at(A,L1,S) and location(L2) and ~equal(L1,L2) =>
                     ~at(A,L2,S))

    To focus inference, let's include a mechanism for choosing one
    action per situation; bestaction(a,s) means that a is the action to
    perform in state s.  Clearly, we want to prefer grab over forward.

    We will use precondition axioms, and precondition closure axioms, to enable the robot to infer which actions are possible and which are not;

    precondition axioms

    closure axioms for preconditions

    all(L,S)(at(me,L,S) and equal(L,home) => ~possible(forward,S))
    all(L,S)(at(me,L,S) and ~at(gold,L,S) => ~possible(grab,S))
    all(S)(holding(me,gold,S) => ~possible(grab,S))

    type facts

    location(start)
    location(home)
    location(loc1)
    location(loc2)
    ...

    equality and inequality facts and axioms:

    all(X)(equal(X,X))
    all(X,Y)(equal(X,Y) => equal(Y,X))
    all(X,Y)(~equal(X,Y) => ~equal(Y,X))
    all(X,Y)(location(X) and action(Y) => ~equal(X,Y))
    ~equal(forward,grab)
    ~equal(start,home)
    ~equal(loc1, start)
    ~equal(loc1, home)
    ~equal(loc1, loc2)
    ...

    toward facts (the map)

    toward(start,loc1)
    toward(loc1,home)
    ...

    initial state

    at(me,start,s0)
    at(gold,loc1,s0)

    goal
     

    exists S (at(me,home,S) and (holding(me,gold,S))

    solution

    S = result(forward, (result(grab, result(forward,s0))))