‘let me send relevant pictures to my friends while we...

34
‘Let me send relevant pictures to my friends while we chat.’ Select a picture from a collection Locate relevant items Display a collection of pictures Confirm a selection Show pictures aligned with text Send pictures over a chat connection Builder Chat { void sendPicture(Picture p) { byte[] data = p.serialize(); sendMessage(Messages.PIC, data); } }

Upload: others

Post on 22-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

‘Let me send relevant pictures to my friends while we chat.’

Select a picture from a collection

Locate relevant itemsDisplay a collection of picturesConfirm a selection

Show pictures aligned with text

Send pictures over a chat connection

Builder

Chat { void sendPicture(Picture p) { byte[] data = p.serialize(); sendMessage(Messages.PIC, data); }}

Page 2: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

‘Let me send relevant pictures to my friends while we chat.’

Select a picture from a collection

Locate relevant itemsDisplay a collection of picturesConfirm a selection

Show pictures aligned with text

Send pictures over a chat connection

Builder

Chat { void sendPicture(Picture p) { byte[] data = p.serialize(); sendMessage(Messages.PIC, data); }}

Page 3: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Let people specify their instructions informally

• avoid premature precision

•more helpful to programmers

• enable a new generation of flexible, intelligent(?) programs

FSE2010

Page 4: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Managing Ambiguityby Example

Kenneth C. Arnold and Henry LiebermanMIT Media Lab & Mind Machine Project

{kcarnold,lieber}@media.mit.edu

Page 5: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Managing Ambiguityby Example

Kenneth C. Arnold and Henry LiebermanMIT Media Lab & Mind Machine Project

{kcarnold,lieber}@media.mit.edu

Informality

Page 6: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Informality vs. Ambiguity

• Specs and tests are formal but ambiguous.

• Formal = controlled semantics; incl. programming languages.

Page 7: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Executing informal descriptions is hard!

Select a picture from a collectionShow pictures aligned with text

Send pictures over a chat connection

Page 8: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Strategy:Examples Clarify

Select a picture from a collection

Locate relevant itemsDisplay a collection of pictures

Send pictures over a chat connection

Builder

Chat { void sendPicture(Picture p) { byte[] data = p.serialize(); sendMessage(Messages.PIC, data); }}

Send relevant pictures to my friendswhile we chat

Page 9: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Strategy:Examples Clarify

Select a picture from a collection

Locate relevant itemsDisplay a collection of pictures

Send pictures over a chat connection

Builder

Chat { void sendPicture(Picture p) { byte[] data = p.serialize(); sendMessage(Messages.PIC, data); }}

Send relevant pictures to my friendswhile we chat

Page 10: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Strategy:Examples Clarify

Select a picture from a collection

Locate relevant itemsDisplay a collection of pictures

Send pictures over a chat connection

Builder

Chat { void sendPicture(Picture p) { byte[] data = p.serialize(); sendMessage(Messages.PIC, data); }}

Send relevant pictures to my friendswhile we chat

Page 11: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Two hard parts

• Acquiring and interacting with examples

• Zones: integrate intent into development process

• Finding appropriate examples for new queries

• use code features and natural language background knowledge

Page 12: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Progress on both fronts

• Acquiring and interacting with examples

• Zones: integrate intent into development process

• Finding appropriate examples for new queries

• ProcedureSpace: relates code and informal descriptions using code features and natural language background knowledge

Page 13: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Zones Demo

Page 14: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Backend: Code search?

• At the lowest level (directly to code), if keywords match, maybe.

• Finding vocabulary is a large part of the problem-solving process

•Need to understand the relationship between code and statements of its purpose

Page 15: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

ProcedureSpace Relates Code and Descriptions

chase

(forever (pointTowards: "mouse") (forward: 10))

forever > pointTowards:forever > forward:pointTowards: ~ forward:

follow kind of movementopposite of lead

natural languagedescriptions

background knowledge

code fragments static analysis

Page 16: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Informal Inference

AnalogySpace (Speer et al., AAAI 2008)

Page 17: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Informal Inference

AnalogySpace (Speer et al., AAAI 2008)

Page 18: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Informal Inference

AnalogySpace (Speer et al., AAAI 2008)

Page 19: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Informal Inference

AnalogySpace (Speer et al., AAAI 2008)

Page 20: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Informal Inference

AnalogySpace (Speer et al., AAAI 2008)

Page 21: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Informal Inference

AnalogySpace (Speer et al., AAAI 2008)

Page 22: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Can also blend multiple knowledge sources.

Like code and descriptions.

Blending (Havasi et al., IEEE Intelligent Systems 2009)

Page 23: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

ProcedureSpace Blends Code and Descriptions

• Zones Annotations

• Code Features

• static analysis now, dynamic analysis soon?

• Commonsense Knowledge

•Domain Knowledge

English featurescode fragments

Englishconcepts

codestructural

features

StaticAnalysis

PurposeAnnotations

ConceptNet

domain-specificknowledge

Page 24: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Search Results

Users searched for

• gravity

• follow player

neither result was annotated

Page 25: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Related Ideas

• Keyword Programming: Match keywords, align types, synthesize code. (Little and Miller, ASE ’07)

• Example-Centric Programming: integrated search for examples (Brandt et al., CHI ’10)

Page 26: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Natural Language Programming

•Many attempts to formalize or restrict natural language.

• But that’s unnatural!

Page 27: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Natural Language Programming

•Many attempts to formalize or restrict natural language.

• But that’s unnatural!

• Imprecision is a feature.

Page 28: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Tests, not code?

Page 29: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

‘Let me send relevant pictures to my friends while we chat.’

Select a picture from a collection

Locate relevant itemsDisplay a collection of picturesConfirm a selection

Show pictures aligned with text

Send pictures over a chat connection

Builder

Chat { void sendPicture(Picture p) { byte[] data = p.serialize(); sendMessage(Messages.PIC, data); }}

Page 30: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

‘Let me send relevant pictures to my friends while we chat.’

Select a picture from a collection

Locate relevant itemsDisplay a collection of picturesConfirm a selection

Show pictures aligned with text

Send pictures over a chat connection

Builder

Chat { void sendPicture(Picture p) { byte[] data = p.serialize(); sendMessage(Messages.PIC, data); }}

Page 31: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Let programmersbe informal!

Page 32: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Have you heard of x?

• Probably not.

• Talk afterwards, or email: [email protected]

• (thanks, Professor Forrest)

Page 33: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Getting familiar with existing programs

Page 34: ‘Let me send relevant pictures to my friends while we chat.’alumni.media.mit.edu/~kcarnold/informal... · ‘Let me send relevant pictures to my friends while we chat.’ Select

Try on Python, Java, ... the essence of the analysis is simple