18
1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

Embed Size (px)

Citation preview

Page 1: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

1

It pays to be Persistent

Dina Goldin, U.Mass/Boston (U.Conn)

Joint work with Scott Smolka, SUNY at Stony Brook

Peter Wegner, Brown University

Page 2: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

2

Functions or objects?

• Functions (side-effect-free) or objects: does it matter for modeling programs?

• Objects contain persistent values:

x1 = foo(args 1) y1 = cntr(add 1)x2 = foo(args 2) y2 = cntr(get ttl)x3 = foo(args 3) y3 = cntr(add 2)x4 = foo(args 2) y4 = cntr(get ttl)

_________________________________________________ x2 = x4 y2 y4

• History dependence (emerges in the context of multiple invocations).

Page 3: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

3

Concurrent Processes

• Concurrency: parallel execution of interacting processes.

• Processes: stream-based computational semantics.

• Bisimulation: a finer notion of equivalence, appropriate for dynamic environments.

sP(s) = a.P(s’) S’a

Page 4: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

4

Algorithmic vs. Interactive Computation

finite-size input (string)

all necessary info available at start (closed system)computation ends once answer is generatedthis notion of computation is captured by Church-Turing thesis

dynamically generated stream of input tokens (requests, percepts, messages)later inputs depend on earlier outputs (“lack of modularity”) and vice versa (“history dep.”)computation not assumed to end

objects, processes, components,control devices, reactive systems, intelligent agents,

Page 5: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

5

• Persistent Turing Machines (PTMs)

• Equivalence relations for PTMs

• Amnesic Turing Machines (ATMs)

• Comparing PTMs and ATMs

Outline

Page 6: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

6

Nondeterministic 3-tape TMs

s - current state

w1 - contents of input tape

w2 - contents of work tape

w3 - contents of output tape

n1 , n2 , n3 - tape head posns

321321 ,,,,,, nnnwwws

'CC |• Computation is a sequence of transitions:

• Configurations:

input

work

outputS

Page 7: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

7

Extending N3TM computations

• Inputs are dynamic streams of tokens (strings). For each input token, there is an N3TM computation generating a corresponding output token.

• The contents w of the work tape at the beginning of each N3TM computation is the same as at the end of the previous one.

fM (inputk, wk-1) = (outputk, wk)

Page 8: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

8

• Persistent Stream Language of a PTM: set of streams

Persistent Stream Languages

,...},,,{ 2211 outinoutin

in1

S0

Shout1

w1

in1 in2

S0

w1

Shout2

w2

in2

...

Persistent Turing Machine (PTM): N3TM with persistent stream-based computational semantics

Page 9: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

9

• inputs in1; outputs 1

• inputs in2; outputs 1st bit of in1

• inputs in3; outputs 1st bit of in2

• ...

• Example:

PTM Example: LatchM

),...}0,1(),0,0(),1,0(),1,1{(io

#

1

0

(1*,1)

(0*,1)

(0*,1) (1*,0)

(1*,1)

(0*,0)

)( LatchMPSL

Page 10: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

10

=ms=PSL

PTM Equivalence Relations

M1 =PSL M2: PSL (M1) = PSL (M2)

M1 =ms M2 : bijection between their reachable memories s.t.

1. () =

2. fM1 (i, w) = (o, w’) iff fM2

(i, (w)) = (o, (w’))

Page 11: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

11

=ms=bisim=PSL

PTM Equivalence Relations

M1 =bisim M2 : relation R between their reachable memories s.t.

1. R(,)

2. If R(w1,w2) and fM1(i,w1) = (o,w1’),

then w2’ s.t. R(w1’,w2’) and fM2(i,w2) = (o,w2’)

3. Same thing, but with 1 and 2 reversed

Page 12: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

12

Infinite Equivalence Hierarchy

• Lk(M) - stream prefix language of PTM Mset of prefixes of length k for streams in PSL(M).

• L (M) - Uk Lk(M)

• A new notion of equivalence:

M1 =k M2 : Lk(M1) = Lk ( M2 )

==2=1 ...

Page 13: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

13

Equivalence Hierarchy Gap

• Proof: construct PTMs M1 and M2 where L(M1) = L (M2 ) but PSL (M1 ) = PSL (M2 )

• Note: M2 exhibits unbounded non-determinism

/

=ms=bisim=PSL=

=2=1 ...

Page 14: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

14

Amnesic PTM Computation:

stream-based but not persistent

in1

S0

Shout1

w1

in1 in2

S0

Shout2

w2

in2

• Amnesic Stream Language of M: ASL(M)

• M1 =ASL M1 : ASL(M1) = ASL(M2)

• ASL = {ASL(M) | M is an N3TM }

Page 15: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

15

Proof:: Given an N3TM M, construct M’ such that

PSL(M') = ASL(M)

: Consider 3rd elem. (0,0) of io for Mlatch!For any M with io in ASL(M), there will also be a stream in ASL(M) with (0,0) as 1st element.Therefore, for all M, ASL(M) PSL(Mlatch).

It pays to be Persistent

ASL PSL

Page 16: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

16

• Interactive computability

- A stream language L is interactively computable if L PSL (L’s properties expressed in Temporal Logic)

- A behavior B is interactively computable if B is bisimilar to some PTM M

• Interactive complexity

• Where are the ports?

http://www.cs.umb.edu/~dqg/papers/

Future Work

Page 17: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

17

• Sequential Interaction Machines [Wegner&Goldin]

• Online algorithms

• Dataflow, process algebra, I/O automata, synchronous languages, finite/pushdown automata over infinite words, interaction games, reactive modules, …

• Our approach: language- and domain-independent effective devices that distinguish inputs and outputs

Related Work

Page 18: 1 It pays to be Persistent Dina Goldin, U.Mass/Boston (U.Conn) Joint work with Scott Smolka, SUNY at Stony Brook Peter Wegner, Brown University

18

Reachable Memories of a PTM

k

kkkkk

swoutsinsin

outsinsinoutsinin

,,,,...,,,,

,,,,

1

22212

1111

Set of words (work-tape contents) w encounteredafter zero or more macrosteps:

*Reach(M)