Composition of ConGolog Programs Sebastian Sardina 1 Giuseppe De - - PowerPoint PPT Presentation

composition of congolog programs
SMART_READER_LITE
LIVE PREVIEW

Composition of ConGolog Programs Sebastian Sardina 1 Giuseppe De - - PowerPoint PPT Presentation

Composition of ConGolog Programs Sebastian Sardina 1 Giuseppe De Giacomo 2 1 Department of Computer Science and Information Technology RMIT University, Melbourne, AUSTRALIA 2 Dipartimento di Informatica e Sistemistica Antonio Ruberti


slide-1
SLIDE 1

Composition of ConGolog Programs

Sebastian Sardina1 Giuseppe De Giacomo2

1Department of Computer Science and Information Technology

RMIT University, Melbourne, AUSTRALIA

2Dipartimento di Informatica e Sistemistica “Antonio Ruberti”

Sapienza Universita’ di Roma, Rome, ITALY

1 / 18

slide-2
SLIDE 2

Behavior Composition: The Basic Idea ...

Available Behaviors (description of the behavior of available agents/devices) Environment (description of actions; prec. & effects)

2 / 18

slide-3
SLIDE 3

Behavior Composition: The Basic Idea ...

Available Behaviors (description of the behavior of available agents/devices) Environment (description of actions; prec. & effects) Target Behavior (desired behavior)

2 / 18

slide-4
SLIDE 4

Behavior Composition: The Basic Idea ...

Available Behaviors (description of the behavior of available agents/devices) Environment (description of actions; prec. & effects) Target Behavior (desired behavior) Controller

2 / 18

slide-5
SLIDE 5

Behavior Composition: The Basic Idea ...

Available Behaviors (description of the behavior of available agents/devices) Environment (description of actions; prec. & effects) Target Behavior (desired behavior) Controller

2 / 18

slide-6
SLIDE 6

Behavior Composition: The Basic Idea ...

Available Behaviors (description of the behavior of available agents/devices) Environment (description of actions; prec. & effects) Target Behavior (desired behavior) Controller

Now with

unbounded data!

2 / 18

slide-7
SLIDE 7

The ConGolog Composition Problem

Given:

1 An action theory D; 2 n available programs δ1, . . . , δn; 3 a target program δt.

3 / 18

slide-8
SLIDE 8

The ConGolog Composition Problem

Given:

1 An action theory D; 2 n available programs δ1, . . . , δn; 3 a target program δt.

Task: find an orchestrator/delegator that coordinates the concurrent execution of the available programs so as to mimic/realize the target program.

3 / 18

slide-9
SLIDE 9

The ConGolog Composition Problem

Given:

1 An action theory D; 2 n available programs δ1, . . . , δn; 3 a target program δt.

Task: find an orchestrator/delegator that coordinates the concurrent execution of the available programs so as to mimic/realize the target program.

agent/plan coordination, virtual agents; web-service composition; composition of business processes

3 / 18

slide-10
SLIDE 10

The ConGolog Composition Problem

Given:

1 An action theory D; 2 n available programs δ1, . . . , δn; 3 a target program δt.

Task: find an orchestrator/delegator that coordinates the concurrent execution of the available programs so as to mimic/realize the target program.

agent/plan coordination, virtual agents; web-service composition; composition of business processes

Notable features:

  • Programs may include non-deterministic points & may not terminate.
  • Domain may be infinite.
  • Programs may go over infinite states.

3 / 18

slide-11
SLIDE 11

Controller for a Music Jukebox

while True do { if (¬Playing ∧ (∃song)Pending(song)) then (π song, disk).{ (Pending(song) ∧ InDisk(song, disk))?; select(song); load(disk); play(song) } else wait }

4 / 18

slide-12
SLIDE 12

Controller for a Music Jukebox

while True do { if (¬Playing ∧ (∃song)Pending(song)) then (π song, disk).{ (Pending(song) ∧ InDisk(song, disk))?; select(song); load(disk); play(song) } else wait }

  • Domain tests relative to an action theory.

4 / 18

slide-13
SLIDE 13

Controller for a Music Jukebox

while True do { if (¬Playing ∧ (∃song)Pending(song)) then (π song, disk).{ (Pending(song) ∧ InDisk(song, disk))?; select(song); load(disk); play(song) } else wait }

  • Domain tests relative to an action theory.
  • Domain actions.

4 / 18

slide-14
SLIDE 14

Controller for a Music Jukebox

while True do { if (¬Playing ∧ (∃song)Pending(song)) then (π song, disk).{ (Pending(song) ∧ InDisk(song, disk))?; select(song); load(disk); play(song) } else wait }

  • Domain tests relative to an action theory.
  • Domain actions.
  • Nondeterministic features.

4 / 18

slide-15
SLIDE 15

Semantics for High-Level Programs

In terms of two predicates:

1 Trans(δ, s, δ′, s′): program δ can evolve one step from situation s to situation

s′ with remaining program δ′. Trans(δ1; δ2, s, δ′, s′) ≡ Trans(δ1, s, δ′

1, s′) ∧ δ′ = δ′ 1; δ2 ∨ Final(δ1, s) ∧ Trans(δ2, s, δ′, s′). 2 Final(δ, s): program δ may terminate successfully in s.

Final(δ1; δ2, s) ≡ Final(δ1, s) ∧ Final(δ2, s)

5 / 18

slide-16
SLIDE 16

Formalizing the Composition Problem: Simulation

Informally: System S simulates system T if S can “match” all T’s moves, forever.

6 / 18

slide-17
SLIDE 17

Formalizing the Composition Problem: Simulation

Informally: System S simulates system T if S can “match” all T’s moves, forever. Formally [Milner IJCAI’71]: Given two labelled TSs S = (ΣS, AS, − →S) and T = (ΣT, AT, − →T), the simulation is the largest relation Sim ⊆ ΣS × ΣT such that: if Sim(s, t) holds (state s simulates state t), then: if t

α

− →T t′, then there exists s

α

− →S s′ and Sim(s′, t′).

6 / 18

slide-18
SLIDE 18

The Composition Problem: Simulation

Sim(δt, δ1, . . . , δn, s): available programs can simulate the target program in s. Sim(δt, δ1, . . . , δn, s) ≡ ∃S.

  • S(δt, δ1, . . . , δn, s) ∧ ∀δt, δ1, . . . , δn, s.Θ[S](δt, δ1, . . . , δn, s)
  • ,

where Θ[S](δt, δ1, . . . , δn, s)

def

= S(δt, δ1, . . . , δn, s) →

  • Final(δt, s) →

i=1,...,n Final(δi, s)

  • ∀δ′

t, s′Trans(δt, s, δ′ t, s′) →

  • i=1,...,n ∃δ′

i.Trans(δi, s, δ′ i, s′) ∧ S(δ′ t, δ1, . . . , δ′ i, . . . , δn, s′)

  • .

If the simulation holds then one can build an orchestrator generator based on it.

7 / 18

slide-19
SLIDE 19

The Composition Problem: Simulation

Sim(δt, δ1, . . . , δn, s): available programs can simulate the target program in s. Sim(δt, δ1, . . . , δn, s) ≡ ∃S.

  • S(δt, δ1, . . . , δn, s) ∧ ∀δt, δ1, . . . , δn, s.Θ[S](δt, δ1, . . . , δn, s)
  • ,

where Θ[S](δt, δ1, . . . , δn, s)

def

= S(δt, δ1, . . . , δn, s) →

  • Final(δt, s) →

i=1,...,n Final(δi, s)

  • ∀δ′

t, s′Trans(δt, s, δ′ t, s′) →

  • i=1,...,n ∃δ′

i.Trans(δi, s, δ′ i, s′) ∧ S(δ′ t, δ1, . . . , δ′ i, . . . , δn, s′)

  • .

If the simulation holds then one can build an orchestrator generator based on it. Second

  • rder!

7 / 18

slide-20
SLIDE 20

The Technique

Relies on the following “tools”/notions:

1 Simulation approximates:

[Tarski ’55]

  • Check simulation in a finite way.

2 Regression mechanism:

[Reiter’91; Pirri & Reiter’99]

  • Reason on formulas after action performance.

3 Characteristic graphs:

[Classen&Lakemeyer KR’08]

  • Abstract (infinite) program states into a finite graph.

8 / 18

slide-21
SLIDE 21

The Technique

Relies on the following “tools”/notions:

1 Simulation approximates:

[Tarski ’55]

  • Check simulation in a finite way.

2 Regression mechanism:

[Reiter’91; Pirri & Reiter’99]

  • Reason on formulas after action performance.

3 Characteristic graphs:

[Classen&Lakemeyer KR’08]

  • Abstract (infinite) program states into a finite graph.

9 / 18

slide-22
SLIDE 22

Simulation Approximates

Simk(δt, δ1, . . . , δn, s): the available programs can “simulate” k steps of the target program in s.

Sim0(δt, δ1, . . . , δn, s) ≡ (Final(δt, s) → V

i=1,...,n Final(δi, s)).

Simk+1(δt, δ1, . . . , δn, s) ≡ Simk(δt, δ1, . . . , δn, s) ∧ ` ∀δ′

t, s′.Trans(δt, s, δ′ t, s′) →

W

i=1,...,n ∃δ′ i .Trans(δi, s, δ′ i , s′) ∧ Simk(δ′ t, δ1, . . . , δ′ i , . . . , δn, s′)

´ .

10 / 18

slide-23
SLIDE 23

Simulation Approximates

Simk(δt, δ1, . . . , δn, s): the available programs can “simulate” k steps of the target program in s.

Sim0(δt, δ1, . . . , δn, s) ≡ (Final(δt, s) → V

i=1,...,n Final(δi, s)).

Simk+1(δt, δ1, . . . , δn, s) ≡ Simk(δt, δ1, . . . , δn, s) ∧ ` ∀δ′

t, s′.Trans(δt, s, δ′ t, s′) →

W

i=1,...,n ∃δ′ i .Trans(δi, s, δ′ i , s′) ∧ Simk(δ′ t, δ1, . . . , δ′ i , . . . , δn, s′)

´ .

Proposition

For every k ≥ 0, if Simk(δt, δ1, . . . , δn, s) ≡ Simk+1(δt, δ1, . . . , δn, s), then Simk(δt, δ1, . . . , δn, s) ≡ Sim(δt, δ1, . . . , δn, s).

10 / 18

slide-24
SLIDE 24

The Technique

Relies on the following “tools”/notions:

1 Simulation approximates:

[Tarski ’55]

  • Check simulation in a finite way.

2 Regression mechanism:

[Reiter’91; Pirri & Reiter’99]

  • Reason on formulas after action performance.
  • computes what has to be true in situation s so that φ is true after doing

action α in s.

  • R[φ(do(α, s))] = φ′(s)

action α has been eliminated!

3 Characteristic graphs:

[Classen&Lakemeyer KR’08]

  • Abstract (infinite) program states into a finite graph.

11 / 18

slide-25
SLIDE 25

The Technique

Relies on the following “tools”/notions:

1 Simulation approximates:

[Tarski ’55]

  • Check simulation in a finite way.

2 Regression mechanism:

[Reiter’91; Pirri & Reiter’99]

  • Reason on formulas after action performance.

3 Characteristic graphs:

[Classen&Lakemeyer KR’08]

  • Abstract (infinite) program states into a finite graph.

12 / 18

slide-26
SLIDE 26

Characteristic Graph for δmusic

v0 v1 v2 wait, Playing ∨ ¬∃song.Pending(song) πsong, disk : select(song), Pending(song) ∧ InDisk(song, disk) ∧ ¬Playing load(disk), True play(song), True

δmusic . = while True do { if (¬Playing ∧ (∃song)Pending(song)) then πsong, disk.{ (Pending(song) ∧ InDisk(song, disk))?; select(song); load(disk); play(song) } else wait }

v0 = δmusic, False v1 = load(disk); play(song), False v2 = play(song), False

13 / 18

slide-27
SLIDE 27

The Composition Problem: Simulation

Sim(δt, δ1, . . . , δn, s): available programs can simulate the target program in s. Sim(δt, δ1, . . . , δn, s) ≡ ∃S.

  • S(δt, δ1, . . . , δn, s) ∧ ∀δt, δ1, . . . , δn, s.Θ[S](δt, δ1, . . . , δn, s)
  • ,

where Θ[S](δt, δ1, . . . , δn, s)

def

= S(δt, δ1, . . . , δn, s) →

  • Final(δt, s) →

i=1,...,n Final(δi, s)

  • ∀δ′

t, s′Trans(δt, s, δ′ t, s′) →

  • i=1,...,n ∃δ′

i.Trans(δi, s, δ′ i, s′) ∧ S(δ′ t, δ1, . . . , δ′ i, . . . , δn, s′)

  • .

If the simulation holds then one can build an orchestrator generator based on it.

14 / 18

slide-28
SLIDE 28

Algorithm SymSim(δ0

t , δ0 1, . . . , δ0 n) Computes relation X containing tuples of the form vt, v1, . . . , vn, φ:

  • vt, v1, . . . , vn are nodes in the characteristic graphs.
  • FO formula φ: “the target program in vt is simulated by the available

programs in v1, . . . , vn.’’

15 / 18

slide-29
SLIDE 29

Algorithm SymSim(δ0

t , δ0 1, . . . , δ0 n) Computes relation X containing tuples of the form vt, v1, . . . , vn, φ:

  • vt, v1, . . . , vn are nodes in the characteristic graphs.
  • FO formula φ: “the target program in vt is simulated by the available

programs in v1, . . . , vn.’’

1 X0 := {(δt, γt), (δ1, γ1), . . . , (δn, γn), γt → n i=1 γi | (δj, γj) in Gδ0

j }

  • 0-step simulation: check for termination “mimicking.”

15 / 18

slide-30
SLIDE 30

Algorithm SymSim(δ0

t , δ0 1, . . . , δ0 n) Computes relation X containing tuples of the form vt, v1, . . . , vn, φ:

  • vt, v1, . . . , vn are nodes in the characteristic graphs.
  • FO formula φ: “the target program in vt is simulated by the available

programs in v1, . . . , vn.’’

1 X0 := {(δt, γt), (δ1, γ1), . . . , (δn, γn), γt → n i=1 γi | (δj, γj) in Gδ0

j }

  • 0-step simulation: check for termination “mimicking.”

2 At every step, compute Next[X]: “one step refinement” of the simulation:

Next[X] = {vt, v1, . . . , vn, φold ∧ φnew | vt, v1, . . . , vn, φold ∈ X}.

  • φnew: we can safely mimic (any) single action from the target.

15 / 18

slide-31
SLIDE 31

Algorithm SymSim(δ0

t , δ0 1, . . . , δ0 n) Computes relation X containing tuples of the form vt, v1, . . . , vn, φ:

  • vt, v1, . . . , vn are nodes in the characteristic graphs.
  • FO formula φ: “the target program in vt is simulated by the available

programs in v1, . . . , vn.’’

1 X0 := {(δt, γt), (δ1, γ1), . . . , (δn, γn), γt → n i=1 γi | (δj, γj) in Gδ0

j }

  • 0-step simulation: check for termination “mimicking.”

2 At every step, compute Next[X]: “one step refinement” of the simulation:

Next[X] = {vt, v1, . . . , vn, φold ∧ φnew | vt, v1, . . . , vn, φold ∈ X}.

  • φnew: we can safely mimic (any) single action from the target.

3 X represents the approximates of the simulation, refined at each iteration.

15 / 18

slide-32
SLIDE 32

Algorithm SymSim(δ0

t , δ0 1, . . . , δ0 n) Computes relation X containing tuples of the form vt, v1, . . . , vn, φ:

  • vt, v1, . . . , vn are nodes in the characteristic graphs.
  • FO formula φ: “the target program in vt is simulated by the available

programs in v1, . . . , vn.’’

1 X0 := {(δt, γt), (δ1, γ1), . . . , (δn, γn), γt → n i=1 γi | (δj, γj) in Gδ0

j }

  • 0-step simulation: check for termination “mimicking.”

2 At every step, compute Next[X]: “one step refinement” of the simulation:

Next[X] = {vt, v1, . . . , vn, φold ∧ φnew | vt, v1, . . . , vn, φold ∈ X}.

  • φnew: we can safely mimic (any) single action from the target.

3 X represents the approximates of the simulation, refined at each iteration. 4 Stop when X = Next[X].

15 / 18

slide-33
SLIDE 33

Next[X]: One-step refinement of the simulation

Next[X] = {vt, v1, . . . , vn, φold ∧ φnew | vt, v1, . . . , vn, φold ∈ X}, φnew =

vt

π x αt

− →

ψt

v ′

t ∈Et

x.ψt[s] ∧ Poss(αt, s) → n

i=1

  • vi

π y.αi

− →

ψi

v ′

i ∈Ei∧v ′ t ,v1,...,v ′ i ,...,vn,φi∈X

∃ y.αt = αi ∧ ψi[s] ∧ R[φi(do(αi, s))]

  • .

For every potential target evolution from vt to v ′

t via action αt, ...

if it can be done in the program (ψt holds) and the action αt is possible, . . . then some available prog. δi can evolve from vi to v ′

i via action αi such that: 1 the action αi can be matched to αt; 2 the program can indeed do the step; 3 after doing the step, we are still in simulation.

16 / 18

slide-34
SLIDE 34

Next[X]: One-step refinement of the simulation

Next[X] = {vt, v1, . . . , vn, φold ∧ φnew | vt, v1, . . . , vn, φold ∈ X}, φnew =

vt

π x αt

− →

ψt

v ′

t ∈Et

x.ψt[s] ∧ Poss(αt, s) → n

i=1

  • vi

π y.αi

− →

ψi

v ′

i ∈Ei∧v ′ t ,v1,...,v ′ i ,...,vn,φi∈X

∃ y.αt = αi ∧ ψi[s] ∧ R[φi(do(αi, s))]

  • .

For every potential target evolution from vt to v ′

t via action αt, ...

if it can be done in the program (ψt holds) and the action αt is possible, . . . then some available prog. δi can evolve from vi to v ′

i via action αi such that: 1 the action αi can be matched to αt; 2 the program can indeed do the step; 3 after doing the step, we are still in simulation.

16 / 18

slide-35
SLIDE 35

Next[X]: One-step refinement of the simulation

Next[X] = {vt, v1, . . . , vn, φold ∧ φnew | vt, v1, . . . , vn, φold ∈ X}, φnew =

vt

π x αt

− →

ψt

v ′

t ∈Et

x.ψt[s] ∧ Poss(αt, s) → n

i=1

  • vi

π y.αi

− →

ψi

v ′

i ∈Ei∧v ′ t ,v1,...,v ′ i ,...,vn,φi∈X

∃ y.αt = αi ∧ ψi[s] ∧ R[φi(do(αi, s))]

  • .

For every potential target evolution from vt to v ′

t via action αt, ...

if it can be done in the program (ψt holds) and the action αt is possible, . . . then some available prog. δi can evolve from vi to v ′

i via action αi such that: 1 the action αi can be matched to αt; 2 the program can indeed do the step; 3 after doing the step, we are still in simulation.

16 / 18

slide-36
SLIDE 36

Next[X]: One-step refinement of the simulation

Next[X] = {vt, v1, . . . , vn, φold ∧ φnew | vt, v1, . . . , vn, φold ∈ X}, φnew =

vt

π x αt

− →

ψt

v ′

t ∈Et

x.ψt[s] ∧ Poss(αt, s) → n

i=1

  • vi

π y.αi

− →

ψi

v ′

i ∈Ei∧v ′ t ,v1,...,v ′ i ,...,vn,φi∈X

∃ y.αt = αi ∧ ψi[s] ∧ R[φi(do(αi, s))]

  • .

For every potential target evolution from vt to v ′

t via action αt, ...

if it can be done in the program (ψt holds) and the action αt is possible, . . . then some available prog. δi can evolve from vi to v ′

i via action αi such that: 1 the action αi can be matched to αt; 2 the program can indeed do the step; 3 after doing the step, we are still in simulation.

16 / 18

slide-37
SLIDE 37

Next[X]: One-step refinement of the simulation

Next[X] = {vt, v1, . . . , vn, φold ∧ φnew | vt, v1, . . . , vn, φold ∈ X}, φnew =

vt

π x αt

− →

ψt

v ′

t ∈Et

x.ψt[s] ∧ Poss(αt, s) → n

i=1

  • vi

π y.αi

− →

ψi

v ′

i ∈Ei∧v ′ t ,v1,...,v ′ i ,...,vn,φi∈X

∃ y.αt = αi ∧ ψi[s] ∧ R[φi(do(αi, s))]

  • .

For every potential target evolution from vt to v ′

t via action αt, ...

if it can be done in the program (ψt holds) and the action αt is possible, . . . then some available prog. δi can evolve from vi to v ′

i via action αi such that: 1 the action αi can be matched to αt; 2 the program can indeed do the step; 3 after doing the step, we are still in simulation.

16 / 18

slide-38
SLIDE 38

Next[X]: One-step refinement of the simulation

Next[X] = {vt, v1, . . . , vn, φold ∧ φnew | vt, v1, . . . , vn, φold ∈ X}, φnew =

vt

π x αt

− →

ψt

v ′

t ∈Et

x.ψt[s] ∧ Poss(αt, s) → n

i=1

  • vi

π y.αi

− →

ψi

v ′

i ∈Ei∧v ′ t ,v1,...,v ′ i ,...,vn,φi∈X

∃ y.αt = αi ∧ ψi[s] ∧ R[φi(do(αi, s))]

  • .

For every potential target evolution from vt to v ′

t via action αt, ...

if it can be done in the program (ψt holds) and the action αt is possible, . . . then some available prog. δi can evolve from vi to v ′

i via action αi such that: 1 the action αi can be matched to αt; 2 the program can indeed do the step; 3 after doing the step, we are still in simulation.

16 / 18

slide-39
SLIDE 39

Next[X]: One-step refinement of the simulation

Next[X] = {vt, v1, . . . , vn, φold ∧ φnew | vt, v1, . . . , vn, φold ∈ X}, φnew =

vt

π x αt

− →

ψt

v ′

t ∈Et

x.ψt[s] ∧ Poss(αt, s) → n

i=1

  • vi

π y.αi

− →

ψi

v ′

i ∈Ei∧v ′ t ,v1,...,v ′ i ,...,vn,φi∈X

∃ y.αt = αi ∧ ψi[s] ∧ R[φi(do(αi, s))]

  • .

For every potential target evolution from vt to v ′

t via action αt, ...

if it can be done in the program (ψt holds) and the action αt is possible, . . . then some available prog. δi can evolve from vi to v ′

i via action αi such that: 1 the action αi can be matched to αt; 2 the program can indeed do the step; 3 after doing the step, we are still in simulation.

16 / 18

slide-40
SLIDE 40

Technical Results

Theorem

If algorithm SymSim(δ0

t , δ0 1, . . . , δ0 n) terminates returning the set X. Then,

Axioms | = Sim(δt, δ1, . . . , δn, s) ≡ φ[s], where (δt, γt), (δ1, γ1), . . . , (δn, γn), φ ∈ X.

17 / 18

slide-41
SLIDE 41

Technical Results

Theorem

If algorithm SymSim(δ0

t , δ0 1, . . . , δ0 n) terminates returning the set X. Then,

Axioms | = Sim(δt, δ1, . . . , δn, s) ≡ φ[s], where (δt, γt), (δ1, γ1), . . . , (δn, γn), φ ∈ X. Moreover, we can construct a delegator controller to realize the composition

  • n-the-fly using FO entailment only (on DS0).

Idea: after a request, jump to a configuration vt, v1, . . . , vn, φ ∈ X for which φ holds.

17 / 18

slide-42
SLIDE 42

Conclusions

Reasoning on unbounded data and processes is a challenge for CS since it leads infinite state systems.

  • Standard approach: abstract to finite systems (see literature on Verification).
  • Here instead we are proposing an alternative approach rooted in KR and AI.

18 / 18

slide-43
SLIDE 43

Conclusions

Reasoning on unbounded data and processes is a challenge for CS since it leads infinite state systems.

  • Standard approach: abstract to finite systems (see literature on Verification).
  • Here instead we are proposing an alternative approach rooted in KR and AI.

Specifically: Based on transforming the second-order formula for checking the dynamic property of simulation into a first-order one talking only about the static properties of the initial situation/DB.

18 / 18

slide-44
SLIDE 44

Conclusions

Reasoning on unbounded data and processes is a challenge for CS since it leads infinite state systems.

  • Standard approach: abstract to finite systems (see literature on Verification).
  • Here instead we are proposing an alternative approach rooted in KR and AI.

Specifically: Based on transforming the second-order formula for checking the dynamic property of simulation into a first-order one talking only about the static properties of the initial situation/DB. Main research direction for future work:

1 incomplete information about the initial situation.

  • offline vs online interpreters (see literature on high-level programs in AI).

2 identify cases in which the technique becomes sound & complete.

18 / 18