the pie model ‘minimal’ model of interactive system focused on external observable aspects of...

24
the PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction P I E R D result disp

Upload: imogen-crawford

Post on 20-Jan-2016

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

the PIE model

• ‘minimal’ model of interactive system• focused on external observable aspects

of interaction

P

I

E

R

D

result

disp

Page 2: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

PIE model – user input

• sequence of commands• commands include:

– keyboard, mouse movement, mouse click

• call the set of commands C• call the sequence P

P = seq C

Page 3: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

PIE model – system response

• the ‘effect’• effect composed of:

ephemeral displaythe final result

• (e..g printout, changed file)

• call the set of effects E

Page 4: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

PIE model – the connection

• given any history of commands (P)• there is some current effect• call the mapping the interpretation (I)

I: P E

P

I

E

R

D

result

disp

Page 5: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

properties – WYSIWYG

predict ( D R ) s.t. predict o display = result

• but really not quite the full meaning

P

I

E

R

D

predict

result

display

Page 6: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

state

• avoided to focus external aspects …

… but often easier to think about!

• but can add it back– either ‘create’ it from I and E– or assume E is actually a state

Page 7: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

creating the state!

• given a PIE• say two command sequences as

equivalent if they are indistinguishable in the future:

p ~ q iff r H: I(pr) = I(qr)• the quotient set of P is a minimal state

allowing the same effects

N.B. change notation use H (history) instead of P for sequence of commands

Page 8: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

property of state

• for E to be a state it needs a state update function – call it ‘doit’:

doit : E C E

• this needs to ‘agree’ with I: p H, c C: doit(I(p),c) = I(pc)

• if E acts as a state we’ll call it Swith the initial state s0 = I(<>)

Page 9: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

proving things – undo

c : c undo ~ null ?

only for c ≠ undo

S

a

S0

S

b

S0

a

b

undo

undo

undo

S

a

S

b

=

Page 10: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

lesson

• undo is no ordinary command!

• other meta-commands:back/forward in browsershistory window

Page 11: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

undo as meta-command

• need to think of ordinary commands C plus augmented commands A:

Ca = C A Ha = seq Ca

• also augmented system state: Sa

• and behaviour:doita: Sa Ca Sa

Ia: Ha Sa

Page 12: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

two state (flip) undo

• system keeps two copies of state:Sa = S S

• ordinary commands update state:doita ( (ssave,s), c ) = ( s, doit(s,c) )

• undo (redo) flips states:doita ( (ssave,s), undo ) = ( s, ssave )

Page 13: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

the real system inside

• the augmented system still needs to be the old system inside!

• link new and old with projection:proj: Sa S

• proj(s) is the old state ‘inside’

Page 14: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

projected state of flip undo ..

Sa = S S

• projected state simply second component:

proja ( (ssave,s) ) = s

Page 15: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

properties of flip undo

• undo really reverses undo:undo undo ~ null (strong-uu)

• undo reverses ordinary commands on projected (original) state

c undo ~proj null (weak-cu)

sa Sa : proj(doita (sa,c undo)) = proj(sa)

Page 16: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

stack (multistep) undo/redo

• augmented state is a stack of states:

Sm = S+ Natsm

0 =<< s0 >, 1 >

projm : Sm Swhere projm(< hs, n >) = hs[n]

Page 17: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

stack (multistep) undo/redo

• obvious (!) update:

doitm(<hs,n>,undo) = <hs,n-1>if n > 1 - otherwise nothing

doitm(<hs,n>,redo) = <hs,n+1>if n < length(hs)

doitm(<hs,n>,c) =<<hs[1…n],doit(hs[n],c)>,n+1>

Page 18: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

properties of multistep undo/redo

• redo really reverses undo:undo redo ~ null (strong-cu)

• undo reverses commands on projected (original) state

c undo ~proj null (weak-cu)

• the only way to satisfy these …

Prove It !

Page 19: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

the real system inside (2)

• behaviour?• if no A commands ever used, identical:

h H : proj(Ia(h)) = I(h)

H

Ia

I

Sa

S

proj

enough?

Page 20: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

conservativeness of state

Sa

Sa

doita

( . ,c)

S S

doit ( . ,c)

proj proj1

0

sa

0

s

proj(sa0 ) = s0

∀c ∈ C, s ∈ Sa : proj(doita(s, c)) = doit(proj(s), c)

Page 21: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

encapsulation

Ha

Sa

Ia

H S

I

eff proj

Page 22: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

conservativeness of effective history

Ha

H

eff

Ha

H

eff

. c

. c

1

<>

<>

∀ c ∈ C, h ∈ Ha : eff(h^c) = eff(h)̂ ceff(<>) = <>

Page 23: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

the cube

Ha

Sa

Ia

H S

I

eff proj

Ha

Sa

Ia

H S

I

eff proj

. c

. c

doita

( . ,c)

doit ( . ,c)

<>

0

sa

1

<> 0

s

∀ c ∈ C, h ∈ Ha : eff(h^c) = eff(h)̂ ceff(<>) = <>

Page 24: The PIE model ‘minimal’ model of interactive system focused on external observable aspects of interaction

full details …

R. Mancini (1997). Modelling Interactive Computing by exploiting the Undo. Dottorato di Ricerca in Informatica, IX-97-5, Università degli Studi di Roma "La Sapienza"