25
Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive Science, and The National Center for Multisource Information Fusion {mwk3|shapiro}@cse.buffalo.edu Logical Formalizations of Commonsense Reasoning AAAI 2007 Spring Symposia March 28, Stanford University, California

Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

  • View
    216

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Knowledge Acquisition by an Intelligent Acting Agent

Michael Kandefer and Stuart ShapiroDepartment of Computer Science and Engineering, Center for Cognitive Science, and The National Center for Multisource

Information Fusion{mwk3|shapiro}@cse.buffalo.edu

Logical Formalizations of Commonsense Reasoning AAAI 2007 Spring Symposia

March 28, Stanford University, California

Page 2: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Outline

• Problem Description and Requirements• Basic algorithm• Example Interactions with Agent• Architecture for agent embodiment (GLAIR)• Symbol anchoring in GLAIR• Solution Details• Conclusions

Page 3: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

McCarthy’s Second Telephone Problem

• McCarthy (1979)* presents several problems that require commonsense reasoning.

• Second telephone problem:– A computer program that wants to telephone

someone must reason about who knows the number. More generally, it must reason about what actions will obtain needed knowledge. Knowledge in books and computer files must be treated in a parallel way to knowledge held by persons. [Furthermore, a] program must often determine that it does not know something or that someone else doesn’t.

* McCarthy, J. 1979. First order theories of individual concepts and propositions. In Hayes, J.; Michie, D.; and Mikulich, L., eds., Machine Intelligence 9. Ellis Horwood Ltd. 129-147

Page 4: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Problem Requirements

1. Determining the absence of the requisite knowledge for completing the task at hand.

2. Determining the external information sources that might contain the required information.

3. Knowing how to consult the source(s).4. Retrieving and representing the needed

information.5. Completing the task with the acquired

information.

Page 5: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

External Sources

• Text files: – Telephone book:

John 305 Pine Tree Lane 479-2344

– Campus telephone directory:

Bill NSC 678 555-8989

• User is used as an external source– User can type English statements asserting knowledge

– User can enter a phone number when queried by the agent

Page 6: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Basic Calling Procedure

1. Believe none of the information sources have been searched

2. If the individual’s phone number is known, dial it.

3. Otherwise, search each information source that is believed to contain the phone number, dial it if found.

Page 7: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Example Interactions

: What is Mike’s telephone number?

Mike’s telephone number is 555-5612.

: Call Mike.

I am pressing 5. I am pressing 5. I am pressing 5. I am pressing 5. I am pressing 6. I am pressing 1. I am pressing 2.

Page 8: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Example Interactions

: What is Stu’s telephone number?I don’t know.

: Call Stu.Checking Campus Database for Stu’s telephone number.

I am pressing 5. I am pressing 5. I am pressing 5. I am pressing 7. I am pressing 8. I am pressing 9. I am pressing 0.

: What is Stu’s telephone number?Stu’s telephone number is 555-7890.

Page 9: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Example Interactions: What is Albert’s telephone number?

I don’t know.

: Call Albert.Checking Phonebook for Albert’s telephone number...I could not find Albert’s phone number in any external informationsource available to me.

Do you know Albert’s number? Yes

What is Albert’s number (e.g. 555-5555)? 555-1234

I am pressing 5. I am pressing 5. I am pressing 5. I am pressing 1. I am pressing 2. I am pressing 3. I am pressing 4.

: What is Albert’s telephone number?Albert’s telephone number is 555-1234.

Page 10: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

GLAIR

• Grounded Layered Architecture with Integrated Reasoning– Architecture for embodied

agents.• Knowledge layer (KL)

– Conscious reasoning– Beliefs, Plans and Policies

• Perceptuo-motor layer (PML)– Primitive actions– Link to embodiment

• Sensory-actuator layer (SAL)– Sensors and actuators

KL

PML

SAL

Page 11: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Implementing the KL

• SNePS-based agents have first-person belief base

• Structured as a set of propositions in a “language of thought” independent of the natural language used to express these beliefs

• SNePSLOG – higher-order logical language interface to SNePS

Page 12: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

GLAIR and Symbol Anchoring

KL PML SAL

SNePSLOG terms:

Mikelex

Lexicon:

(“Mikelex“

((ctgy . npr) (root . “Mike")))

English:

“Mike”

SNePSLOG expressions:

Has(b5,compCat(lex(telephonelex),lex(numberlex)), b10).

Name(b5, Mikelex).Value(b10,N(n5,N(n5,N(n5,N(n5, N(n6,N(n1,n2))))))).

Grammar:

GATN English:

“Mike’s telephone number is

‘555-5612’.”

SNePSLOG prim. act terms:

act(lex(presslex), n5)

Attach-primaction: (attach-primaction lex(presslex) press)

(press “5”)

Sensors and actuators

“I am pressing 5.”

Presses button ‘5’ on

simulated phone

Page 13: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Domain of Discourse

• Entities– Propositions– Acts– Policies– Things

Page 14: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Individual Constants Denoting Things

• Mikelex - Lexeme “Mike”• telephonelex - Lexeme “telephone”• numberlex - Lexeme “number”• studentlex - Lexeme “student”• professorlex - Lexeme “professor”• digitlex - Lexeme “digit”• sequencelex - Lexeme “sequence”• presslex – Lexeme “press”

• bDB - A campus telephone directory• bPB - A telephone directory• n0-n9 - Digits 0-9• b5 – denotes the individual named “Mike”• b10 – denotes the value of Mike’s telephone number.

Page 15: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Thing-denoting Functions

• lex(x) – the thing that can be expressed by the lexeme denoted by x

• compCat(c1,c2) – the complex categorywhich is a subcategory of the category denoted by c2and is modified by c1

Ex. compCat(lex(telephonelex),lex(numberlex))

Page 16: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Telephone Number Values

• N(d,n) - the sequence [d,n]– N(n5,N(n5,N(n5,N(n1,N(n2,N(n3,n4)))))

• Digit sequence axiom:all(d)(Member(d, lex(digitlex)) => all(n)({Member(n,lex(digitlex)), Member(n,compCat(lex(digitlex),lex(sequencelex)))}

v=> Member(N(d,n), compCat(lex(digitlex),lex(sequencelex))))).

Page 17: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Proposition-valued Functions

• Possession– Has(p,r,o) – “p’s r is o”.– Name(e,pn) – the proper-name of entity e is pn.– Value(e,v) - the value of entity e is v.

Ex. Has(b5,compCat(lex(telephonelex),lex(numberlex)), b10). Name(b5, Mikelex). Value(b10, N(n5,N(n5,N(n5,N(n5,N(n6,N(n1,n2))))))).

• Act definition:– ActPlan(a1,a2): To perform act a1, perform act a2.

Page 18: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Act-denoting Functions (SNeRE)

• SNeRE acting system used for an online acting solution

• SNeRE primitive acts– snsequence(a1,a2)– snif({if(p1,a),...,if(pn,an)[,else(da)]})– withsome(x, p(x), a(x), da)

• SNeRE Mental Acts:– disbelieve(p)– believe(p)

Page 19: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Primitive Act-denoting Functions

• Information retrieving primitives – search(p, s) – ask-user(p)

• Dialing Primitives– pickup() – putdown() – press(n)

Page 20: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Symbol Anchoring vs. Quotation

• Since: – propositions are first-class objects in the

domain, – proposition-denoting functional terms are

employed– alignment is used to connect lexeme-denoting

terms with the actual lexemes

• Therefore, there is no need for a quotation or string operator.

Page 21: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Belief Base Introspection

• Agent requires the ability to introspect on its belief base and act on the results

• Lack of knowledge reasoning is captured by the else clause of withsome

Ex. withsome({n,n1},

(Has(b5,compCat(lex(telephonelex), lex(numberlex)),n1) and Value(n1,n)),

dial(b5,n),

lookup(b5))

Page 22: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Reasoning About External Information Sources

• Determining the source:all(p)(Member(p, lex(personlex)) => ({Member(p,lex(professorlex)), Member(p,lex(studentlex))} v=> Contains(bDB,compCat(lex(telephonelex),lex(numberlex)),p))).

all(p)(Member(p, lex(personlex)) => ({˜Member(p,lex(professorlex)), ˜Member(p,lex(studentlex))} &=> Contains(bPB,compCat(lex(telephonelex),lex(numberlex)),p))).

• Using the source:withsome(i,

(Member(i,compCat(lex(informationlex),lex(sourcelex))) and Contains(i,compCat(lex(telephonelex),lex(numberlex)),p) and ˜Searched(i)), …)

Page 23: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Using the Information

• Regardless of how the information is acquired the dial defined act is performed

• dial is a recursive procedure that processes the digit sequence one digit at a time, performing press on each.

Page 24: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Dial Defined Actall(a,v,pn)({Member(a,lex(personlex)), Value(v,pn), Has(a,compCat(lex(telephonelex), lex(numberlex)), v)} &=> ActPlan(dial(a,pn), ordered-press(pn))).

all(n1,n2)(Member(N(n1,n2), compCat(lex(digitlex),lex(sequencelex)))

=> ActPlan(ordered-press(N(n1,n2)), snif({if(Member(n2,lex(digitlex)), snsequence(act(lex(presslex),n1),

act(lex(presslex),n2))), else(snsequence(act(lex(presslex),n1),

ordered-press(n2)))}))).

Page 25: Knowledge Acquisition by an Intelligent Acting Agent Michael Kandefer and Stuart Shapiro Department of Computer Science and Engineering, Center for Cognitive

Conclusions

• Demonstrated the necessary elements to an embodied solution to McCarthy’s Second Telephone number using SNePS

1. Determining missing information with withsome2. Determining external sources to check using rules3. Consulting those sources through the GLAIR

architecture4. Used GLAIR to retrieve and represent the needed

information by anchoring the symbols of the knowledge base with the English language

5. Executed the task using the SNePS acting system with integrated reasoning