planning partial order regression planning temporal representation 1 deductive planning in logic...

54
PLANNING PLANNING Partial order regression planning Partial order regression planning Temporal representation 1 Temporal representation 1 Deductive planning in Logic Deductive planning in Logic Temporal representation 2 Temporal representation 2

Upload: veronica-hodge

Post on 23-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

PLANNINGPLANNING

Partial order regression planningPartial order regression planning

Temporal representation 1Temporal representation 1

Deductive planning in LogicDeductive planning in Logic

Temporal representation 2Temporal representation 2

Page 2: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

2

A A second class of plannerssecond class of planners: based on A.R.: based on A.R.

The many motivations ...The many motivations ...

Provide an additional (more complex) Provide an additional (more complex) illustration of ARillustration of AR..

Show important trade-offs in Show important trade-offs in Knowledge RepresentationKnowledge Representation..

Introduce Introduce Temporal RepresentationTemporal Representation (Situation Calculus). (Situation Calculus).

Page 3: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

Temporal representation 1Temporal representation 1

From STRIPS to a simple situation From STRIPS to a simple situation calculuscalculus

Page 4: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

4

Towards planning as Towards planning as Automated ReasoningAutomated Reasoning

Formulate Formulate in a logic theoryin a logic theory TT:: The initial situationThe initial situation For each operator:For each operator:

its preconditionsits preconditions the relation between the previous the relation between the previous

situation and the next one.situation and the next one.

Prove the Prove the logical consequencelogical consequence FF:: “ “ There exists a sequence of operations, such There exists a sequence of operations, such

that if they are applied to the initial situation, that if they are applied to the initial situation, the resulting situation satisfies some given the resulting situation satisfies some given properties”.properties”.

Extract the plan from the proof.Extract the plan from the proof.

Page 5: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

5

What the STRIPS represen-tation What the STRIPS represen-tation lacks to do this:lacks to do this:

do NOT describe WHEN do NOT describe WHEN (at which time (at which time point or in which situation)point or in which situation) these these properties hold.properties hold.

1) State representations, like1) State representations, like

on(A,B) clear(A) on(B,Table)on(A,B) clear(A) on(B,Table)

Thus: if the goal is to have Thus: if the goal is to have on(A,Table)on(A,Table), this is , this is inconsistent with the current property inconsistent with the current property on(A,B)on(A,B) Remember: logic is monotonic … no Remember: logic is monotonic … no

consequences get consequences get removed! removed!

2) Add and Delete list are procedural.2) Add and Delete list are procedural. These do not declaratively describe the relation These do not declaratively describe the relation

between the previous situation and the next.between the previous situation and the next.

Page 6: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

6

Introducing temporal information:Introducing temporal information:

1) What kind of temporal identifications to use?1) What kind of temporal identifications to use?

Time pointsTime points Situation namesSituation names

Extra argumentExtra argument

Meta-predicateMeta-predicate

2) How to add this information?2) How to add this information?

on(A,B,T)on(A,B,T) on(A,B,S)on(A,B,S)

holds(on(A,B),T)holds(on(A,B),T) holds(on(A,B),S)holds(on(A,B),S)

Two dimensions of options:Two dimensions of options:

Page 7: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

7

A tiny example problem:A tiny example problem:

AA

BB

BB

AA

Initial situationInitial situation

Goal situationGoal situation

on(B,A,on(B,A,SS00)) on(A,Table,on(A,Table,SS00)) clear(B,clear(B,SS00))

ss on(B,Table, on(B,Table,ss))

Page 8: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

8

Situation calculus, extra argument.Situation calculus, extra argument. Examples of situations:Examples of situations:

moveATableB(moveATableB(SS00))

moveCBA(moveABTable(moveCBA(moveABTable(SS00))))

Operations are described by functors:Operations are described by functors: Examples:Examples:

move A from B to C: move A from B to C: moveABC(x)moveABC(x)

move A from Table to B: move A from Table to B: moveATableB(x)moveATableB(x)

Situation descriptions using ‘terms’:Situation descriptions using ‘terms’:

The initial situation is described by a constant: The initial situation is described by a constant: SS00

A situation obtained from a situation A situation obtained from a situation ss by applying an by applying an

operator operator move . from . to .move . from . to . as the term: as the term: move…(move…(ss))

Page 9: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

9

The situations in this worldThe situations in this world

S0

AABB

moveBATable(moveBATable(S0)

AA BB

moveATableB(moveBATable(moveATableB(moveBATable(S0))

moveBTableA(moveBATable(moveBTableA(moveBATable(S0))

AABB

AABB

Page 10: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

10

The plan ?The plan ?

AA

BB

BB

AA

Initial situationInitial situation

Goal situationGoal situation

ss on(B,Table, on(B,Table,ss))

Finding a proof = finding a substitution for Finding a proof = finding a substitution for ss of of the form:the form:

THUS: the value for THUS: the value for ss IS THE PLANIS THE PLAN..

ss / moveBATable(/ moveBATable(SS00))

Page 11: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

11

Completing situationsCompleting situations Note: also valid are:Note: also valid are:

~on(A,B,~on(A,B,SS00) ~on(B,Table,) ~on(B,Table,SS00) ~clear(A,) ~clear(A,SS00))

In STRIPS (and in LP) these are implicitly In STRIPS (and in LP) these are implicitly represented.represented.

In FOL, we could instead add:In FOL, we could instead add:

PSPS: also completes all later situations: also completes all later situations

x,y,z,x,y,z,ss on(x,y, on(x,y,ss) ) ~y=Table ~y=Table ~x=z ~x=z ~on(z,y,~on(z,y,ss))

yyxx zz

x,y,z,x,y,z,ss on(x,y, on(x,y,ss) ) ~y=z ~y=z ~on(x,z, ~on(x,z,ss))

yyxx

zz

x,y,x,y,ss on(x,y, on(x,y,ss) ) ~y=Table ~y=Table ~clear(y, ~clear(y,ss))

yyxx NotNot

clearclear

Page 12: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

12

Relating different situations (1)Relating different situations (1)

ss on(B,A, on(B,A,ss) ) clear(B, clear(B,ss) ) on(B,Table, on(B,Table,moveBATable(moveBATable(ss)))) clear(A,clear(A,moveBATable(moveBATable(ss))))

For each operator we need to represent the For each operator we need to represent the relation between previous and next situationrelation between previous and next situation

if on(B,A)if on(B,A) clear(B)clear(B)add on(B,Table)add on(B,Table) clear(A)clear(A)delete on(B,A)delete on(B,A)

move B from A to Tablemove B from A to Table Example:Example:

Note: Note: delete on(B,A)delete on(B,A) is implicitly represented is implicitly represented because of because of add on(B,Table)add on(B,Table) and the and the completing completing formulaeformulae..

Page 13: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

13

Relating different situations: Relating different situations: Frame axioms (1):Frame axioms (1):

STRIPS operators only express which things change !STRIPS operators only express which things change !

if on(B,A)if on(B,A) clear(B)clear(B)add clear(A)add clear(A) on(B,Table)on(B,Table)delete on(B,A)delete on(B,A)

move B from A to Tablemove B from A to Table

on(A,Table)on(A,Table)initiallyinitially

on(A,Table)on(A,Table)

still holdsstill holds

Example:Example:

IfIf on(A,Table,on(A,Table,ss)) is true and is true and move B from A to Tablemove B from A to Table is applicable, is applicable, thenthen on(A,Table,on(A,Table,moveBATable(moveBATable(ss)))) is true. is true.

FRAME AXIOMSFRAME AXIOMS

We need to express this explicitly !We need to express this explicitly !

Page 14: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

14

Relating different situations: Relating different situations: Frame axioms (2):Frame axioms (2):

Example:Example: if on(B,A)if on(B,A) clear(B)clear(B)add clear(A)add clear(A) on(B,Table)on(B,Table)delete on(B,A)delete on(B,A)

move B from A to Tablemove B from A to Table

Anything that was Anything that was onon something else before, except something else before, except for B on A, still is:for B on A, still is:

x,y,s on(B,A,x,y,s on(B,A,ss) ) clear(B, clear(B,ss) ) on(x,y, on(x,y,ss) ) ~(x=B ~(x=B y=A) y=A) on(x,y,on(x,y,moveBATable(moveBATable(ss))))

Anything that was Anything that was clearclear before, still is: before, still is:

x,s on(B,A,x,s on(B,A,ss) ) clear(B, clear(B,ss) ) clear(x, clear(x,ss) ) clear(x,clear(x,moveBATable(moveBATable(ss))))

Page 15: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

15

Discussion:Discussion: This is one of the most simple options.This is one of the most simple options.

It requires:It requires: very many axioms and frame axiomsvery many axioms and frame axioms

for for EACHEACH separate operation separate operation

Generalizing to operators patterns in not easy.Generalizing to operators patterns in not easy.

But:But: this is sufficient to illustrate planning as this is sufficient to illustrate planning as deduction.deduction.

We discuss more refined representations later.We discuss more refined representations later.

Page 16: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

Planning as deductionPlanning as deduction

Automated reasoning applied to a Automated reasoning applied to a simple situation calculus representationsimple situation calculus representation

Page 17: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

17

The theory and goalThe theory and goalon(B,A,on(B,A,SS00))on(A,Table,on(A,Table,SS00))clear(B,clear(B,SS00))ss on(B,A, on(B,A,ss) ) clear(B, clear(B,ss) )

on(B,Table,on(B,Table,moveBATable(moveBATable(ss)))) clear(A,clear(A,moveBATable(moveBATable(ss))))+ + the consistency axiomsthe consistency axioms+ + the Frame axiomsthe Frame axioms+ + similar formulae for other operatorssimilar formulae for other operators

T:T:

F:F: ss on(B,Table, on(B,Table,ss))

~F:~F: false false on(B,Table, on(B,Table,ss))

Page 18: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

18

NormalizationNormalization

(T (T {~F})’: {~F})’:

on(B,A,on(B,A,SS00))on(A,Table,on(A,Table,SS00))clear(B,clear(B,SS00))on(B,Table,on(B,Table,moveBATable(moveBATable(ss))) ) on(B,A, on(B,A,ss) ) clear(B,clear(B,ss))clear(A,clear(A,moveBATable(moveBATable(ss))) ) on(B,A, on(B,A,ss) ) clear(B,clear(B,ss))false false on(B,Table, on(B,Table,ss))

+ + normalization of othersnormalization of others

Page 19: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

19

A linear top-down proofA linear top-down proof

What is the plan??What is the plan??The answer substitution:The answer substitution: {{ss11//moveBATable(moveBATable(SS00))}}

false false on(B,Table,on(B,Table,ss11)) on(B,Table,on(B,Table,moveBATable(moveBATable(ss22)))) on(B,A,on(B,A,ss22) ) clear(B, clear(B,ss22))

{{ss11//moveBATable(moveBATable(ss22))}}

false false on(B,A,on(B,A,ss22)) clear(B, clear(B,ss22)) on(B,A,on(B,A,SS00))

false false clear(B,clear(B,SS00))

{{ss22//SS00}}

clear(B,clear(B,SS00))

false false

Page 20: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

20

The relevance of Frame axioms?The relevance of Frame axioms?

Find a plan such that Find a plan such that BB gets on the gets on the TableTable AND AND AA is still on the is still on the TableTable..

false false on(B,Table, on(B,Table,ss) ) on(A,Table, on(A,Table,ss))

~F:~F:

Proof:Proof: first part identical to the previous one, first part identical to the previous one, except that every goal gets an extra conjunct: except that every goal gets an extra conjunct: on(A,Table, on(A,Table,ss11), ), where where ss11 gradually get instantiated gradually get instantiated

toto moveBATable(moveBATable(SS00))..

Page 21: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

21

A linear top-down proofA linear top-down proofextendedextended

false false on(B,Table,on(B,Table,ss11)) on(B,Table,on(B,Table,moveBATable(moveBATable(ss22)))) on(B,A,on(B,A,ss22) ) clear(B, clear(B,ss22))

false false on(B,A,on(B,A,ss22)) clear(B, clear(B,ss22))

{{ss11//moveBATable(moveBATable(ss22))}}

on(B,A,on(B,A,SS00))

false false clear(B,clear(B,SS00))

{{ss22//SS00}}

clear(B,clear(B,SS00))

false false

on(A,Table, son(A,Table, s11))

on(A,Table, moveBATable(son(A,Table, moveBATable(s22))))

on(A,Table, moveBATable(on(A,Table, moveBATable(SS00))))

on(A,Table, moveBATable(on(A,Table, moveBATable(SS00))))

No longer resolves with anything, except frame axioms !No longer resolves with anything, except frame axioms !

Page 22: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

22

Normalization of Frame Axiom 1:Normalization of Frame Axiom 1:

x,y,s on(B,A,x,y,s on(B,A,ss) ) clear(B, clear(B,ss) ) on(x,y, on(x,y,ss) ) ~(x=B ~(x=B y=A) y=A) on(x,y,on(x,y,moveBATable(moveBATable(ss))))

x,y,s on(x,y,x,y,s on(x,y,moveBATable(moveBATable(ss))) ) ~on(B,A, ~on(B,A,ss) ) ~clear(B, ~clear(B,ss) ) ~on(x,y,~on(x,y,ss) ) (x=B (x=B y=A) y=A)

x,y,s (on(x,y,x,y,s (on(x,y,moveBATable(moveBATable(ss))) ) x=Bx=B ~on(B,A, ~on(B,A,ss) ) ~clear(B,~clear(B,ss) ) ~on(x,y, ~on(x,y,ss)) )) (on(x,y,(on(x,y,moveBATable(moveBATable(ss))) ) y=Ay=A ~on(B,A,~on(B,A,ss) ) ~clear(B, ~clear(B,ss) ) ~on(x,y,~on(x,y,ss))))

on(x,y,on(x,y,moveBATable(moveBATable(ss))) ) x=B x=B on(B,A, on(B,A,ss) ) clear(B, clear(B,ss) ) on(x,y,on(x,y,ss) ) on(x,y,on(x,y,moveBATable(moveBATable(ss))) ) y=A y=A on(B,A, on(B,A,ss) ) clear(B, clear(B,ss) ) on(x,y,on(x,y,ss) )

Page 23: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

23

false false on(A,Table, on(A,Table, moveBATable(moveBATable(SS00))))

The continuation of the proofThe continuation of the proof

false false ????????

on(B,A,on(B,A,SS00))

A=B A=B clear(B,clear(B,SS00)) on(A,Table, on(A,Table,SS00)) clear(B,clear(B,SS00))

A=B A=B on(A,Table,on(A,Table,SS00)) on(A,Table,on(A,Table,SS00))

A=B A=B

on(x,y,on(x,y,moveBATable(moveBATable(ss)))) x=B x=B on(B,A,on(B,A,ss) ) clear(B, clear(B,ss) ) on(x,y, on(x,y,ss))

A=B A=B on(B,A,on(B,A,SS00)) clear(B, clear(B,SS00) ) on(A,Table, on(A,Table,SS00))

{{xx//AA,,yy//TableTable, , ss//SS00}}

Page 24: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

24

Unique Names AxiomsUnique Names Axioms For each two For each two non-unifiablenon-unifiable syntactic objects o1 syntactic objects o1

and o2: ~o1=o2.and o2: ~o1=o2.

HereHere: ~A=B, ~A=Table, ~B=Table: ~A=B, ~A=Table, ~B=Table

false false A=B A=Bfalse false A=Table A=Tablefalse false B=TableB=Table

In In normalized formnormalized form::

A=B A=B false false A=B A=B

false false

Thus we get:Thus we get:

Page 25: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

25

Can deductive planning achieve Can deductive planning achieve the STRIPS control?the STRIPS control?

Definitely does regression (goal directed search) !Definitely does regression (goal directed search) !

Partial order planning?Partial order planning? No, not with this simple representation.No, not with this simple representation. Reason: Reason: ss property( property(ss)) Resolution steps construct: Resolution steps construct:

ss = = move…(move…(move…( . . . )))move…(move…(move…( . . . )))– this is a total order !!this is a total order !!

Planning with Planning with operator patternsoperator patterns?? No: are not even represented here!No: are not even represented here!

Need more refined temporal representations to do Need more refined temporal representations to do these.these.

Page 26: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

Temporal representation 2Temporal representation 2

Representing operator patternsRepresenting operator patterns

Meta-representation:Meta-representation:

situation calculussituation calculus

Time-point representation:Time-point representation:

event calculusevent calculus

Page 27: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

27

Representing operator patterns (1)Representing operator patterns (1)

SS00 still represents the initial situation. still represents the initial situation.

Representation of a situation resulting from an Representation of a situation resulting from an operator pattern: functor operator pattern: functor move/4move/4

ss move(x,y,z,move(x,y,z,ss))

Example: Example: move x from y to zmove x from y to z

x,y,z,x,y,z,ss on(x,y, on(x,y,ss) ) clear(x, clear(x,ss) ) clear(z, clear(z,ss) ) on(x,z,on(x,z,move(x,y,z,move(x,y,z,ss))))

clear(y,clear(y,move(x,y,z,move(x,y,z,ss))))

Effect on relating situations: example:Effect on relating situations: example:

=WE get =WE get MUCH LESSMUCH LESS different axioms! different axioms!

Page 28: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

28

Representing operator patterns (2)Representing operator patterns (2) Better represent other operator patterns with other Better represent other operator patterns with other

functors (to avoid confusion - and unification with functors (to avoid confusion - and unification with wrong ones). wrong ones).

ss movefromT(x,y,movefromT(x,y,ss))

ss movetoT(x,y,movetoT(x,y,ss))

move x from Table to ymove x from Table to y

move x from y to Tablemove x from y to Table

x,y,x,y,ss on(x,Table, on(x,Table,ss) ) clear(x, clear(x,ss) ) clear(y, clear(y,ss) )

on(x,y,on(x,y,movefromT(x,y,movefromT(x,y,ss))) )

Relating situations: example:Relating situations: example:

Still:Still: 3 such axioms + 6 frame axioms needed ! 3 such axioms + 6 frame axioms needed !

Page 29: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

29

The full theory:The full theory:

on(B,A,on(B,A,SS00) on(A,Table,) on(A,Table,SS00) clear(B,) clear(B,SS00))

x,y,z,x,y,z,ss on(x,y, on(x,y,ss) ) clear(x, clear(x,ss) ) clear(z, clear(z,ss) ) on(x,z,on(x,z,move(x,y,z,move(x,y,z,ss))) ) clear(y, clear(y,move(x,y,z,move(x,y,z,ss))))x,y,x,y,ss on(x,Table,s) on(x,Table,s) clear(x, clear(x,ss) ) clear(y, clear(y,ss) )

on(x,y,on(x,y,movefromT(x,y,movefromT(x,y,ss))))x,y,x,y,ss on(x,y, on(x,y,ss) ) clear(x, clear(x,ss) )

on(x,Table,on(x,Table,movetoT(x,y,movetoT(x,y,ss))) ) clear(y, clear(y,movetoT(x,y,movetoT(x,y,ss))) )

x,y,z,x,y,z,ss on(x,y, on(x,y,ss) ) ~y=Table ~y=Table ~x=z ~x=z ~on(z,y, ~on(z,y,ss))x,y,z,x,y,z,ss on(x,y, on(x,y,ss) ) ~y=z ~y=z ~on(x,z, ~on(x,z,ss))x,y,x,y,ss on(x,y, on(x,y,ss) ) ~y=Table ~y=Table ~clear(y, ~clear(y,ss))

Initial situation:Initial situation:

Consistency axioms:Consistency axioms:

New initiated properties for each action:New initiated properties for each action:

Page 30: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

30

The full theory (2)The full theory (2)

x,y,z,u,x,y,z,u,ss on(x,y, on(x,y,ss) ) clear(x, clear(x,ss) ) clear(z,clear(z,ss) ) clear(u, clear(u,ss) ) ~(u=z) ~(u=z) clear(u,clear(u,move(move(x,y,z,x,y,z,ss))))

x,y,z,u,v,x,y,z,u,v,ss on(x,y, on(x,y,ss) ) clear(x, clear(x,ss) ) clear(z,clear(z,ss) ) on(u,v, on(u,v,ss) ) ~(u=x ~(u=x v=y) v=y) on(u,v,on(u,v,move(move(x,y,z,x,y,z,ss))))

x,y,u,v,x,y,u,v,ss on(x,y, on(x,y,ss) ) clear(x, clear(x,ss) ) on(u,v,on(u,v,ss) ) ~(u=x ~(u=x v=y) v=y) on(u,v,on(u,v,movetoTable(movetoTable(x,y,x,y,ss))))

x,y,u,x,y,u,ss on(x,y, on(x,y,ss) ) clear(x, clear(x,ss) ) clear(u,clear(u,ss) )

clear(u,clear(u,movetoTable(movetoTable(x,y,x,y,ss))))

x,y,u,v,x,y,u,v,ss on(x,Table, on(x,Table,ss) ) clear(x, clear(x,ss) ) clear(y, clear(y,ss) ) on(u,v, on(u,v,ss) ) ~(u=x ~(u=x v=Table) v=Table) on(u,v, on(u,v,movefromTable(movefromTable(x,y,x,y,ss))))

x,y,u,x,y,u,ss on(x,Table, on(x,Table,ss) ) clear(x, clear(x,ss) ) clear(y, clear(y,ss) ) clear(u, clear(u,ss) ) ~(u=y) ~(u=y) clear(u, clear(u,movefromTable(movefromTable(x,y,x,y,ss))))

Frame axioms for “move x from y to z”Frame axioms for “move x from y to z”

Frame axioms for “move x from y to table”Frame axioms for “move x from y to table”

Frame axioms for “move x from Table to y”Frame axioms for “move x from Table to y”

Page 31: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

31

Difference with previous Difference with previous representation?representation?

on(B,A,on(B,A,SS00) on(A,Table,) on(A,Table,SS00) clear(B,) clear(B,SS00))

x,y,z,x,y,z,ss on(x,y, on(x,y,ss) ) ~y=Table ~y=Table ~x=z ~x=z ~on(z,y, ~on(z,y,ss))x,y,z,x,y,z,ss on(x,y, on(x,y,ss) ) ~y=z ~y=z ~on(x,z, ~on(x,z,ss))x,y,x,y,ss on(x,y, on(x,y,ss) ) ~y=Table ~y=Table ~clear(y, ~clear(y,ss))

Initial situation:Initial situation:

Consistency axioms:Consistency axioms:

No difference here!No difference here!

Page 32: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

32

Difference with previousDifference with previousrepresentation (2):representation (2):

x,y,z,x,y,z,ss on(x,y, on(x,y,ss) ) clear(x, clear(x,ss) ) clear(z, clear(z,ss) ) on(x,z,on(x,z,move(x,y,z,move(x,y,z,ss))) ) clear(y, clear(y,move(x,y,z,move(x,y,z,ss))))x,y,x,y,ss on(x,Table,s) on(x,Table,s) clear(x, clear(x,ss) ) clear(y, clear(y,ss) )

on(x,y,on(x,y,movefromT(x,y,movefromT(x,y,ss))))x,y,x,y,ss on(x,y, on(x,y,ss) ) clear(x, clear(x,ss) )

on(x,Table,on(x,Table,movetoT(x,y,movetoT(x,y,ss))) ) clear(y,clear(y,movetoT(x,y,movetoT(x,y,ss))) )

New initiated properties for each action:New initiated properties for each action:

Each of these for EVERY instance of x,y and z !Each of these for EVERY instance of x,y and z !

For N blocks: N ! times all these rules.For N blocks: N ! times all these rules.

Also for the frame axioms!Also for the frame axioms!

Page 33: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

Meta-representationMeta-representation

The Situation CalculusThe Situation Calculus

Page 34: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

34

Meta-representationMeta-representation

Is the frame axiom for on/2Is the frame axiom for on/2and for clear/1 combined in one !and for clear/1 combined in one !

on(x,y,on(x,y,ss)) holds(holds(on(x,y),on(x,y),ss))

Basic change in representation:Basic change in representation:

Why is this useful? Why is this useful? on/2on/2 now is a now is a termterm FOL allows to abstract terms by variables FOL allows to abstract terms by variables

(and quantify over them)(and quantify over them) FOL doesn’t allow abstraction of atoms or predicates !FOL doesn’t allow abstraction of atoms or predicates !

x,y,x,y,pp,,ss holds( holds(pp,,ss) ) ~ ~pp = = on(x,y)on(x,y) holds(holds(pp,,movetoT(x,y,movetoT(x,y,ss))))

Example:Example:

Could not be done with extra-argument representation.Could not be done with extra-argument representation.

Page 35: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

35

Meta-representation:Meta-representation:initial situationinitial situation

pp holds( holds(pp,,SS00) ) pp==on(B,A)on(B,A) pp==on(A,Table)on(A,Table) pp==clear(B)clear(B)

The initial situation:The initial situation:

holds(holds(pp,,SS00) ) initially( initially(pp))

initially(initially(pp)) p p==on(B,Aon(B,A) ) pp==on(A,Table)on(A,Table) pp==clear(B)clear(B)

A slightly better representation:A slightly better representation:

Page 36: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

36

Situation Names:Situation Names:final versionfinal version

S0

AABB

AA BB

move B move B from A to from A to TableTable

11

22

moveBATable(moveBATable(S0)

movetoT(B,A,movetoT(B,A,S0)

33

result(result(movetoT(B,A)movetoT(B,A),,S0)

Reason:Reason:

The The namename of the operator of the operatoris now a term that we canis now a term that we canabstract with a variableabstract with a variable

movetoT(B,A)movetoT(B,A)

Page 37: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

37

Formally: situation names:Formally: situation names:

move(x,y,z)move(x,y,z)movetoT(x,y)movetoT(x,y)movefromT(x,y)movefromT(x,y)

We introduce a separate term-representation We introduce a separate term-representation for operator patterns:for operator patterns:

Situations are now represented as: Situations are now represented as: result(result(oo,,ss)) , , where where oo is an operator pattern and is an operator pattern and ss a situation. a situation.

SS00 result(result(move(C,B,A),move(C,B,A),SS00))) ) result(result(movefromT(A,B)movefromT(A,B), result, result(movetoT(B,A),(movetoT(B,A),SS00))))……

Examples:Examples:

Page 38: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

38

Improvement ?Improvement ?

move(x,y,z)move(x,y,z)movetoT(x,y)movetoT(x,y)movefromT(x,y)movefromT(x,y)

Ontological improvementOntological improvement:: Now we can not only name Now we can not only name SITUATIONSSITUATIONS,,

we can ALSO name we can ALSO name OPERATOR PATTERNSOPERATOR PATTERNS..

AND abstract them by variables:AND abstract them by variables:

holds(holds(pp,,result(result(oo,s),s)) ) … …

Use:Use: we can now define we can now define if listif list, , add listadd list and and delete listdelete list of each operator pattern explicitly of each operator pattern explicitly with new predicates !with new predicates !

Page 39: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

39

If-list: legal/2 predicateIf-list: legal/2 predicate

if if on(x,y)on(x,y) clear(x)clear(x) clear(z)clear(z)add clear(y)add clear(y) on(x,z)on(x,z)delete on(x,y)delete on(x,y) clear(z)clear(z)

move x from y to zmove x from y to z

legal(legal(move(x,y,z)move(x,y,z),,ss) ) holds(holds(on(x,y)on(x,y),,ss) ) holds(holds(clear(x)clear(x),,ss) ) holds(holds(clear(z)clear(z),,ss) )

Move x from y to z:Move x from y to z:

legal(legal(movetoT(x,y)movetoT(x,y),,ss) ) holds(holds(on(x,y)on(x,y),,ss) ) holds(holds(clear(x)clear(x),,ss))

legal(legal(movefromT(x,y)movefromT(x,y),,ss) ) holds(holds(on(x,Table)on(x,Table),,ss) ) holds(holds(clear(x)clear(x),,ss) ) holds(holds(clear(y)clear(y),,ss) )

Others:Others:

Page 40: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

40

Add-list: initiates/2 predicateAdd-list: initiates/2 predicate

if on(x,y)if on(x,y) clear(x)clear(x) clear(z)clear(z)add add clear(y)clear(y) on(x,z)on(x,z)delete on(x,y)delete on(x,y) clear(z)clear(z)

move x from y to zmove x from y to z

initiates(initiates(move(x,y,z)move(x,y,z),,pp) ) p p = = clear(y) clear(y) p p == on(x,z) on(x,z)

Move x from y to z:Move x from y to z:

initiates(initiates(movetoT(x,y,z)movetoT(x,y,z),,pp) ) p p = = on(x,Table)on(x,Table) p p = = clear(y)clear(y)

initiates(initiates(movefromT(x,y,z)movefromT(x,y,z),,pp) ) p p = = on(x,y)on(x,y)

Others:Others:

Page 41: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

41

Delete-list: terminates/2 Delete-list: terminates/2 predicate:predicate:

if on(x,y)if on(x,y) clear(x)clear(x) clear(z)clear(z)add clear(y)add clear(y) on(x,z)on(x,z)delete delete on(x,y)on(x,y) clear(z)clear(z)

move x from y to zmove x from y to z

terminates(terminates(movetoT(x,y)movetoT(x,y),,pp) ) p p = = on(x,y)on(x,y)

terminates(terminates(movefromT(x,y)movefromT(x,y),,pp) ) p p = = on(x,Table)on(x,Table) p p = = clear(y)clear(y)

Others:Others:

terminates(terminates(move(x,y,z)move(x,y,z),,pp) ) p p = = on(x,y)on(x,y) p p = = clear(z)clear(z)

Move x from y to z:Move x from y to z:

Page 42: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

42

What is gained ?What is gained ?The Situation Calculus!The Situation Calculus!

only 1 rule !only 1 rule !

only 1 rule !only 1 rule !

holds(holds(pp,,SS00) ) initially( initially(pp))

+ the initialization rule:+ the initialization rule:

holds(holds(pp,,result(result(oo,s),s)) ) holds(holds(pp,,ss) ) legal( legal(oo,,ss) ) ~terminates( ~terminates(oo,,pp))

The frame axiom:The frame axiom:

holds(holds(pp,,result(result(oo,s),s)) ) legal( legal(oo,,ss) ) initiates( initiates(oo,,pp))

Positive effects of actions:Positive effects of actions:

Page 43: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

43

Problem independenceProblem independence

holds(holds(pp,,SS00) ) initially( initially(pp) ) holds(holds(pp,,result(result(oo,s),s)) ) legal( legal(oo,,ss) ) initiates( initiates(oo,,pp))holds(holds(pp,,result(result(oo,s),s)) ) holds(holds(pp,,ss) ) legal( legal(oo,,ss) ) ~terminates( ~terminates(oo,,pp))

Observe that these axioms defining ‘Observe that these axioms defining ‘holdsholds’ are ’ are problem independentproblem independent

and can be applied to and can be applied to any planning problemany planning problem..

For each new planning problem: only For each new planning problem: only initiallyinitially, , legallegal, , initiatesinitiates and and terminatesterminates need to be defined need to be defined !!

These correspond to the initial situation and to These correspond to the initial situation and to the if- add- and delete-lists of operator patterns.the if- add- and delete-lists of operator patterns.

Page 44: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

44

Planning:Planning:

false false holds( holds(pp11,,ss) ) … … holds( holds(ppnn,,ss))

A goal of the type:A goal of the type:

should be added, where should be added, where pp11,…,p,…,pnn are the properties are the properties that should hold in the goal situation.that should hold in the goal situation.

Deduction proceeds similarly to what was Deduction proceeds similarly to what was presented in the presented in the extra-argumentextra-argument representation. representation.

In particular; the final value for In particular; the final value for ss in the unifier in the unifier is is the planthe plan ! !

Page 45: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

45

Completion and consistencyCompletion and consistency Note that all formulae are essentially Horn clauses Note that all formulae are essentially Horn clauses

(possibly extended with negation in the bodies - (possibly extended with negation in the bodies - case: ~terminates).case: ~terminates).

holds(holds(pp,,result(result(oo,s),s)) ) holds(holds(pp,,ss) ) legal( legal(oo,,ss) ) ~terminates( ~terminates(oo,,pp))

Disjunctions in bodies are readily transformed to a Disjunctions in bodies are readily transformed to a set of Horn clauses.set of Horn clauses.

terminates(terminates(move(x,y,z)move(x,y,z),,pp) ) p p = = on(x,y)on(x,y) p p = = clear(z)clear(z)

terminates(terminates(move(x,y,z)move(x,y,z),,pp) ) p p = = on(x,y)on(x,y) terminates(terminates(move(x,y,z)move(x,y,z),,pp) ) p p = = clear(z)clear(z)

Page 46: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

46

Completion and consistency (2)Completion and consistency (2)

Assume that this description is complete (anything Assume that this description is complete (anything else than described is false !), then we can else than described is false !), then we can interpret these Horn clauses as a Logic program.interpret these Horn clauses as a Logic program.

Consequence:Consequence: the the consistency axiomsconsistency axioms are are no longer neededno longer needed::

Requires that we understand ~holds(Requires that we understand ~holds(pp,,ss) as holds(~) as holds(~pp,,ss),), then information such as then information such as holds(holds(~on(B,Table)~on(B,Table) ,,SS00))

follows from our specification.follows from our specification.

Page 47: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

Meta-representation (2)Meta-representation (2)

The Event CalculusThe Event Calculus

Page 48: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

48

Using time points:Using time points:

Time pointsTime points Situation namesSituation names

Extra argumentExtra argument

Meta-predicateMeta-predicate

on(A,B,T)on(A,B,T) on(A,B,S)on(A,B,S)

holds(on(A,B),T)holds(on(A,B),T) holds(on(A,B),S)holds(on(A,B),S)

Alternative to situations:Alternative to situations:

Ontology:Ontology: something holds on a specific moment in something holds on a specific moment in time.time.

Page 49: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

49

The main axioms:The main axioms:

Where the concepts: Where the concepts: initially/1initially/1, , initiates/2initiates/2 and and terminates/2terminates/2 are the same as before (and problem are the same as before (and problem dependent), and dependent), and legal/2legal/2 is completely similar as is completely similar as before,but defined in terms of before,but defined in terms of holds(holds(pp,,tt)) instead of instead of holds(holds(pp,,ss)) . .

holds(holds(pp,,tt) ) initiated( initiated(pp,,t’t’) ) t’t’ < < tt ~clipped(~clipped(pp,,t’t’,,tt))initiated(initiated(pp,,tt00) ) initially( initially(pp))initiated(initiated(pp,,tt) ) event( event(oo,,tt) ) legal( legal(oo,,tt) ) initiates(initiates(oo,,pp))

clipped(clipped(pp,,t’t’,,tt) ) t’t’ < < ss ss < < tt event(event(oo,,ss) ) legal(legal(oo,,ss) ) terminates( terminates(oo,,pp))

tt00 < < tt ~ ~tt00==tt

Page 50: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

50

Event calculus pictured:Event calculus pictured:

tt00

on(A,B)on(A,B)

tt

on(A,B) on(A,B) isisstill true if still true if it was not it was not undone.undone.nothing here ‘clips’nothing here ‘clips’

tt00

on(A,B)on(A,B)

tt

on(A,B) on(A,B) isisstill true if still true if it was not it was not undone.undone.

t’t’nothing ‘clips’nothing ‘clips’

When does something hold at time t ?When does something hold at time t ? If is was true from the beginning and not ‘clipped’:If is was true from the beginning and not ‘clipped’:

If something happened to make it true and not If something happened to make it true and not ‘clipped’:‘clipped’:

Page 51: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

51

The event calculusThe event calculus The new elements in this ontology: The new elements in this ontology:

Temporal identification through time points instead of Temporal identification through time points instead of situations.situations.

The relation </2 should be defined as a The relation </2 should be defined as a (strict)(strict) partial partial order order (the temporal order on time points)(the temporal order on time points) . .

There is now only 1 definition of holds !!There is now only 1 definition of holds !! This includes: the initial situation + relating situations This includes: the initial situation + relating situations

+ the frame axioms!+ the frame axioms!

In In situations calculussituations calculus situations are related to the situations are related to the previous situation previous situation

In In event calculusevent calculus they are related to they are related to somesome previous moment in time that previous moment in time that initiated initiated something something (which hasn’t been (which hasn’t been clippedclipped). ).

Allows to make bigger steps than just 1 at a time.Allows to make bigger steps than just 1 at a time.

Page 52: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

52

holds(holds(pp,,tt) ) initiated( initiated(pp,,t’t’) ) t’t’ < < tt ~clipped( ~clipped(pp,,t’t’,,tt))

initiated(initiated(pp,,tt00) ) initially( initially(pp))initiated(initiated(pp,,tt) ) event( event(oo,,tt) ) legal( legal(oo,,tt) ) initiates(initiates(oo,,pp))

clipped(clipped(pp,t’,t) ,t’,t) t’t’ < < ss ss < < tt event( event(oo,,ss) ) legal(legal(oo,,ss) ) terminates( terminates(oo,,pp))

Relation to planning?Relation to planning?

A plan in this representation is a set of atoms:A plan in this representation is a set of atoms:

event(event(OO11,,TT11) event() event(OO22,,TT22) event() event(OO33,,TT33) ) ....

where each where each OOii is an operator, each is an operator, each TTii a time point, a time point, TTii < < TTi+1i+1 and and executing executing OO11, , OO22, , OO33,… in sequence in the initial state gives the goal ,… in sequence in the initial state gives the goal state.state. But how can we get this plan from a goal like:But how can we get this plan from a goal like:

tt holds( holds(on(A,Table)on(A,Table) , ,tt))

We We CAN NOTCAN NOT (deductively) !!!! (deductively) !!!!

Page 53: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

53

Rela

tion t

o p

lannin

g (

2)

Rela

tion t

o p

lannin

g (

2)

D

ed

uct

ion

fro

m a

goal:

Ded

uct

ion

fro

m a

goal:

n

eed

s to

go t

hro

ug

h

need

s to

go t

hro

ug

h in

itia

ted

/2in

itia

ted

/2..

U

nle

ss t

he g

oal w

as

alr

ead

y s

ati

sfied

U

nle

ss t

he g

oal w

as

alr

ead

y s

ati

sfied

in

th

e in

itia

l st

ate

, th

is r

eq

uir

es

in t

he in

itia

l st

ate

, th

is r

eq

uir

es

even

t/2

even

t/2 f

act

s to

hold

! f

act

s to

hold

!

Bu

t th

ere

is

Bu

t th

ere

is

NO

defin

itio

nN

O d

efin

itio

n f

or

for

even

t/2

even

t/2::

T

his

pre

dic

ate

is

the o

bje

ct o

f ou

r Th

is p

red

icate

is

the o

bje

ct o

f ou

r se

arc

h !

!se

arc

h !

!

SO

:S

O:

is

not

a log

ical co

nse

qu

en

ce o

f th

e

is n

ot

a log

ical co

nse

qu

en

ce o

f th

e

even

t ca

lcu

lus

theory

. even

t ca

lcu

lus

theory

.

It

is n

ot

tru

e in

It

is

not

tru

e in

ALL

ALL

mod

els

. m

od

els

.

hold

s(h

old

s(pp

,, tt)

)

in

itia

ted

( in

itia

ted

( pp,, t

’t’) )

t’t’ <

<

tt

~cl

ipp

ed

(~

clip

ped

( pp,, t

’t’,, tt

))

init

iate

d(

init

iate

d( pp

,, tt00)

)

in

itia

lly(

in

itia

lly( pp

))in

itia

ted

(in

itia

ted

( pp,, tt

)

)

even

t( e

ven

t(oo,, tt

) )

leg

al(

leg

al(oo,, tt

) )

in

itia

tes(

init

iate

s(oo,, pp

))

tt

hold

s( h

old

s(on(A

,Table

)on(A

,Table

) , ,tt ))

Page 54: PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2

54

SO

: th

e g

oal:

SO

: th

e g

oal:

is

not

true in a

ll m

odels

.is

not

true in a

ll m

odels

.

B

UT

BU

T : if

there

exis

ts a

model

: if t

here

exis

ts a

model (

wit

h

(wit

h

som

e e

vent/

2 f

act

s tr

ue)

som

e e

vent/

2 f

act

s tr

ue)

in w

hic

h t

he

in w

hic

h t

he

goal is

als

o t

rue, th

en t

he t

rue e

vent/

2

goal is

als

o t

rue, th

en t

he t

rue e

vent/

2

ato

ms

in t

hat

model giv

e u

s th

e p

lan.

ato

ms

in t

hat

model giv

e u

s th

e p

lan.

M

odel-

genera

tion t

ech

niq

ues!

Model-

genera

tion t

ech

niq

ues!

O

r alt

ern

ati

vely

: O

r alt

ern

ati

vely

: ab

duct

ive r

easo

nin

g

ab

duct

ive r

easo

nin

g

tech

niq

ues.

tech

niq

ues.

M

eanin

gM

eanin

g:

find

a s

et

of

hyp

oth

esi

s :

find

a s

et

of

hyp

oth

esi

s

of of event/

2event/

2 a

tom

s su

ch t

hat:

a

tom

s su

ch t

hat:

Model genera

tion

Model genera

tion

tt

hold

s( h

old

s(on(A

,Table

)on(A

,Table

) , ,tt ))

tt

hold

s( h

old

s(on(A

,Table

)on(A

,Table

) , ,tt ))

Theory

enta

ilsTheory

enta

ils