• No results found

Programming by demonstration

N/A
N/A
Protected

Academic year: 2021

Share "Programming by demonstration"

Copied!
82
0
0

Loading.... (view fulltext now)

Full text

(1)

ENSMA

L I S I

Programming by demonstration

A relevant paradigm for applications

that manages huge data

Laboratoire d'Informatique Scientifique et Industrielle

École Nationale Supérieure de Mécanique et d'Aérotechnique

(2)

Programming by demonstration

• Why ?

– Programming by demonstration (PbD) is not data visualization

– PbD deals with user enhancement

– PbD is a good way for giving flexibility

• Who ?

(3)

Contents

• 1- Definition

• 2- Overview

• 3- Concepts

(4)

Definition

• "If a user knows how to perform a task on a

computer, that should be sufficient to create

a program to perfom the task"

– A. Cypher, 1993

• The system spies the user to make a

program

(5)

Definition

• "My idea of how programming should work

was that it should be like teaching someone

how to perform a task"

– H. Lieberman, 2001

• The user teaches the system how to make a

program

(6)

Definitions

• Visual Programming

• Programming by/with example

• Example-based programming

• End-user programming

• Programming by demonstration

• Demonstrational intefaces

(7)

Definitions

• "End-User Programming is a form of

programming done by the end-user to customize the information processing"

– B. Nardi, 1993

• "Programming by example is a powerful end-user programming paradigm enabling computer users without formal training in programming to create sophisticated programs"

(8)

Définitions

• Demonstrational interfaces allow the user to perform actions on concrete example objects, while constructing an abstract program

– Myers, 1993

• Just in time programming is the implementing of algorithms during task-time, the time when the user is actually trying to accomplish the task

(9)

Overview of PbD

• 27 years of history

(10)

Overview: Pygmalion (1975)

(11)

Overview: Pygmalion (1975)

!

(12)

Overview: Pygmalion (1975)

!

6

?

false

true

(13)

Overview: Pygmalion (1975)

!

6

?

false

true

=

(14)

Overview: Pygmalion (1975)

!

6

?

false

true

=

(15)

Overview: Pygmalion (1975)

!

6

?

false

true

=

6

(16)

Overview: Pygmalion (1975)

!

6

?

false

true

=

6

1

(17)

Overview: Pygmalion (1975)

!

6

?

false

true

=

6

false

1

(18)

Overview: Pygmalion (1975)

!

6

?

false

true

=

6

false

1

(19)

Overview: Pygmalion (1975)

!

6

?

false

true

=

6

false

1

false

(20)

Overview: Pygmalion (1975)

!

6

?

false

true

=

6

false

1

false

(21)

Overview

1- The programming age

• 1975 "Pygmalion"

• 1976 "Autoprogrammer"

• 1978 "Exemplary programming" et

"Programming by abstract demonstration"

• 1979 "Tinker" and "Programming by

example"

(22)

Overview: SmallStar (1986)

National Parks Close Name Bryce Zion Canyonlands Proposed Size 1 Page 1 Page 1 Page 0 Dcty Version of 11/12/84 22:40:02 11/12/8422:40:10 11/12/8422:40:19 11/12/8422:40:34 Sample Close

This is some text in a text trame Form field

Button

Park States Zion Utah Vosemite California

Great Smory Mountains North Carolina Tennesse

Halbert Report Letters Calc Program Printer Directory In Out

(23)

Overview: SmallStar (1986)

National Parks Close Name Bryce Zion Canyonlands Proposed Size 1 Page 1 Page 1 Page 0 Dcty Version of 11/12/84 22:40:02 11/12/8422:40:10 11/12/8422:40:19 11/12/8422:40:34 Sample Close

This is some text in a text trame Form field

Button

Park States Zion Utah Vosemite California

Great Smory Mountains North Carolina Tennesse

Halbert Report Letters Calc Program Printer Directory In Out Run Program

Close Start Record'g Stop Record'g 1st Step Step Run

Program

Move bryce to National Parks

Move cedar Breaks to National Monuments. Copy Itinerary to the Desktop (copy is ).

(24)

Overview

2- The "Direct Manipulation" age

• 1983 "Direct manipulation"

• 1984 "Rehearsal world" et "Smallstar"

• 1986 "MIKE" and "Peridot"

• 1988 "Graphical search and replace"

• 1991 "Macros by example"

(25)
(26)

Overview: Eager

• Suppose you want to make a numbered list

of your emails (title+subject) in your text

editor

(27)

Overview: Eager

• Suppose you want to make a numbered list

of your emails (title+subject) in your text

editor

(28)

Overview: Eager

• Suppose you want to make a numbered list

of your emails (title+subject) in your text

editor

– Write '1' in the text editor

(29)

Overview: Eager

• Suppose you want to make a numbered list

of your emails (title+subject) in your text

editor

– Write '1' in the text editor

– Copy the first mail subject in the mailer – Paste in the text editor

(30)

Overview: Eager

• Suppose you want to make a numbered list

of your emails (title+subject) in your text

editor

– Write '1' in the text editor

– Copy the first mail subject in the mailer – Paste in the text editor

(31)
(32)

Overview: Eager

(33)

Overview: Eager

– Paste in the text editor

(34)

Overview: Eager

– Paste in the text editor

– Write '2' in the text editor

(35)

Overview: Eager

– Paste in the text editor

– Write '2' in the text editor

– Copy the second mail subject in the mailer – …

(36)

Overview: Eager

– Paste in the text editor

– Write '2' in the text editor

– Copy the second mail subject in the mailer – …

(37)

Overview: Eager

– Paste in the text editor

– Write '2' in the text editor

– Copy the second mail subject in the mailer – …

– Write '3' in the text editor

I guess I can help you. Do you want me to try ?

(38)

Overview: Eager

– Paste in the text editor

– Write '2' in the text editor

– Copy the second mail subject in the mailer – …

– Write '3' in the text

(39)

Overview: Eager

– Paste in the text editor

– Write '2' in the text editor

– Copy the second mail subject in the mailer – …

– Write '3' in the text

– Copy the third mail subject in the mailer

(40)

Overview

3- The Inference age

• 1988 - "Tels"

• 1990 - "Eager" et "Turvy"

• 1991 - "Mondrian"

(41)
(42)
(43)
(44)
(45)
(46)
(47)
(48)

Overview

4- The rules editing age

• "KidSim", "Cocoa" puis "Stagecast Creator"

• "AgentSheets"

• "Pavlov" vs. "Gamut"

(49)

Overview: Grammex

• Suppose you want to define a grammar to

parse an email address. Ex.

[email protected]

• The system

lieber @ media . mit . edu

(50)

Overview: Grammex

media . mit

• New grammar

– HOST

• Select "media.mit" • The system gives its

interpretation • Correct it

• The system knows "HOST" as...

(51)

Overview: Grammex

media . mit

• New grammar

– HOST

• Select "media.mit" • The system gives its

interpretation • Correct it

• The system knows "HOST" as...

(52)

Overview: Grammex

media . mit

• New grammar

– HOST

• Select "media.mit" • The system gives its

interpretation • Correct it

• The system knows "HOST" as...

lieber @

. edu

(53)

Overview: Grammex

media . mit

• New grammar

– HOST

• Select "media.mit" • The system gives its

interpretation • Correct it

• The system knows "HOST" as...

lieber @

. edu

(54)

Overview

5- The intelligent agent age

• "Internet Scapbook" et "SmallBrowse"

• "Dynamic macros", "SmartEdit",

"Grammex", "SWYN"

(55)
(56)
(57)

Overview

6- Industrial PbD

• 1990 "LIKE" et "EBP"

• 1992 Les systèmes paramétriques

– Systèmes variationnels

– Systèmes paramétriques purs

(58)

General idea

• "A software agent records the interactions between the user and a conventional "direct-manipulation" interface, and writes a program that corresponds to the user's actions. The agent can then generalize the program so that it can work in other situations similar to, but not exactly the same as, the

examples on which it is taught."

(59)

Problem's heart

• "The main challenge confronting Programming by Demonstration is how to infer the user's intent"

– A. Cypher, 1993

• "Generalization is the central problem of PBE and, ultimately, should enable PBE to completely

replace conventional programming"

(60)

PbD Mechanisms

• Total inference

• Interactive inference

• Macro-recording

• Agents

• Modeling and PbD

(61)

Mechanisms

Total inference

• "infering from traces"

• The user gives the inputs and the expected

outpurs

• The system deduces the algorithm that is

able to realize the task

(62)

Mechanisms

Total inference

• The system is intelligent !

• Strongly limitated

– LISP programs

– Variational approach in CAD

(63)

Mechanisms

Total inference

Une famille = Un modèle + des contraintes D L 2*L /3

+

=

Avantages • Simple d'utilisation • Théoriquement illimité Inconvénients • Lenteur relative • Surtout 2D ou 2D et demi • Ne peut que varier

(64)

Mechanisms

Total inference

• Advantages

– Not "How", only "What" – Natural specifications

• Drawbacks

– Completude problems – Magic !

(65)

Mechanisms

Interactive inference

• In Example-Base Programming

– Give 2 different series of data to allow the system to infer an alternative structure

• In Peridot

– Generalizes alignment rules from approximate sketches

(66)

Mechanisms

Interactive inference

Commands Circle Edit-Picture MOUSEDependent Rectangle Run-Procedure StringFromSelect Add-Return-Stmt ChangeDrawFnc ChangeFont Conditional Exit FixActive Icon Iteration MOUSE-Exception ReCalcConstraint RefreshAll Reinitialize ResetMOUSE Selection String Write-Procedure P E R I D O T Parameters to MyMenu

Items = ("Replace" "Move" "Copy" "Delete" "Delete All "Exit" SomeItems = ("Move" "Delete"

OtherShades = (1 65 3345 34401 43405 31710 -1

CurrenItem "Move"

ActiveColors = (65 34401 43405 31710 -1 ScrollControl (2000 75

**Mouse** (-39 -12 nil nil nil **Clock** (NIL 0 active values Drawing Area V Hello there

Creating function My Menu 0

(QUOTE (PLUS 3 (Field BlackRect0369 LEFT))) (QUOTE (PLUS 3 (Field BlackRect0369 BOTTOM))) (QUOTE (PLUS -6 (Field BlackRect0369 WIDTH))) (QUOTE (PLUS -6 (Field BlackRect0369 HEIGHT))) (QUOTE (INPUT . REPLACE)))

(RUNICON.CREATE (QUOTE Icon0371) (QUOTE CheckMarkBM)

(QUOTE (PLUS (QUOTIENT (DIFFERENCE (Field WhiteRect0370

WIDTH) (Field ME WIDTH)) 2)

(Field WhiteRect0370 LEFT))

(QUOTE (PLUS (QUOTIENT (DIFFERENCE (Field WhiteRect0370

HEIGHT) (Field ME HEIGHT)) 2)

(Field WhiteRect0370 BOTTOM))) (QUOTE (INPUT . REPLACE))) (RunFillCircle.CREATE (QUOTE GrayCircle0372) 42405

(QUOTE (PLUS (PLUS 35 (Field WhiteRect0370 WIDTH)) (Field WhiteRect0370 LEFT)))

(QUOTE (PLUS (QUOTIENT (DIFFERENCE (Field WhiteRect0370

HEIGHT)

(Field WhiteRect0370 BOTTOM))) 18

User interaction

The Gray circle (GrayCircle0372) (marked with an N) seems to be centered vertically and at the right of the white rectangle WhiteRect0370] (marked with WRT) offset horizontally by 35

(67)

Mechanisms

Interactive inference

• Is it really inference?

• Do we really unknow what to do?

– We give explicitly two cases…

– We make approximate alignment…

(68)

Mechanisms

Macro-recording

• Many generalization techniques

– On objects

• Constants, variables, "iterative variables" • Naming...

– Portant sur les structures de contrôles

• Alternative • Iteration

(69)

Mechanisms

Macro-recording

• Many generalization techniques

– Explicit techniques

• A posteriori (coded editing)

• A priori (purely interactive, with menu, button)

– Implicit techniques

• With predefined rules

(70)

Mechanisms

Macro-recording

• Program representation

– Why?

• Is Macro recording complete? • Debugging?

– Textual vs. Graphic vs. No representation – Editable program vs. Non editable

(71)

Mechanisms

Agents -

1. Limited agents

• The spy principle...

• Eager

– As soon as a sequence of user actions looks repetitive, it appears…

– and proposes to help the user in ending the task – A very intrusive system...

(72)

Mechanisms

Agents -

1. Limited agents

• Dynamic Macro

– All operations are recorded in a log file (cf. Marco recording)

– On explicit request (REPEAT), the system

searches into the log file a repeated sequence, and generalizes it

(73)

Mechanisms

Agents -

2. Instructible agents

• ScrapBook, Wrapper, Grammex…

(74)

Mechanisms

Agents -

3. Programmable agents

• StageCast Creator, Cocoa, Gamut…

• A simple programming metaphor:

event-response (before/after)

• Complex behaviors are possible by

composition

(75)

Mechanisms

Towards modelisation

• One example that actually works:

parametric systems

(76)

Mechanisms

Towards modelisation

Une famille = Un modèle contraint

= D L E 2*L/3 U U U 2*L/3 Avantages • Simple d'utilisation • 3D (CSG) Inconvénients • Difficilement modifiable • Ne peut pas tout traiter : - contraintes multiples - manque de structures de

(77)

Application domains

• Programming learning

• Simulation

• Utilities

– Macros, GUI-Builder, tasks automating, instructible agents

• End-User Programming

(78)

PbD, a relevant approach

an example: biologists

• Experts

• Strong needs for flexibility

– Experimentation

– Kleenex programming

• They don't want "magic programs"

• They don't like programming (syntax, bugs)

• They are able to understand concepts

(79)

PbD, a relevant approach

an example: biologists

• PbD avoids syntactic problems

• Many non intrusive solutions exist

• Many tasks are first exploratory tasks, and

then repetitive tasks

• But, inference is not usable (magic)

(80)

Some false ideas

• PbD is inference, e.g. A.I.

• PbD is not complete programming

• PbD is restricted to some limited domains

(visual)

• PbD is only for novices

• PbD is not actually in use

(81)

Bibliography

• "Whatch What I Do: Programming by

Demonstration"

– A. Cypher, 1993, MIT Press

• "A Small Matter of Programming"

– B. Nardi, 1993, MIT Press

• "Your Wish Is My Command:

Programming by Example"

(82)

PbD, a relevant approach

• "Users are now at the mercy of software providers who delover shrink-wrapped, one-size-fits-all,

unmodifiable "applications". With PBE, users could create personalized solutions to one-of-a-kind problems, modifying and creating existing new ones, without going through the arcane

voodoo that characterizes conventional programming"

References

Related documents

Antimicrobial activity of crude extracts and essential oil of Callistemon viminalis against several pathogenic bacteria and one yeast (Candida albicans) were assessed

Compared to regular sparse grids, already our standard strategy for adaptive refinement significantly reduces the number of grid points which are required to obtain a certain

Drainage SolutionS anD Water treatment / HDPe Drainage tuBing (Big o) ProDuCt guiDe Single-Wall CorrugateD Drainage tuBing iS iDeal for agriCultural anD..

Suppose your campaign call database isn’t very clean, or the list of customers you bought wasn’t very good. If you use the Progressive Dialler, most of the calls your users make

First of all, dyadic learning often plays out in the form of (mutual) explanations in which one learner provides information to her partner, or conversely, a

products known as HardieFlex™ Sheet (the “Product”) for a period of 10 years from the date of purchase, that: the product will be free from defects due to defective factory

M3 Keiser Cycle with Computerised Screen - Adjustable Shimano™ Combo Pedals, Dual Placement Handles, Four-Way Adjustable Seat Position, Adjustable Handlebar Height, Non Wear

The Council noted that nine of the existing councillors had been nominated and elected. Both Gamston and Eaton parishes have the required number of councillors and the