TOGETHER AT LAST Ravi Chugh, Brian Hempel, Mitchell Spradlin, Jacob - - PowerPoint PPT Presentation

together at last
SMART_READER_LITE
LIVE PREVIEW

TOGETHER AT LAST Ravi Chugh, Brian Hempel, Mitchell Spradlin, Jacob - - PowerPoint PPT Presentation

PROGRAMMATIC AND DIRECT MANIPULATION TOGETHER AT LAST Ravi Chugh, Brian Hempel, Mitchell Spradlin, Jacob Albers Program 2 Program 2 Changed Program Program 2 Changed Program Program 2 Changed Changed Program Program Program


slide-1
SLIDE 1

PROGRAMMATIC AND DIRECT MANIPULATION

TOGETHER AT LAST

Ravi Chugh, Brian Hempel, Mitchell Spradlin, Jacob Albers

slide-2
SLIDE 2

Program

2

slide-3
SLIDE 3

Program

2

slide-4
SLIDE 4

Program

2

Changed Program

slide-5
SLIDE 5

Program

2

Changed Program

slide-6
SLIDE 6

Program

2

Changed Program Changed Program (again)

slide-7
SLIDE 7

Program

2

Changed Program Changed Program (again)

slide-8
SLIDE 8

Program

2

Changed Program Changed Program (again) Changed Program

(again again)

slide-9
SLIDE 9

Program

2

Changed Program Changed Program (again) Changed Program

(again again)

slide-10
SLIDE 10

Program

3

slide-11
SLIDE 11

Program

3

slide-12
SLIDE 12

Program

3

slide-13
SLIDE 13

Program

3

Changed Program

slide-14
SLIDE 14

Program

3

Changed Program

GOAL: Live Sync

slide-15
SLIDE 15

Program

3

Changed Program

Fast + Intuitive + Automatic

GOAL: Live Sync

slide-16
SLIDE 16

SIMPLE EXAMPLE

4

slide-17
SLIDE 17

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

5

slide-18
SLIDE 18

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

6

slide-19
SLIDE 19

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

7

slide-20
SLIDE 20

x2 = 110

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

8

slide-21
SLIDE 21

x2 = 110 x2’ = 155

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

8

slide-22
SLIDE 22

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

x2’ = 155 x2 = 110

GOAL

Change program so

xi = 155

when i = 2

9

slide-23
SLIDE 23

x2’ = 155

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

10

slide-24
SLIDE 24

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = if i=2 then 155 else x0+i*sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

x2’ = 155

11

slide-25
SLIDE 25

let (x0, y0, w, h, sep, n) = (95, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

x2’ = 155

12

slide-26
SLIDE 26

let (x0, y0, w, h, sep, n) = (95, 120, 20, 90, 52.5, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

x2’ = 155

13

slide-27
SLIDE 27

let (x0, y0, w, h, sep, n) = (65, 120, 20, 90, 55, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

x2’ = 155

14

slide-28
SLIDE 28

let (x0, y0, w, h, sep, n) = (75, 120, 20, 90, 40, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

x2’ = 155

15

slide-29
SLIDE 29

let (x0, y0, w, h, sep, n) = (95, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

x2’ = 155

16

slide-30
SLIDE 30

155 = x0 + 2*sep

xi ↦ if i=2 then 155 else x0 + i * sep x0 ↦ 75, sep ↦ 40 x0 ↦ 55, sep ↦ 50 x0 ↦ …, sep ↦ … x0 ↦ 95 sep ↦ 52.5

x2’ = 155

17

slide-31
SLIDE 31

xi ↦ if i=2 then 155 else x0 + i * sep

155 = x0 + 2*sep

x0 ↦ 75, sep ↦ 40 x0 ↦ 55, sep ↦ 50 x0 ↦ …, sep ↦ … x0 ↦ 95 sep ↦ 52.5

x2’ = 155

GOAL

Intuitive Changes

18

slide-32
SLIDE 32

155 = x0 + 2*sep

x0 ↦ 75, sep ↦ 40 x0 ↦ 55, sep ↦ 50 x0 ↦ …, sep ↦ … x0 ↦ 95 sep ↦ 52.5

x2’ = 155

xi ↦ if i=2 then 155 else x0 + i * sep

19

slide-33
SLIDE 33

155 = x0 + 2*sep

xi ↦ if i=2 then 155 else x0 + i * sep x0 ↦ 75, sep ↦ 40 x0 ↦ 55, sep ↦ 50 x0 ↦ …, sep ↦ … x0 ↦ 95 sep ↦ 52.5

x2’ = 155

20

slide-34
SLIDE 34

155 = x0 + 2*sep

xi ↦ if i=2 then 155 else x0 + i * sep x0 ↦ 75, sep ↦ 40 x0 ↦ 55, sep ↦ 50 x0 ↦ …, sep ↦ … x0 ↦ 95 sep ↦ 52.5

x2’ = 155

21

slide-35
SLIDE 35

155 = x0 + 2*sep

x0 ↦ 95 sep ↦ 52.5

x2’ = 155

“Small Updates”

22

slide-36
SLIDE 36

x0 ↦ 95 sep ↦ 52.5

x2’ = 155

?

23

slide-37
SLIDE 37

x0 ↦ 95 sep ↦ 52.5

x2’ = 155

?

GOAL

Automatic

24

slide-38
SLIDE 38

x2’ = 155

A HEURISTIC

x0 ↦ 95 sep ↦ 52.5

25

slide-39
SLIDE 39

x2’ = 155

A HEURISTIC

x0 ↦ 95 sep ↦ 52.5

26

slide-40
SLIDE 40

A HEURISTIC

27

slide-41
SLIDE 41

A HEURISTIC

x0 ↦ … sep ↦ …

28

slide-42
SLIDE 42

A HEURISTIC

x0 ↦ … sep ↦ …

29

slide-43
SLIDE 43

A HEURISTIC

x0 ↦ … sep ↦ …

30

slide-44
SLIDE 44

A HEURISTIC

x0 ↦ … sep ↦ …

31

slide-45
SLIDE 45

A HEURISTIC

x0 ↦ … sep ↦ …

32

slide-46
SLIDE 46

A HEURISTIC

x0 ↦ … sep ↦ …

33

slide-47
SLIDE 47

A HEURISTIC

x0 ↦ … sep ↦ …

34

slide-48
SLIDE 48

A HEURISTIC

x0 ↦ … sep ↦ …

35

slide-49
SLIDE 49

A HEURISTIC

36

sep x0 x0 x0 sep

slide-50
SLIDE 50

37

Small Updates

!

Heuristics

!

Traces

!

Simple Solver

slide-51
SLIDE 51

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

x2 = 110

38

slide-52
SLIDE 52

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

x2 = 110

38

slide-53
SLIDE 53

TRACES

39

let a = 3 in let b = 5 in a + b

8

slide-54
SLIDE 54

TRACES

let a = 3 in let b = 5 in a + b

8

40

slide-55
SLIDE 55

TRACES

let a = 3a in let b = 5b in a + b

8

41

slide-56
SLIDE 56

TRACES

let a = 3a in let b = 5b in a + b

8a+b

42

slide-57
SLIDE 57

x0 + 2*sep

x2 =

43

110x0 + 2*sep 110

x0 x0 sep

slide-58
SLIDE 58

x0 + 2*sep

x2 =

44

110x0 + 2*sep 110

x0 x0 sep

slide-59
SLIDE 59

45

x0 x0 sep

=

x0 + 2*sep

x2 = 110x0 + 2*sep 110

slide-60
SLIDE 60

46

x0 x0 sep

=

sep x0 + 2*

slide-61
SLIDE 61

47

x0 x0 sep

=

sep

155

x0 + 2*

slide-62
SLIDE 62

=

sep

155

+ 2*

x0

48

x0 x0 sep

slide-63
SLIDE 63

= 155

+ 2*30

x0

49

x0 x0 sep

slide-64
SLIDE 64

= 155

+ 2*30

x0

50

95

x0 x0 sep

slide-65
SLIDE 65

51

= 155

+ 2*30

x0

95

slide-66
SLIDE 66

TRACE LANGUAGE

e ⇓ nt

52

slide-67
SLIDE 67

TRACE LANGUAGE

e ⇓ nt

t ::= x | t1 + t2 | t1 * t2 | sin t | pow t1 t2

...

52

slide-68
SLIDE 68

TRACE LANGUAGE

e ⇓ nt

t ::= x

n’ = t

| t1 + t2 | t1 * t2 | sin t | pow t1 t2

...

52

slide-69
SLIDE 69

TRACES

let a = 3a in let b = 5b in a + b

!

53

slide-70
SLIDE 70

TRACES

let a = 3a in let b = (true ? 5b1 : 6b2) in a + b

54

slide-71
SLIDE 71

TRACES

let a = 3a in let b = (true ? 5b1 : 6b2) in a + b

8a+b1

54

slide-72
SLIDE 72

t ::= x | t1 + t2 | t1 * t2 | sin t | pow t1 t2

...

55

slide-73
SLIDE 73

SOLVER

56

5*sin(x) = n x*(y + y2) = n x2 = n

✓ ✓ ✓

Can solve for x if x only occurs once.

slide-74
SLIDE 74

SOLVER

56

5*sin(x) = n x*(y + y2) = n x*(x + y2) = n x2 = n x*x = n

✓ ✓ ✗ ✓ ✗

Can solve for x if x only occurs once.

slide-75
SLIDE 75

SOLVER

56

5*sin(x) = n x*(y + y2) = n x*(x + y2) = n x2 = n x*x = n

✓ ✓ ✗ ✓ ✗

Can solve for x if x only occurs once. Good for 80% of equations.

slide-76
SLIDE 76

57

Small Updates

!

Heuristics

!

Traces

!

Simple Solver

slide-77
SLIDE 77

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

58

slide-78
SLIDE 78

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 1. Evaluate


with Traces

58

slide-79
SLIDE 79

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 2. Prepare for


User Actions
 with Heuristics

  • 1. Evaluate


with Traces

58

slide-80
SLIDE 80

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 2. Prepare for


User Actions
 with Heuristics

  • 1. Evaluate


with Traces

?

58

x0 sep

slide-81
SLIDE 81

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 2. Prepare for


User Actions
 with Heuristics

  • 1. Evaluate


with Traces

x0 ?

58

x0 sep

x0
slide-82
SLIDE 82

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 2. Prepare for


User Actions
 with Heuristics

  • 1. Evaluate


with Traces

x0 sep?

58

x0 sep

x0 sep
slide-83
SLIDE 83

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 2. Prepare for


User Actions
 with Heuristics

  • 1. Evaluate


with Traces

x0 sep x0

58

x0 sep x0
slide-84
SLIDE 84

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 2. Prepare for


User Actions
 with Heuristics

  • 3. Live Sync
  • 1. Evaluate


with Traces

x0 sep x0

58

x0 sep x0
slide-85
SLIDE 85

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 2. Prepare for


User Actions
 with Heuristics

  • 3. Live Sync
  • 1. Evaluate


with Traces

x0 sep x0

User Changes Output;

58

x0 sep x0
slide-86
SLIDE 86

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 2. Prepare for


User Actions
 with Heuristics

  • 3. Live Sync
  • 1. Evaluate


with Traces

x0 sep x0

User Changes Output;

58

= 155

+ 2*30

x0

x0 sep x0
slide-87
SLIDE 87

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 2. Prepare for


User Actions
 with Heuristics

  • 3. Live Sync

Solve Trace Equation;

  • 1. Evaluate


with Traces

x0 sep x0

User Changes Output;

58

= 155

+ 2*30

x0

x0 sep x0
slide-88
SLIDE 88

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 2. Prepare for


User Actions
 with Heuristics

  • 3. Live Sync

Solve Trace Equation;

  • 1. Evaluate


with Traces

x0 sep x0

User Changes Output;

58

= 155

+ 2*30

x0

95

x0 sep x0
slide-89
SLIDE 89

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 2. Prepare for


User Actions
 with Heuristics

  • 3. Live Sync

Solve Trace Equation; Apply Small Update;

  • 1. Evaluate


with Traces

x0 sep x0

User Changes Output;

58

95

x0 sep x0
slide-90
SLIDE 90

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 2. Prepare for


User Actions
 with Heuristics

  • 3. Live Sync

Solve Trace Equation; Apply Small Update;

  • 1. Evaluate


with Traces

x0 sep x0

Re-run and Render User Changes Output;

58

95

x0 sep x0
slide-91
SLIDE 91

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 2. Prepare for


User Actions
 with Heuristics

  • 3. Live Sync

Solve Trace Equation; Apply Small Update;

  • 1. Evaluate


with Traces

x0 sep x0

Re-run and Render User Changes Output;

58

95

slide-92
SLIDE 92

Sketch-n-Sketch

59

slide-93
SLIDE 93
  • 60
slide-94
SLIDE 94
  • 61
slide-95
SLIDE 95
  • 62
slide-96
SLIDE 96
  • 63
slide-97
SLIDE 97
  • 64
slide-98
SLIDE 98
  • 65
slide-99
SLIDE 99
  • 66
slide-100
SLIDE 100
  • 67
slide-101
SLIDE 101
  • 68
slide-102
SLIDE 102
  • 69
slide-103
SLIDE 103
  • 70
slide-104
SLIDE 104
  • 71
slide-105
SLIDE 105
  • 72
slide-106
SLIDE 106
  • 73
slide-107
SLIDE 107
  • 74
slide-108
SLIDE 108
  • 75
slide-109
SLIDE 109
  • 76
slide-110
SLIDE 110
  • 77
slide-111
SLIDE 111
  • 78
slide-112
SLIDE 112
  • 79
slide-113
SLIDE 113
  • 80
slide-114
SLIDE 114
  • 81
slide-115
SLIDE 115
  • 82
slide-116
SLIDE 116
  • 83
slide-117
SLIDE 117
  • 84
slide-118
SLIDE 118
  • 85
slide-119
SLIDE 119
  • 86
slide-120
SLIDE 120

Custom User Interface Widgets

87

slide-121
SLIDE 121
  • 88
slide-122
SLIDE 122
  • 89
slide-123
SLIDE 123
  • 90
slide-124
SLIDE 124
  • 91
slide-125
SLIDE 125
  • 92
slide-126
SLIDE 126
  • 93
slide-127
SLIDE 127
  • 94
slide-128
SLIDE 128
  • 95
slide-129
SLIDE 129
  • 96
slide-130
SLIDE 130
  • 97
slide-131
SLIDE 131
  • 98
slide-132
SLIDE 132
  • 99
slide-133
SLIDE 133
  • 100
slide-134
SLIDE 134
  • 101
slide-135
SLIDE 135
  • 102
slide-136
SLIDE 136

DEMOS

103

slide-137
SLIDE 137

Just google “sketch n sketch”

Demos on YouTube

Sketch-n-Sketch

https://ravichugh.github.io/sketch-n-sketch

104

slide-138
SLIDE 138

FUTURE WORK

105

slide-139
SLIDE 139

106

  • Traces

Heuristics Solver

slide-140
SLIDE 140

107

Program

slide-141
SLIDE 141

107

Program

slide-142
SLIDE 142

108

slide-143
SLIDE 143

108

slide-144
SLIDE 144

108

Program

slide-145
SLIDE 145

108

Program

slide-146
SLIDE 146

109

Program

slide-147
SLIDE 147

110

Program

PROGRAMMATIC AND DIRECT MANIPULATION

IN OTHER DOMAINS

slide-148
SLIDE 148

RELATED WORK

111

slide-149
SLIDE 149

Old Program: Constants: User Action: “Sketch” “Holes” “Example”

PROGRAM SYNTHESIS

112

slide-150
SLIDE 150

LIVE SYNC

Numbers + Heuristics

PROGRAM ← OUTPUT

String Origin Analysis for PHP by Wang et al.

String Literals

113

slide-151
SLIDE 151

LIVE SYNC

constraints in synthesis only

CONSTRAINTS

Sketchpad, ThingLab, Babelsberg, … constraints in language

114

slide-152
SLIDE 152

BX PROGRAMMING

Boomerang, biXid, Beanbag…

LIVE SYNC

DSL

View Data

115

slide-153
SLIDE 153

LIVE SYNC

λ-calc + DM

  • PROG. BY MANIPULATION

Victor, Apparatus, PBM for Layout, …

DM + DSL

116

slide-154
SLIDE 154

Program

117

slide-155
SLIDE 155

Program

117

slide-156
SLIDE 156

Program

117

slide-157
SLIDE 157

Program

117

Changed Program

slide-158
SLIDE 158

Program

117

Changed Program

Live Sync

slide-159
SLIDE 159

Program

117

Changed Program

Fast + Intuitive + Automatic

Live Sync

slide-160
SLIDE 160

Program

117

Changed Program

Fast + Intuitive + Automatic

Live Sync

Thank You!

slide-161
SLIDE 161

let (x0, y0, w, h, sep, n) = (50, 120, 20, 90, 30, 3)

!

let boxi i = let xi = x0 + i * sep in rect 'lightblue' xi y0 w h

!

map boxi (zeroTo n)

  • 2. Prepare for


User Actions
 with Heuristics

  • 3. Live Sync

Solve Trace Equation; Apply Small Update;

  • 1. Evaluate


with Traces

Re-run and Render User Changes Output;

118

= 155

+ 2*30

x0

95

x0 sep

slide-162
SLIDE 162

Extra Slides

119

slide-163
SLIDE 163

USER STUDY

120

Before After Histograms Figure 9. The goal of each task (Ferris Wheel, Keyboard,

slide-164
SLIDE 164

TIMINGS

121

Operation Min Med Avg Max Parse 9 ms 53 ms 77 ms 520 ms Eval <1 ms 5 ms 12 ms 165 ms Prepare 1 ms 13 ms 200 ms 6,789 ms Solve <1 ms <1 ms <1 ms 14 ms

slide-165
SLIDE 165

SOLVABILITY

122

Unique Pre-Equations 4,574 Outside Fragment 919 20% Inside Fragment 3,655 No Solution for d = 1 194 4% Solution for d = 1 3,461 No Solution for d = 100 438 10% Solution for d = 100 3,023 66%

slide-166
SLIDE 166

AMBIGUITY

123

Zones 14,106 Inactive 991 7% Active 13,115 Unambiguous 4,856 34% Ambiguous 8,259 59%