Modeling change without breaking promises Alva Couch Hengky - - PowerPoint PPT Presentation

modeling change without breaking promises
SMART_READER_LITE
LIVE PREVIEW

Modeling change without breaking promises Alva Couch Hengky - - PowerPoint PPT Presentation

Modeling change without breaking promises Alva Couch Hengky Susanto Marc Chiarini Tufts University Promises A promise is a one-sided agreement from the sender to conform to some limits upon the senders behavior. Sender agrees to


slide-1
SLIDE 1

Modeling change without breaking promises

Alva Couch Hengky Susanto Marc Chiarini Tufts University

slide-2
SLIDE 2

Promises

  • A promise is a one-sided agreement from

the sender to conform to some limits upon the sender’s behavior.

  • Sender agrees to some behavior b (called

a pr promi

  • mise body

se body)

  • Receiver simply observes and is not
  • bligated.

sender s receiver r promise π=<s,r,b>

  • ur notation

<s,r,b>

slide-3
SLIDE 3

Conditional promises

  • A conditional promise constrains the sender’s

behavior only under certain conditions.

  • In our calculus of conditions, only other

promises can be conditions.

  • The notation <s2,r2,b2> | <s1,r1,b1> means that

s2 promises b2 to r2 only if it observes that s1 has promised b1 to r1.

  • Subtle: the above is really one promise with a

special body: <s2,r2,(b2| <s1,r1,b1>)>

slide-4
SLIDE 4

One problem with promises...

  • ... is that they aren’t valid “forever”.
  • If conditions change, an agent must “break

promises”.

  • A broken promise occurs when an agent

promises something contradictory to a prior promise it has made.

  • Note that a promise may also be

unfulfilled; this is different from breaking a promise.

slide-5
SLIDE 5

Semantics of broken promises

  • The “contradiction” that signals that a

promise is broken can be complex.

  • A promise body can be thought of as a set
  • f prolog-style facts.
  • A broken promise is one in which the

facts are logically inconsistent with those of some prior promise.

slide-6
SLIDE 6

Example of a broken promise

  • fileservice(100ms) – I promise to give you file

service with an average response time of 100ms.

  • fileservice(70ms) – better, not a broken

promise.

  • fileservice(200ms) – worse, and breaks both
  • ther promises.
  • Semantics of broken promises are complex and

depend upon semantics of promise bodies!

slide-7
SLIDE 7

How not to break promises

  • Scope promises in time and by events.
  • Avoid having to infer contradictions to

invalidate promises.

  • Really, this is part of the type system of

promise bodies.

  • But we can separate this scoping from the

type system via a simple notation.

slide-8
SLIDE 8

Operative and inoperative promises

  • A promise is operative (at a particular

time) if it holds at that time, and inoperative otherwise.

  • 1. Unconditional promises are operative until

they are broken.

  • 2. Conditional promises are operative if their

conditions are operative.

slide-9
SLIDE 9

α and τ

  • Two new promise bodies:

– τ(increm crement ent) ) is operative from current time to current time + increment – α(prom

  • mise)

se) is operative until receipt of the specified promise.

  • And one new operator:

– ﹁(p) (p) is operative whenever p is not

  • perative.
slide-10
SLIDE 10

Implicit sender and receiver

  • <s,r

,r,( ,(b|τ(1 s 1 sec econd)

  • nd))>

means b is operative for one second only.

  • We can “factor” τ out of the promise body:

<s,r ,r,b ,b>|<s,r ,r,τ(1 s 1 sec econd)

  • nd)>
  • But only s,r make sense as sender and

receiver of τ. Thus we can write: <s,r ,r,b ,b>|τ(1 s 1 sec econd)

  • nd)

without confusion

slide-11
SLIDE 11

Timing diagrams

  • perative

inoperative lookup()|τ(2 hours) received 2 hours τ(2 hours) lookup()|τ(2 hours) deleted

  • perative

inoperative ﹁τ(2 hours) lookup()|﹁τ(2 hours) received lookup()|﹁τ(2 hours) condition deleted

slide-12
SLIDE 12

Leasing and gating

  • τ is operative for a given amount of time.

– So τ can be used to simulate leasing.

  • α is operative until a given promise is

received.

– So α can be used to simulate gating, in which receipt of one promise activates or deactivates another.

slide-13
SLIDE 13

Leasing

  • <s,r,dhcp(192.138.177.3)> | τ(2 hour

2 hours)

a DHCP lease grants use of an IP address for

  • r

two hours

  • hours.
  • <s,r

,r,fil ,fileservic ice()>|﹁τ(1 hour 1 hour), τ(3 hour 3 hours)

s offers r fileservice one hour f

  • ne hour from

rom now now, for t

  • r two
  • hour

hours.

  • (a list of conditions is a conj
  • njunc

unction

  • n)
slide-14
SLIDE 14

Gating

  • <s,r,fileservice()> | α(<r,

r,s,stop()>) ()>)

  • ffer fileservice until told to stop offering it.
  • <r,s

,s,s ,sto top()>|τ(0 (0)

stop offering file service any more. (τ(0) (0) becomes operative and then non-operative at at t the he sam same t e time e st step ep and “gates” the transition.) (stop() p() is an abst abstract prom promise whose meaning is just to gate another one)

slide-15
SLIDE 15

Type factoring

Consider the promise system

  • <s,r,dhcp(192.138.178.1)> | τ(2 hours)
  • <r,s,dns()> | α(<s,r,dns()>)

At any time, this system can be reduced to an equivalent one free of α and τ. The reduction differs, depending upon time and events.

slide-16
SLIDE 16

Before 2 hours are up and <s,r,dns()> not received

Reduced system:

  • <s,r,dhcp(192.138.178.1)> | τ(2 hours)
  • <r,s,dns()> | α(<s,r,dns()>)
slide-17
SLIDE 17

After 2 hours are up and <s,r,dns()> not received

Reduced system:

  • <s,r,dhcp(192.138.178.1)> | τ(2 hours)
  • <r,s,dns()> | α(<s,r,dns()>)
slide-18
SLIDE 18

After 2 hours are up and after <s,r,dns()> received

Reduced system:

  • <s,r,dhcp(192.138.178.1)> | τ(2 hours)
  • <r,s,dns()> | α(<s,r,dns()>)
slide-19
SLIDE 19

Claims

  • α and τ are the minimal necessary
  • perators for accomplishing change in

promise networks without breaking

  • promises. They are:

– sel self-erasi erasing ng when purpose is complete – scal scalable to use in complex tasks – flexib ible le; any sequence of promise states can be managed in the promise space of the recipient. – external rnal to the type system of promise bodies.

slide-20
SLIDE 20

Modeling change without breaking promises

Alva Couch Hengky Susanto Marc Chiarini Tufts University