events events are abstractions. they represent time related objects in space and time. events can be...

19
Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when we talk about events, we use different wordings than for non temporal objects. The following paralells exist: SubEvent(BattleOf Britain,WorldWarII) Partof(BattleOfBritain,WorldWarII) Period(BattleOf Britain)= [1940,1942]. Has(BattleOfBritain,period, [1940,1942]) Duration(Period(BattleOf Britain))=Years(2) Has(BattleOf Britain,Duration,2). Note that time intervals can be regarded as special form of event. SubEvent(BattleOf Britain, [1940,1942]).

Upload: owen-wilkins

Post on 01-Jan-2016

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

EventsEvents are abstractions. They represent time related objects in space and time.

Events can be treated as similar to ”ordinary” objects, but when we talk about events, we use different wordings than for non temporal objects. The following paralells exist:

SubEvent(BattleOf Britain,WorldWarII) Partof(BattleOfBritain,WorldWarII)

Period(BattleOf Britain)= [1940,1942]. Has(BattleOfBritain,period, [1940,1942])

Duration(Period(BattleOf Britain))=Years(2) Has(BattleOf Britain,Duration,2).

Note that time intervals can be regarded as special form of event.

SubEvent(BattleOf Britain, [1940,1942]).

Page 2: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Categorization of Events

Like any other sort of objects, events can be grouped into categories.For example, WorldWarII belongs to the category Wars. To say that a Civil war occurred in England in the 1640s, we could say

ako(event,thing). haveatt(event,period,interval).ako(war,event). haveatt(war,location,place).ako(civilwar,war).

isa(w1,civilwars).has( w1,period,[1640,1649]).has(w1,location,england).

Page 3: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Event Examples We can add arguments to event description to create more specific categories. To say that Shankar flew from New York to New Dehli yesterday, we could write

ako(flyevent,event).

haveatt(flyevent,passenger,agent).

haveatt(flyevent,source,place).

haveatt(flyevent,destination,place).

ako(fly(shankar,newyork,newdehli),flyevent).

isa(e1, fly(shankar,newyork,newdehli)).

has(e1,period,yesterday).

A short notation for all this is

E(fly(shankar,newyork,newdehli),yesterday).

If we use a slightly different notation, we get close to a verbal expression

do(fly(shankar,newyork,newdehli),yesterday).

Page 4: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Event objects and event categoriesIn the previous example, it was tempting to let fly(shankar,newdelhi,newyork) be an event instead of an event category.

’isa(fly(shankar,newyork,newdehli),flyevent).’

’has(fly(shankar,newyork,newdehli),period,yesterday).’

There are reasons to avoid this however because if Shankar flew from New York to New Delhi several times there would be no way to distinguish the the different times from the same expression fly(shankar,newyork,newdehli).

However, there is a way of making a definition

E(c,i) e ec SubEvent(e,i) E(fly(shankar,newyork,newdehli),yesterday).

If we replace E by do, we we get closer to a verbal expression

do(fly(shankar,newyork,newdehli),yesterday).

Shankar did (at least once) yesterday fly from New York to New Delhi.

Page 5: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Shopping Event Examples

In the shopping world, we can talk about shopping events.

Yesterday, John went to the North Berkely Safeway supermarket and bought two pound of tomatoes and a pound of ground beef.

We could give properties to buying event like this

ako(buyingevent,event).

haveatt(buyingevent,buyer,person).

haveatt(buyingevent,purchase,bunchofgoods).

haveatt(buyingevent,amount,money).

Page 6: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Shopping event cont’d

A concrete shopping event can now be identified

isa(e1,buyingevent).

has(e1,buyer,john).

has(e1,time,yesterday).

has(e1,bunchofgoods,sometomatoesandbeef).

We can also connect a verbal expression to a buyingevent

do(buy(john, sometomatoesandbeef),yesterday).

as isa(E,buyingevent),

has(e1,buyer,john),

has(e1,bunchofgoods,sometomatoesandbeef),

has(e1,time,yesterday).

Page 7: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

ProcessesThe events so far are what we call discrete events.

However, the category or set of events denoted

Flying(Shankar)

is actually made up of several subevents which are all members of Flying(Shankar) .

Categories of events with this property is called process categories.

One metapredicate T(c,i) expresses that a process c is going on throughout an interval i.

T(Working(Stuart),ToDayLunchHour).

Page 8: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Time IntervalsTime is important for agents, and we shall look at two types: Moments and Intervals.

Intervals have a Start, an End and a duration.

Moments are special cases of Intervals with no duration, and Start = End.

J. Allen was a pioneer in systematization of interval structures:

Page 9: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Relations between time intervals

j

ibefore(i,j)

equal(i,j) | equal(j,i)

(13 relations )

after(i,j)

Page 10: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Predicates on time intervals

Meet(i,j)

Before(i,j)

After(j,i)

During(i,j)

Overlap(i,j)

Overlap(j,i) Ends(i,j)

Equals(i,j) Starts(i,j)

i

i

i

i

j

j

j

j

i

j

There are 13 different relations (considering symmetries)

i

j

i

j

Page 11: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Event CalculusEvent Calculus is a formalism for reasoning about events, times and actions.

Event calculus reifies fluents and events.

A complete set of predicates for one version of event calculus is:

Holdsat(f,t) Fluent f is true at time t (”T(f,t)”) Happens(e,i) Event e happens over time interval i Initiates(e,f,t) Event e causes fluent f to start to hold at time t Terminates(e,f,t) Event e causes fluent f to cease to hold at time t Clipped(f,i) Fluent f ceases to be true during interval i Restored(f,i) Fluent f becomes true sometime during interval i

Page 12: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

EC scenario%% Tower Of Hanoi narration

holdsat(on(a,b),sk(0)). holdsat(clear(a),sk(0)).holdsat(on(b,c)) ,sk(0)).. holdsat(on(c,p1),sk(0)).holdsat(clear(p2),sk(0)). holdsat(clear(p3),sk(0)).

happens(begin,sk(0)).happens(move(a,p3), sk(1)). happens(move(b,p2), sk(2)). happens(move(a,b), sk(3)).happens(move(c,p3), sk(4)). happens(move(a,p1), sk(5)). happens(move(b,c), sk(6)).happens(move(a,b), sk(7)). happens(end,sk(10)).

%% Sample run

run:- happens(end,T), holdsat(on(X,Y),T), ans(on(X,Y)).

| ?- run.

on(c,p3) ;on(b,c) ;on(a,b);

Page 13: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

EC Scenario axioms% Box world axioms

initiates(move(X,Y),on(X,Y),E1) :- holdsat(clear(X),E1), holdsat(clear(Y),E1), diff(X,Y), diff(X,table).

initiates(move(X,Y),clear(Z),E1) :- holdsat(clear(X),E1), holdsat(clear(Y),E1), diff(X,Y), holdsat(on(X,Z),E1), diff(Y,Z).

%

terminates(move(X,Y),clear(Y),E1):- holdsat(clear(X),E1), holdsat(clear(Y),E1), diff(X,Y), diff(X,table).

terminates(move(X,Y),on(X,Z),E1):- holdsat(clear(X),E1), holdsat(clear(Y),E1), diff(X,Y), holdsat(on(X,Z),E1), diff(Y,Z).

Page 14: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Mental Events and Mental ObjectsAgents so far may have beliefs and can deduce new beliefs.

Yet none of them has any knowledge about beliefs and about deduction.

The objects of beliefs are called mental objects. So we have relationships between agents and mental objects, called propositional attitudes.

The most important relationships between an agent A and a mental object P are

Believes(A,P)

Knows(A,P)

Wants(A,P)

Says(A,P)

The representation of mental objects has the form of a proposition.

Turning a proposition into an object is called reification. Example:

Believes(Lois,Fly(Superman)).

Page 15: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Referential Transparency and Opacity

There is a problem with propositional attitudes.

As we but not Lois knows, Clark = Superman

But the following inference does not hold

Clark=Superman Believes(Lois,Fly(Superman))

Believes(Lois,Fly(Clark))

Technically, the property of being able to substitute a term freely is called referential transparency. If not, the situation is referentially opaque.

Page 16: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Axioms of knowledge and belief

Some definitions:

Knowledge is true belief

Knows(A,P) <=> Believes(A,P) P

From that follows that

Knows(A,P) => P

Knows(A,P) => Believes(A,P)

If P is a tautology (|=P) then Knows(A,P)

Know whether is defined by

KnowsWhether(A,P) <=> Knows(A,P) Knows(A,P).

Page 17: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Axioms of knowledge and belief (cont)More fun with axioms of knowledge and belief

The following applies for Believes as well

Logical agents can do simple reasoning (Modus Ponens)

Knows(A,P) Knows(A,P =>Q) => Knows(A,Q)

Logical agents can handle conjuntions

Knows(A,P) Knows(A,Q) <=> Knows(A,P Q)

Logical agents can make resolution inference, e.g.

Knows(A,P ) Knows(A ,P,Q) => Knows(A,Q)

Page 18: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Three wise mens problemThe two wise mens problem is a simplified version of the Three wise mens problem.

Here is a version that is simplified to illustrate inference in modal logic.

Two persons, A and B get a spot on their forehead. They can see each other's spot, but not their own.

They are told that the colour of the spot is either black or white,and that at least one of them is white.

The rule of the game is that as soon as one of them knows that he has a white spot, he shall announce it.

Actually, both have got a white spot.

After a period of time, A says:

I have a white spot!

How did he know that?

Page 19: Events Events are abstractions. They represent time related objects in space and time. Events can be treated as similar to ”ordinary” objects, but when

Exercise

Do exercise 12.5 in R&N: AIMA.

You may use the book, chapter 12 as the basis. Try to answer the challenges stated in items (a) – (f).

You may use the treatise in this handout and program examples on the repository as an inspiration.

Ideally you should be able to make a runnable system for some of the tasks, but that is not a requirement.

You are not required to to fill out details that are not explicitly asked for.