Incremental Interactive Computation
Matthew Hammer hammer@cs.umd.edu
1 Tuesday, October 7, 2014
Incremental Interactive Computation Matthew Hammer - - PowerPoint PPT Presentation
Incremental Interactive Computation Matthew Hammer hammer@cs.umd.edu Tuesday, October 7, 2014 1 Incremental Interactive Computation Matthew Hammer hammer@cs.umd.edu Tuesday, October 7, 2014 2 Batch Computation vs Interactive Computation
Matthew Hammer hammer@cs.umd.edu
1 Tuesday, October 7, 2014
Matthew Hammer hammer@cs.umd.edu
2 Tuesday, October 7, 2014
Input Output
Input Output
3 Tuesday, October 7, 2014
Creates input Demands Output
Interacting User Reactive Computation Mutates input Demands Output
4 Tuesday, October 7, 2014
between input and output structures
5 Tuesday, October 7, 2014
6 Tuesday, October 7, 2014
Input Output
Input Output
Claim: Interesting interactive systems consist of incremental computations
7 Tuesday, October 7, 2014
Input Structure Cell Formulae Incremental Computation Formula evaluation Output Structure Cell values
8 Tuesday, October 7, 2014
Input Structure Document Content Incremental Computation Spell-check each word Output Structure Highlight misspellings
9 Tuesday, October 7, 2014
Input Structure Text file Computation Parse tokens Output Structure AST Input Structure AST Computation Lexical scoping Output Structure Def/use edges Input Structure AST + Def/use Computation Type inference Output Structure Type errors
10 Tuesday, October 7, 2014
11 Tuesday, October 7, 2014
Example: Spreadsheet Cells change slowly Example: Word processing Document and dictionary both change slowly Example: Programming Program changes slowly
12 Tuesday, October 7, 2014
Example: Spreadsheet One worksheet is active, others hidden Example: Word processing Viewport shows one
Example: Programming Viewport shows one file, module or function
13 Tuesday, October 7, 2014
14 Tuesday, October 7, 2014
15 Tuesday, October 7, 2014
max 1 2 3 4 + min + * max min
16 Tuesday, October 7, 2014
max 1 2 3 4 + min + * max min
17 Tuesday, October 7, 2014
max 2 1 2 3 4 + 5 min + 7 * max 7 min
18 Tuesday, October 7, 2014
max 2 1 2 3 4 + 5 min + 7 * max 7 min
19 Tuesday, October 7, 2014
max 2 1 2 3 4 + 5 min 3 + 7 * 15 max 7 min 3
20 Tuesday, October 7, 2014
max 2 1 2 3 4 + 5 min 3 + 7 * 15 max 7 min 3
21 Tuesday, October 7, 2014
max 2 1 2 3 4 + 5 min 3 + 7 * 15 max 7 min 3
22 Tuesday, October 7, 2014
max 2 1 10 3 4 + 5 min 3 + 7 * 15 max 7 min 3
23 Tuesday, October 7, 2014
max 2 1 10 3 4 + 5 min 3 + 7 * 15 max 7 min 3
24 Tuesday, October 7, 2014
max 2 1 10 3 4 + 13 min 3 + 7 * 26 max 7 min 3
25 Tuesday, October 7, 2014
26 Tuesday, October 7, 2014
type 'a thunk = unit -> 'a let force : 'a thunk -> 'a = fun t -> t () type 'a lzlist = [ | `Nil | `Cons of 'a * ('a lzlist thunk) ] let rec from_list l = match l with | [] -> `Nil | h::t -> `Cons(h,fun()->from_list t)
27 Tuesday, October 7, 2014
type 'a lzlist = [ | `Nil | `Cons of 'a * ('a lzlist thunk) ] let rec merge l1 l2 = function |l1, `Nil -> l1 |`Nil, l2 -> l2 |`Cons(h1,t1), `Cons(h2,t2) -> if h1 <= h2 then `Cons(h1, fun()->merge (force t1) l2) else `Cons(h2, fun()->merge l1 (force t2))
28 Tuesday, October 7, 2014
Input [3,5,8,2,1,7] Singletons [ [3], [5], [8], [2], [1], [7] ] Merge #1 [ [3,5], [2,8], [1,7] ] Merge #2 [ [3,5], [1,2,7,8] ] Merge #3 [ [3,5], [1,2,7,8] ] Merge #4 [ [1, 2, 3, 5, 7, 8 ] ] Flatten [1, 2, 3, 5, 7, 8 ]
29 Tuesday, October 7, 2014
30 Tuesday, October 7, 2014
31 Tuesday, October 7, 2014
32 Tuesday, October 7, 2014