On Ability to Autonomously Execute Agent Programs with Sensing - - PowerPoint PPT Presentation

on ability to autonomously execute agent programs with
SMART_READER_LITE
LIVE PREVIEW

On Ability to Autonomously Execute Agent Programs with Sensing - - PowerPoint PPT Presentation

On Ability to Autonomously Execute Agent Programs with Sensing Sebastian Sardi na Giuseppe De Giacomo Dept. of Computer Science Dip. Informatica e Sistemistica University of Toronto Univer. di Roma La Sapienza


slide-1
SLIDE 1

On Ability to Autonomously Execute Agent Programs with Sensing

Sebastian Sardi˜ na

  • Dept. of Computer Science

University of Toronto ssardina@cs.toronto.edu

Giuseppe De Giacomo

  • Dip. Informatica e Sistemistica
  • Univer. di Roma “La Sapienza”

degiacomo@dis.uniroma1.it

Yves Lesp´ erance

  • Dept. of Computer Science

York University lesperan@cs.yorku.ca

Hector J. Levesque

  • Dept. of Computer Science

University of Toronto hector@cs.toronto.edu http://www.cs.toronto.edu/∼cogrobo

slide-2
SLIDE 2

Motivation

Agent programming languages should support planning/deliberation under incomplete information with sensing actions. Need a spec. for this. Most existing formal models of deliberation are epistemic, while agent programming languages have transition system semantics. Hard to relate. Here, develop new non-epistemic formal model of deliberation. Set within situation calculus and IndiGolog. But important lessons for agent programming languages in general.

1

slide-3
SLIDE 3

Situation Calculus

  • A dialect of the predicate calculus with sorts for actions and situations
  • Actions: open, look, dial(14), go(Airport), check departures, ...
  • Situations:

– S0 the initial situation – do(a, s) where a is an action term and s is a situation

  • Fluents: predicates/functions whose value changes from situation to situation:

Locked(S0) ∧ ¬Locked(do(dial(2), S0))

  • Use a distinguished predicate Poss(a, s) to assert that it is possible to execute

action a in situation s

2

slide-4
SLIDE 4

High-Level Deterministic Programs

a, primitive action δ1; δ2, sequence if φ then δ1 else δ2 endIf, conditional while φ do δ endWhile, while loop

3

slide-5
SLIDE 5

High-Level Deterministic Programs

a, primitive action δ1; δ2, sequence if φ then δ1 else δ2 endIf, conditional while φ do δ endWhile, while loop GetOnFlightDetailed

def

= go(Airport); check departures; % sensing action if Parked(Flight123, GateA) then go(GateA); board plane(Flight123) else go(GateB); board plane(Flight123) endIf Without sensing, goal cannot be achieved!

3

slide-6
SLIDE 6

High-Level Programs and Histories

A history σ = (a1, µ1), (a2, µ2), ..., (an, µn) describes a run with actions and their sensing results; e.g.: (go(Airport), 1) · (check departures, 0) · (go(GateB), 1). A configuration is a pair (δ, σ) with a program δ and a history σ specifying the actions performed so far and the sensing results obtained.

4

slide-7
SLIDE 7

High-Level Programs and Histories

A history σ = (a1, µ1), (a2, µ2), ..., (an, µn) describes a run with actions and their sensing results; e.g.: (go(Airport), 1) · (check departures, 0) · (go(GateB), 1). A configuration is a pair (δ, σ) with a program δ and a history σ specifying the actions performed so far and the sensing results obtained. Sensed[σ] stands for formula specifying the sensing results of history σ, e.g.: SF(go(Airport), S0) ∧ ¬SF(check departures, do(go(Airport), S0)) ∧ SF(go(GateB), do(check departures, do(go(Airport), S0))) end[σ] stands for the situation term of history, σ, e.g.: end[ǫ] = S0 and end[(go(Airport), 1)] = do(go(Airport), S0)

4

slide-8
SLIDE 8

IndiGolog Semantics for Online Executions

Two relations in the object language: Trans(δ, s, δ′, s′): means that it can make transition (δ, s) → (δ′, s′) by executing a single primitive action or test. Final(δ, s): means that computation can be terminated in (δ, s)

5

slide-9
SLIDE 9

IndiGolog Semantics for Online Executions

Two relations in the object language: Trans(δ, s, δ′, s′): means that it can make transition (δ, s) → (δ′, s′) by executing a single primitive action or test. Final(δ, s): means that computation can be terminated in (δ, s) Semantics based on two notions (relative to an underlying theory of action D):

  • Configuration (δ, σ) may evolve to (δ′, σ′) w.r.t. a model M.
  • A configuration (δ, σ) is final, i.e. may legally terminate.

5

slide-10
SLIDE 10

IndiGolog Semantics for Online Executions

Two relations in the object language: Trans(δ, s, δ′, s′): means that it can make transition (δ, s) → (δ′, s′) by executing a single primitive action or test. Final(δ, s): means that computation can be terminated in (δ, s) Semantics based on two notions (relative to an underlying theory of action D):

  • Configuration (δ, σ) may evolve to (δ′, σ′) w.r.t. a model M.
  • A configuration (δ, σ) is final, i.e. may legally terminate.

The theory D, augmented with the sensing results in σ, must entail that the transition is possible. Model M above represents a possible environment (generate sensing results.)

5

slide-11
SLIDE 11

IndiGolog Semantics for Online Executions — Formal Details

Configuration (δ, σ) may evolve to (δ′, σ′) w.r.t. a model M (relative to an underlying theory of action D) iff (i) M is a model of D ∪ {Sensed[σ]}, and (ii) D ∪ T ∪ {Sensed[σ]} | = Trans(δ, s, δ′, s′), and (iii) σ′ =            σ · (a, 1) if s′ = do(a, s) and M | = SF(a, s), σ · (a, 0) if s′ = do(a, s) and M | = SF(a, s), σ if s′ = s, where s = end[σ] and s′ = end[σ′]. Configuration (δ, σ) is final when: D ∪ T ∪ {Sensed[σ]} | = Final(δ, end[σ])

6

slide-12
SLIDE 12

Deliberation: An EC-based Account

The idea: An agent can/knows how to execute program δ in history σ iff he can always choose a next action/transition and eventually reach a terminating configuration no matter what sensing results are

  • btained.

Agent must know that the chosen action/transition is allowed by the program and is executable. In what follows, we we will define KHowEC(δ, σ) using both entailment and consistency.

7

slide-13
SLIDE 13

Deliberation: An EC-based Account (cont.)

We define KHowEC(δ, σ) to be the smallest relation R(δ, σ) such that:

8

slide-14
SLIDE 14

Deliberation: An EC-based Account (cont.)

We define KHowEC(δ, σ) to be the smallest relation R(δ, σ) such that: (E1) if (δ, σ) is final, then R(δ, σ);

8

slide-15
SLIDE 15

Deliberation: An EC-based Account (cont.)

We define KHowEC(δ, σ) to be the smallest relation R(δ, σ) such that: (E1) if (δ, σ) is final, then R(δ, σ); (E2) if (δ, σ) may evolve to configurations (δ′, σ · (a, µi)) w.r.t. some models Mi with i = 1..k for some k ≥ 1, and R(δ′, σ · (a, µi)) holds for all i = 1..k, then R(δ, σ). Obs.: always consider the underlying theory plus the observations in history σ.

8

slide-16
SLIDE 16

E.g. Tree Chopping Problem

Agent wants to cut down a tree. Possible actions are:

  • chop, take one chop at the tree, and
  • look, which tells the agent whether the tree has fallen (i.e., senses fluent Down).

It is known that tree will eventually fall, but number of chops needed is not bounded.

9

slide-17
SLIDE 17

E.g. Tree Chopping Problem

Agent wants to cut down a tree. Possible actions are:

  • chop, take one chop at the tree, and
  • look, which tells the agent whether the tree has fallen (i.e., senses fluent Down).

It is known that tree will eventually fall, but number of chops needed is not bounded. Intuitively, the following program δtc: while ¬Down do chop; look endWhile solves the problem. But . . .

9

slide-18
SLIDE 18

Formalizing the Tree Chopping E.g.: Dtc

  • Dss contains the following successor state axiom:

RemainingChops(do(a, s)) = n ≡ a = chop ∧ RemainingChops(s) = n + 1 ∨ a = chop ∧ RemainingChops(s) = n.

  • Dap contains the following 2 precondition axioms:

Poss(chop, s) ≡ (RemainingChops(s) > 0), Poss(look, s) ≡ True.

  • Dsf contains the following sensing axiom:

SF(look, s) ≡ (RemainingChops(s) = 0).

  • DS0 = {RemainingChops(S0) > 0} (initial situation).

Down(s)

def

= (RemainingChops(s) = 0).

10

slide-19
SLIDE 19

Tree Chopping E.g. (cont.)

Intuitively, the following program δtc: while ¬Down do chop; look endWhile solves the problem. But . . .

11

slide-20
SLIDE 20

Tree Chopping E.g. (cont.)

Intuitively, the following program δtc: while ¬Down do chop; look endWhile solves the problem. But . . . Theorem 1. For all k ∈ N, KHowEC(δtc, [(chop, 1) · (look, 0)]k) does not hold. In particular, when k = 0, KHowEC(δtc, ǫ) does not hold. In fact, ...

11

slide-21
SLIDE 21

Tree Chopping E.g. (cont.)

Intuitively, the following program δtc: while ¬Down do chop; look endWhile solves the problem. But . . . Theorem 1. For all k ∈ N, KHowEC(δtc, [(chop, 1) · (look, 0)]k) does not hold. In particular, when k = 0, KHowEC(δtc, ǫ) does not hold. In fact, ... Theorem 2. Whenever KHowEC(δ, σ) holds, there is simple kind of conditional plan, a TREE program, that can be followed to execute δ in σ. which means that ...

11

slide-22
SLIDE 22

Tree Chopping E.g. (cont.)

Intuitively, the following program δtc: while ¬Down do chop; look endWhile solves the problem. But . . . Theorem 1. For all k ∈ N, KHowEC(δtc, [(chop, 1) · (look, 0)]k) does not hold. In particular, when k = 0, KHowEC(δtc, ǫ) does not hold. In fact, ... Theorem 2. Whenever KHowEC(δ, σ) holds, there is simple kind of conditional plan, a TREE program, that can be followed to execute δ in σ. which means that ... Corollary 1. KHowEC is only correct when problem has a bounded solution

11

slide-23
SLIDE 23

Why does KHowEC Fail?

δtc [ ]

look ; δtc look ; δtc look ; δtc

δtc δtc

(chop, 1) (chop, 1) (chop, 1) (chop, 1) (chop, 1) (chop, 1) (chop, 1) (chop, 1) (chop, 1) (chop, 1) (chop, 1) (chop, 1) (chop, 1) (chop, 1) (chop, 1) (look, 0) (look, 0) (look, 0) (look, 0) (look, 0) (look, 0) (look, 0) (look, 0) (look, 0) (look, 1) (look, 1) (look, 1)

δtc δtc δtc 1 1 1

chop chop chop look look look δtc

def

= while ¬Down do chop; look endWhile

12

slide-24
SLIDE 24

Why does KHowEC Fail?

δtc ↓ chop look; δtc If KHowEC(δtc, ǫ), then for all j ∈ N: KHowEC(δtc, ((chop, 1) · (look, 0))j) and KHowEC(look; δtc, ((chop, 1)·(look, 0))j·(chop, 1)). KHowEC is “taking into account” the execution where three never comes down! Every finite prefix of the execution is consistent with Dtc. But, the set of all of them together is not!

13

slide-25
SLIDE 25

Why does KHowEC Fail?

δtc ↓ chop look; δtc − → δtc √ ↓ look, 0 look, 1 If KHowEC(δtc, ǫ), then for all j ∈ N: KHowEC(δtc, ((chop, 1) · (look, 0))j) and KHowEC(look; δtc, ((chop, 1)·(look, 0))j·(chop, 1)). KHowEC is “taking into account” the execution where three never comes down! Every finite prefix of the execution is consistent with Dtc. But, the set of all of them together is not!

13

slide-26
SLIDE 26

Why does KHowEC Fail?

δtc ↓ chop look; δtc − → δtc √ ↓ look, 0 look, 1 δtc ↓ chop If KHowEC(δtc, ǫ), then for all j ∈ N: KHowEC(δtc, ((chop, 1) · (look, 0))j) and KHowEC(look; δtc, ((chop, 1)·(look, 0))j·(chop, 1)). KHowEC is “taking into account” the execution where three never comes down! Every finite prefix of the execution is consistent with Dtc. But, the set of all of them together is not!

13

slide-27
SLIDE 27

Why does KHowEC Fail?

δtc ↓ chop look; δtc − → δtc √ ↓ look, 0 look, 1 δtc ↓ chop look; δtc − → δtc √ ↓ look, 0 look, 1 . . . If KHowEC(δtc, ǫ), then for all j ∈ N: KHowEC(δtc, ((chop, 1) · (look, 0))j) and KHowEC(look; δtc, ((chop, 1)·(look, 0))j·(chop, 1)). KHowEC is “taking into account” the execution where three never comes down! Every finite prefix of the execution is consistent with Dtc. But, the set of all of them together is not!

13

slide-28
SLIDE 28

Why does KHowEC Fail?

δtc ↓ chop look; δtc − → δtc √ ↓ look, 0 look, 1 δtc ↓ chop look; δtc − → δtc √ ↓ look, 0 look, 1 . . . If KHowEC(δtc, ǫ), then for all j ∈ N: KHowEC(δtc, ((chop, 1) · (look, 0))j) and KHowEC(look; δtc, ((chop, 1)·(look, 0))j·(chop, 1)). KHowEC is “taking into account” the execution where three never comes down! Every finite prefix of the execution is consistent with Dtc. But, the set of all of them together is not!

13

slide-29
SLIDE 29

Deliberation: ET-based Account

To solve the problem, we consider each environment/model individually. We define KHowInM(δ, σ, M) to be the smallest relation R(δ, σ) such that:

14

slide-30
SLIDE 30

Deliberation: ET-based Account

To solve the problem, we consider each environment/model individually. We define KHowInM(δ, σ, M) to be the smallest relation R(δ, σ) such that: (T1) if (δ, σ) is final, then R(δ, σ);

14

slide-31
SLIDE 31

Deliberation: ET-based Account

To solve the problem, we consider each environment/model individually. We define KHowInM(δ, σ, M) to be the smallest relation R(δ, σ) such that: (T1) if (δ, σ) is final, then R(δ, σ); (T2) if (δ, σ) may evolve to (δ′, σ ·(a, µ)) w.r.t. M and R(δ′, σ ·(a, µ)), then R(δ, σ). Uses truth in a model!

14

slide-32
SLIDE 32

Deliberation: ET-based Account (cont.)

KHowET(δ, σ): iff it knows how to execute it in every model of the history (i.e., in every possible environment). Formally: KHowET(δ, σ) iff for every model M such that M | = D ∪ {Sensed[σ]}, KHowInM(δ, σ, M) holds.

15

slide-33
SLIDE 33

Deliberation: ET-based Account (cont.)

KHowET(δ, σ): iff it knows how to execute it in every model of the history (i.e., in every possible environment). Formally: KHowET(δ, σ) iff for every model M such that M | = D ∪ {Sensed[σ]}, KHowInM(δ, σ, M) holds. KHowET handles the tree chopping example: KHowET(δtc, ǫ) holds!

15

slide-34
SLIDE 34

Generalizing to Non-deterministic Programs

Two possible approaches:

  • Angelic: choices are under the control of the agent (deliberation);
  • Demoniac: choices are not under the control of the agent (execution).

KHowAng

ET nd(δ, σ)

iff there is a deterministic program δd such that KHowET(δd, σ) holds, and D ∪ T ∪ {Sensed[σ]} | = ∃s.Do(δd, end[σ], s) ∧ Do(δ, end[σ], s).

16

slide-35
SLIDE 35

Further Issues

  • KHowX can be used to define agent ability CanX(φ, σ).
  • Angelic version for nondeterministic programs can be used to define a meta-

theoretic account of deliberation (i.e., search construct in IndiGolog).

  • Relation KHowET

corresponds exactly to effective controllers and robot programs as described in [Lin and Levesque 1998]. Hence, it is both sound and complete w.r.t. robot achievability.

17

slide-36
SLIDE 36

Lessons for Agent Programming Languages

Most agent programming languages have transition semantics and use entailment to evaluate tests and action preconditions (e.g., ConGolog, 3APL, FLUX, etc.). Most agent programming languages only do on-line reactive execution; no deliberation/lookahead. Deliberation is only a different control regime involving search over the agent program’s transition tree. With sensing, need to find more than just a path to a final configuration, need a plan/subtree with branches for all possible sensing results. Can determine possible sensing results by checking consistency with KB. Essentially an EC-based approach.

18

slide-37
SLIDE 37

Lessons for Agent Programming Languages (cont.)

As methods for implementing deliberation in restricted cases, EC-based approaches are fine. But as a semantics or specification, we claim they are wrong. ⇓

19

slide-38
SLIDE 38

Lessons for Agent Programming Languages (cont.)

As methods for implementing deliberation in restricted cases, EC-based approaches are fine. But as a semantics or specification, we claim they are wrong. ⇓ KHowEC gives the wrong results on problems that can’t be solved in a bounded number of actions. What’s required is something like our ET-based account.

19

slide-39
SLIDE 39

Summary

Agent programming languages should support planning/deliberation under incomplete information with sensing actions. We develop some non-epistemic formal models of deliberation. The obvious model is one where agent makes decisions about what to do in terms of what is entailed by or consistent with his KB. This model doesn’t work properly for problems that have no bounded solution and require iteration. We propose an alternative entailment and truth-based model that works. There are important lessons for agent programming languages in general.

20

slide-40
SLIDE 40

Further Research

Relate this metatheoretic account of deliberation to epistemic ones. Re-state everything in terms of other agent formalisms: 3APL, AgentSpeak, FLUX, etc. Implementation of search/planning with non-binary sensing actions. More general accounts of sensing and knowledge change. Multiagent planning. Etc.

21

slide-41
SLIDE 41

Related Work

  • [Moore 1985]: knowledge and plans.
  • [Davis 1994]: Knowledge precondition for plans (executable plans).
  • [Davis & Morgenstern 2004]: A First-Order Theory of Communication and

Multi-Agent Plans.

  • [Mc Illraith & Son 2002]: self-sufficient programs.
  • Lin & Levesque 1998]: robot programs and effective controllers.

22