lecture 8-2cs250: intro to ai/lisp what do you mean, “what do i mean?” lecture 8-2 november 18...

47
Lecture 8-2 CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th , 1999 CS250

Upload: clare-mosley

Post on 06-Jan-2018

218 views

Category:

Documents


3 download

DESCRIPTION

Lecture 8-2CS250: Intro to AI/Lisp Ontolingua Stanford ontology server –Suite of ontology authoring tools –Library of modular reusable ontologies

TRANSCRIPT

Page 1: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

What do you mean, “What do I mean?”

Lecture 8-2November 18th, 1999

CS250

Page 2: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Project comments

• Need copy-editing• Style

– Page numbers, citations• Code printouts

– No crazy wrapping• Philosophy projects

Page 3: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Ontolingua• Stanford ontology server

– Suite of ontology authoring tools– Library of modular reusable ontologies

Page 4: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

How do we build an ontology?

• Knowledge engineering• Knowledge acquisition• Ontological engineering

Page 5: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Representing U of C

• What kinds of questions might we want to ask of our knowledge base?

Page 6: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Steps in Building

• Decide what to talk about• Decide on a vocabulary• Encode general rules• Encode an instance• Pose queries

Page 7: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

What do we get from logic?

• Logics consist of:– Syntax– Semantics– Proof theory

• Expressive, but doesn’t say what to express

Page 8: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

A Few Terms

• Knowledge engineering - Art & science of transforming worldly knowledge into computer reasonable form

• Knowledge acquisition - Squeezing knowledge from the heads of experts

Page 9: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Declarative Approach Rides Again

• Write down what you know, and let the system figure out the rest

• Separate inferencing from representation– Design an inferencing engine that works

with many representations– Free to focus on the best representation

Page 10: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Good Qualities for a Knowledge Base

• Clarity• Coherence• Extensibility• Avoid favoring encodings• Minimal ontological commitment

From “Toward Principles for the Design of Ontologies Used for Knowledge Sharing”

Page 11: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

KE Questions

• For every sentence added to the knowledge base:– Why is this true? Can its truth be

decomposed?– Is it widely applicable? Can I broaden this

observation?– Do I need a predicate to denote this class of

objects? How does the class relate to other classes? Subclasses? Other class properties?

Page 12: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

KE Strategy

Decide what to talk about– What to focus on, what to ignore

Vocabulary of predicates, functions & constants

Encode general domain knowledge Encode a specific problem instance Sit back and ask questions

Page 13: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

1-Bit Adder

12

3

2

1

Page 14: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

What are We Talking About

• Some concepts we’ll need– Wires as connectors– Gates (AND, OR, XOR & NOT)– Inputs– Outputs

• What don’t we need?Latency, layout, CMOS, time

Page 15: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Representing Stuff

• Distinguish gates from one another– Constants

• Gate types– Type functions > Type(X1) = XOR

• Terminals– Output terminal function: Out(1, X1)

• Connectivity

Page 16: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Encode General Rules• If two terminals are connected, they have the

same signal

• The signal at every terminal is either on or off (but not both)

• An XOR gate is on iff its inputs are different

t1,t2 Connected(t1,t2) Signal(t1)=Signal(t2)

t Signal(t)=On Signal(t)=Off

OnOff

g Type(g)=XOR Signal(Out(1,g)=On Signal(In(1,g))Signal(In(2,g))

Page 17: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Encode Specific Instance

• Encode the circuit– Gate info– Connections among gates

Page 18: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Ask the $64,000 Question

• When will the first output of C1 be off and the second output of C1 to be on?

• Is the circuit correct?– What are the possible sets of values of all

the terminals for the adder circuit?i1,i2,o1,o2 Signal(In(1,C1))=i1 Signal(In(2,C1))=i2 Signal(In(3,C1))=i3 Signal(Out(1,C1))=o1 Signal(Out(2,C1))=o2

Page 19: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Other KR’s

• Case-based reasoning• Bayesian networks• Neural networks

Page 20: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Representational Adequacy• Metaphysical adequacy

Could the world have the representational form suggested without a contradicting the facts of the aspect of the reality we’re interested in?

• Epistemological adequacyExpress facts about the world in a practical way

• Heuristic adequacyAre the reasoning processes used in solving a

problem expressible?

Page 21: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

General Ontologies

• Categories• Measures• Composite Objects• Time, Space and Change• Events and Processes• Physical Objects• Substances• Mental Objects and Beliefs

Page 22: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Categories• Categories• Reification

– How many people live on Earth?• Inheritance• Creating taxonomies

– Kentucky Fried Chicken– Dewey decimal– LoC– MeSh

Page 23: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Measures

• Examples: Height, mass, cost• Measure = Units function + a Number

Page 24: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Composite Objects

• Not inheritance– Difference between subclass and member

• Schema• Script

Page 25: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Composite Objects

• Not inheritance– Difference between subclass and member

• General event descriptions– Schema– Script

Page 26: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Using Events to Represent Change

• What’s the problem?– Continuous time– Multiple agents– Actions of different durations

• Event calculus - Reify events

Page 27: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Event Calculus Vocabulary

• Events are splotches in the space-time continuum

• Events have subevents• Some events are intervals

Page 28: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Examples

• Suppose we wish to represent facts about market manias

f fBulbEating SubEvent(f,TulipMania) PartOf(Location(f), Holland)

s sStockFrenzy SubEvent(s,USBullMarket) PartOf(Location(f), ??)

s sStockFrenzy SubEvent(s,USBullMarket) TradedOn(Exchange(s), NASDAQ)

Page 29: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Place

• How are places like intervals?• Relation In holds among places• Location function: Maps an object to the

smallest place that contains it

Page 30: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Processes

• Why do we need processes when we have events?

• How can we say:– Barry Sonnenfeld was flying some time

yesterday

– Barry was flying all day yesterday

Kurt D. Fenstermacher:

Sonnenfeld directed:Men in Black (1997)Get Shorty (1995)The Addams Family (1991)

E(Flying(Barry), Yesterday)

T(Flying(Barry), Yesterday)

Page 31: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

A Logical Blender

Suppose Bill is accused of killing a zucchini, and when the cold, but efficient, Detective Frigerator (known to his pals as simply “Re”) questions the orange juice pitcher in FOPL, the orange juice has no idea how to say:

“Bill was in the kitchen with the tomato all day yesterday”

Page 32: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Composite Events

• Use And to combine two events with the usual semantics:

And isn’t so bad, but disjunction is a bit more complicated -- how do we say:

“I saw the whole thing, the beef or the broccoli stabbed the zucchini all afternoon.”

p,q,e T(And(p, q), e) T(p, e) T(q, e)

Page 33: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Time & Intervals

• Time is pretty important– Divvy up time into: Moments and ExtendedIntervals

– Define a couple handy functionsStartEndTimeDate

Page 34: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

When Intervals Get Together

• Meet• Before• After• During• Overlap

Page 35: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Objects in the Space-Time Continuum

• Remember that events are splotches of space-time

• Some events have coherence through time

• Need to capture the idea of an object existing through time

Page 36: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Roman Empire

• Roman Empire spread across much of Eurasia, expanding and contracting, from 753 B.C. until the 5th century A.D.

Page 37: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Roman Empire at 218 B.C.

Page 38: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Roman Empire at 117 A.D.

Page 39: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Roman Empire at 395 A.D.

Page 40: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Fluents• Roman Empire is an event

– Subevents include• First, Second and Third Punic Wars• One of the first known hammer and anvil

movements in battle (216 BC @ Cannae)

• A fluent allows us to capture the notion of the Roman Empire throughout time

T(Male(Emperor(RomanEmpire)), 1stCenturyAD)

T(In(Gaul, Roman Empire), AD12)

Page 41: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Fluent Flavors

• Fluent is a function, f:Situations Fvalues– Domain is the set of all situations (states of

the world)

If Fvalues is {TRUE, FALSE} then it’s a Propositional fluent

If Fvalues is {All situations} then it’s a Situational fluent

Page 42: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Substances

• Less vs. fewer• Intrinsic vs. extrinsic properties• Substances are those things that are

fungible

Page 43: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Going, Like, Totally Mental

• What are other agents know, and what are they thinking?– “Everybody’s looking at me”– “They’re trying to kill me”– “You look like someone who knows where I

can find extra virgin olive oil”• Start with a Believes predicate

Believes(Agent, x)

Page 44: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Reification & You

• A good first pass:

• Treat Flies(Superman) as a propositional fluent– Relationships like Believes, Know and When

between agents and propositions are propositional attitudes

• The problem: Can Clark fly?

Believes(Agent, Flies(Superman))

Page 45: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

“It is clear.”

• Referential transparency– Any term can be substituted for an equal

term– FOL is referentially transparent

Page 46: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Knowing for Action

• Knowing preconditions: What do you need to know to do action a?

• Knowledge effects: What effect does performing action a have on an agent’s knowledge?

Page 47: Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250

Lecture 8-2 CS250: Intro to AI/Lisp

Replacing that Zucchini

• Grocery shopping– Percepts– Actions– Goals– Environment