An Operational Semantics for a Fragment of PRS IJCAI 2018 - - PowerPoint PPT Presentation

an operational semantics for a fragment of prs
SMART_READER_LITE
LIVE PREVIEW

An Operational Semantics for a Fragment of PRS IJCAI 2018 - - PowerPoint PPT Presentation

An Operational Semantics for a Fragment of PRS IJCAI 2018 Stockholm, Sweden Lavindra de Silva 1 Felipe Meneguzzi 2 Brian Logan 3 1 University of Nottingham, UK lavindra.desilva@nottingham.ac.uk 2 Pontifical Catholic University of Rio Grande do


slide-1
SLIDE 1

An Operational Semantics for a Fragment of PRS

IJCAI 2018 Stockholm, Sweden Lavindra de Silva 1 Felipe Meneguzzi2 Brian Logan3

1University of Nottingham, UK

lavindra.desilva@nottingham.ac.uk

2Pontifical Catholic University of Rio Grande do Sul, Brazil

felipe.meneguzzi@pucrs.br

3University of Nottingham, Nottingham, UK

brian.logan@nottingham.ac.uk

July 18, 2018

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 1 / 13

slide-2
SLIDE 2

Motivation

1

Motivation

2

Syntax

3

Semantics

4

Key Properties

5

Discussion

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 2 / 13

slide-3
SLIDE 3

Motivation

Motivation

PRS is a seminal reasoning system:

it is one of the first practical implementations of BDI systems; it is widely used in robotics today; it influenced most subsequent agent programming languages;

agents community generally believe it to be more expressive; yet no precise formalisation of the language.

We aim to fill these gaps to allow comparison of PRS with its successors CAN AgentSpeak Golog X-BDI JACK dMARS

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 2 / 13

slide-4
SLIDE 4

Motivation

Key Contribution

We formalise a significant fragment of PRS

graph-based plan bodies; language constructs to wait for and preserve maintenance goals, reasoning rules to operationalise such constructs, including:

adopt, suspend, resume, and abort possibly nested goals

We use the formalisation to prove key properties of PRS most importantly:

CAN style plan-rules can be directly translated to PRS graph notation PRS plan-body graphs cannot be directly translated to CAN

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 3 / 13

slide-5
SLIDE 5

Syntax

Agent Structure

Belief base (B) Action-library (Λ) containing actions:

act( v):ψ ← Φ+; Φ− STRIPS style action-rules with precondition and positive/negative effects

Plan-library (Π) containing plan-rules

e( t):ϕ ; ψ ← G Plan-rules contain three key parts:

an event-goal e( t) – stating when the plan is relevant an optional goal-condition ϕ – describing what the plan achieves a context condition ψ – describing when the plan is applicable a plan-body graph G – what the agent executes

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 4 / 13

slide-6
SLIDE 6

Syntax

Plan-body graphs

Plan body-graphs comprise two key structures:

user programs, including:

actions (from the action-library) belief addition/removal (+b,−b) tests (?φ) event-goal or goal-condition programs (!ev, or !φ) wait (WT(φ)) passive or active preserve (PRp(!ev, φ), or PRa(!ev, φ))

a directed bipartite graph split into:

state nodes transition nodes (labelled with programs) s2 s1 s0 walk(d) ?At(d) !pw s3

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 5 / 13

slide-7
SLIDE 7

Syntax

Example Graphs

Gwalk travelTo(dest) : At(x) ∧ WalkDist(x, dest) ← Gwalk Gpw Within Gwalk, event !pw leads to executing the following rule: !pw : ⊤ ← Gpw Gwalk

s2 s1 s0 walk(d) ?At(d) !pw s3

Gpw

s8 ?⊤ !ev2 P 1

pw

P 2

pw

s0 s6 s5 s4 s7

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 6 / 13

slide-8
SLIDE 8

Syntax

Running Example

Example The agent has the following plan rules used to address the subgoal travelTo(dest) to go from the current location to the destination location dest: travelTo(dest) : At(x) ∧ WalkDist(x, dest) ← Gwalk travelTo(dest) : At(x) ∧ ∃y(InCity(x, y) ∧ InCity(dest, y)) ← Gcity travelTo(dest) : At(x) ∧ ¬∃y(InCity(x, y) ∧ InCity(dest, y)) ← Gfar travelTo(dest) : ⊤ ← Ghome

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 7 / 13

slide-9
SLIDE 9

Semantics

Semantics of Plan-Body Graphs

Example Agent receives event: !travelTo(Uni)

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 8 / 13

slide-10
SLIDE 10

Semantics

Semantics of Plan-Body Graphs

Example Agent receives event: !travelTo(Uni) Current Plan: !travelTo(Uni) : ψ1 : Gwalk, ψ2 : Gcity, ψ3 : Gfar, where: ψ1 =At(x) ∧ WalkDist(x, Uni) ψ2 =At(x) ∧ ∃y(InCity(x, y) ∧ InCity(Uni, y)) ψ3 =At(x) ∧ ¬∃y(InCity(x, y) ∧ InCity(Uni, y))

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 8 / 13

slide-11
SLIDE 11

Semantics

Semantics of Plan-Body Graphs

Example Agent receives event: !travelTo(Uni) Current Plan: !travelTo(Uni) : ψ1 : Gwalk, ψ2 : Gcity, ψ3 : Gfar, where: ψ1 =At(x) ∧ WalkDist(x, Uni) ψ2 =At(x) ∧ ∃y(InCity(x, y) ∧ InCity(Uni, y)) ψ3 =At(x) ∧ ¬∃y(InCity(x, y) ∧ InCity(Uni, y)) Gwalk – as stored in the Plan Library

s2 s1 s0 walk(d) ?At(d) !pw s3

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 8 / 13

slide-12
SLIDE 12

Semantics

Semantics of Plan-Body Graphs

Example Agent receives event: !travelTo(Uni) Current Plan: !travelTo(Uni) : ψ1 : Gwalk, ψ2 : Gcity, ψ3 : Gfar, where: ψ1 =At(x) ∧ WalkDist(x, Uni) ψ2 =At(x) ∧ ∃y(InCity(x, y) ∧ InCity(Uni, y)) ψ3 =At(x) ∧ ¬∃y(InCity(x, y) ∧ InCity(Uni, y)) Gwalk – when B ⊢ ψ1

s3 s2 s0 walk(Uni) ?At(Uni) !pw s4

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 8 / 13

slide-13
SLIDE 13

Semantics

Semantics of Plan-Body Graphs

Example Agent receives event: !travelTo(Uni) Current Plan: !travelTo(Uni) : ψ1 : Gwalk, ψ2 : Gcity, ψ3 : Gfar, where: ψ1 =At(x) ∧ WalkDist(x, Uni) ψ2 =At(x) ∧ ∃y(InCity(x, y) ∧ InCity(Uni, y)) ψ3 =At(x) ∧ ¬∃y(InCity(x, y) ∧ InCity(Uni, y)) Gwalk – transitioning to the !pw node

s3 s2 s0 walk(Uni) ?At(Uni) !pw s4

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 8 / 13

slide-14
SLIDE 14

Semantics

Semantics of Plan-Body Graphs

Example Agent receives event: !travelTo(Uni) Current Plan: !travelTo(Uni) : ψ1 : Gwalk, ψ2 : Gcity, ψ3 : Gfar, where: ψ1 =At(x) ∧ WalkDist(x, Uni) ψ2 =At(x) ∧ ∃y(InCity(x, y) ∧ InCity(Uni, y)) ψ3 =At(x) ∧ ¬∃y(InCity(x, y) ∧ InCity(Uni, y)) Gwalk – executing sub-graph Gpw

s3 s2 s0 walk(Uni) ?At(Uni) Gpw ⊲ prepareWalk : ∆pw s4

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 8 / 13

slide-15
SLIDE 15

Semantics

Semantics of Plan-Body Graphs

Example Agent receives event: !travelTo(Uni) Current Plan: !travelTo(Uni) : ψ1 : Gwalk, ψ2 : Gcity, ψ3 : Gfar, where: ψ1 =At(x) ∧ WalkDist(x, Uni) ψ2 =At(x) ∧ ∃y(InCity(x, y) ∧ InCity(Uni, y)) ψ3 =At(x) ∧ ¬∃y(InCity(x, y) ∧ InCity(Uni, y)) Gwalk – after executing Gpw

s3 s2 s0 walk(Uni) ?At(Uni) η s4

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 8 / 13

slide-16
SLIDE 16

Key Properties

Soundness and Completeness of the Semantics

Theorems 1-4 ensure that our fragment of PRS works, in summary: The semantics is sound: all valid transitions from valid states result in valid states Wait and preserve programs are complete:

They are only removed under the right conditions

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 9 / 13

slide-17
SLIDE 17

Key Properties

Expressivity: CAN to PRS

Theorem If Π−

c is a CAN library and Λ an action-library, there exists a PRS

library Πp s.t. for any event-goal !e and beliefs B:

SOL(Λ, Π−

c , B, {!e}) = SOL(Λ, Πp, B, {!e}).

Key result: a CAN plan-library Π−

c not mentioning Goal(φs, P, φf)

programs (as there is no corresponding program in PRS) can be translated into an equivalent PRS plan-library.

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 10 / 13

slide-18
SLIDE 18

Key Properties

Expressivity: PRS to CAN

Theorem There exists a PRS library Π−

p , an action-library Λ, and event-goal !e,

s.t. for any CAN library Πc ∈ CAN(Π−

p ) and beliefs B:

SOL(Λ, Π−

p , B, {!e}) = SOL(Λ, Πc, B, {!e}).

Key result: the converse does not hold: even if we ignore programs that have no counterparts in CAN, some PRS plan-libraries cannot be ‘directly mapped’ to CAN libraries.

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 11 / 13

slide-19
SLIDE 19

Key Properties

Example of unconvertible PRS Plan

The following non-series-parallel plan-body graph cannot be converted into a single CAN plan-body graph:

4 6 8 3 7

!ev1 !ev2 !ev4 !ev5 !ev6

1 2

!ev0

5

ev01 → ev02 → ev11 → ev21 → ev22 → ev51 → ev12 → ev41 → ev42 → ev52 → ev61 → ev62

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 12 / 13

slide-20
SLIDE 20

Discussion

Future Work

Translations of constructs from related work into PRS

van Riemsdijk et al. 2009 Dastani et al. 2011 Thangarajah et al. 2014

Proofs to account for translating graph plan-bodies to sets of CAN

  • r AgentSpeak plan-rules

Extend the semantics to account for further PRS features:

Meta-level reasoning Overlapping plan steps

de Silva, Meneguzzi, and Logan PRS Operational Semantics July 18, 2018 13 / 13