1 / 44

Programming with Pictures & Wet Stuff at University of Virginia

Learn about ToonTalk, a game for making video games, and declarative programming using Prolog at University of Virginia's CS 655 course. Get advice on giving presentations and practicing talks for a research career.

fjansen
Download Presentation

Programming with Pictures & Wet Stuff at University of Virginia

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 23: Programming with Pictures & Programming Wet Stuff “ToonTalk is a video game for making video games.” David Kahn, age 10. “It's an animated world that lets kids make, run, debug, and trade programs.” Ken Kahn, David's dad David Evans http://www.cs.virginia.edu/~evans CS655: Programming Languages University of Virginia Computer Science

  2. Menu • Rotunda Presentations • Non-text based Programming • Amorphous Computing University of Virginia CS 655

  3. Course Evaluations • You should have received email • Fill out the official evaluation at: http://www.people.virginia.edu/~ad4n/seas_evals/ • Must fill in before May 5 • Once you do, send me email to get the real evaluation • Specific questions like the midterm evaluation • Fill out after the final (this is an important part of the course to evaluate, no matter what SEAS thinks!) University of Virginia CS 655

  4. Rotunda Presentations • Monday, 6:30 pm • Laptop projector, screen, laptop with PowerPoint • If you need something else, let me know • Not all group members need talk • Aim for about 15 minutes (no more than 20) • Invite guests (but number limited) University of Virginia CS 655

  5. Giving a Good Rotunda Talk • Pretend its a research conference talk • Your audience knows about the field, but not your specific area • Your goal is to make them want to learn more about your work • A good talk tells a story • Not a collection of slides University of Virginia CS 655

  6. Beginning • Motivate your work • Convey why the problem you are solving is interesting, important and exciting • It helps when you think so yourself, but act if you don’t • Place your work in context: how is it different from what others have done • Can do this at end instead • Teaser for your results – why should we listen to the rest of the talk? • Don’t need a full outline, but let audience know enough so they want to listen to the rest University of Virginia CS 655

  7. Middle • Explain your solution • Don’t be comprehensive – convey the big picture • Use pictures, metaphors, examples, etc. to explain what you did • Convey one technical nugget • Show one neat technical thing that came out of your work. Could be: • A surprising example • A design idea • A formalism University of Virginia CS 655

  8. Last Third • Evaluation • Explain how you evaluated your work • Present your results • Conclude • Summarize your conclusions with one key point University of Virginia CS 655

  9. Some Specific Advice • Average 2 minutes per slide • Simple slides: big text, use pictures, less words than this slide • Figure out what the most important 1 or 2 sentences in your talk are and memorize them • Practice • I will listen to any group that wants to practice their talk Sunday night; email your preferred time 6pm-midnight. University of Virginia CS 655

  10. Giving good talks is one of the most important ingredients of a research career.Take advantage of all opportunities you can to practice! University of Virginia CS 655

  11. Programming • Everything we have seen so far looks identical to my Grandma: • Geeky engineer sits at a keyboard • Types a bunch of cryptic instructions giving step-by-step way of solving a problem University of Virginia CS 655

  12. Declarative Programming • Prolog (Programmation en Logique) [Colmerauer and Roussel, 1972] • Designed for natural language processing • Used in AI community • Program is a database of facts and inference rules, executes by proving or disproving conjectures • Separates logic from control: • Logic – requirements of a satisfactory answer specified by programmer • Control – how to get it (mostly hidden in interpreted) University of Virginia CS 655

  13. PROLOG example: facts parentOf (chelsea, bill) parentOf (chelsea, hillary) parentOf (bill, roger) parentOf (bill, virginia) female (chelsea) female (hillary) female (virginia) male (bill) male (roger) occupationOf (chelsea, student) occupationOf (roger, used_car_salesman) These may look like function calls, but they are just axioms. University of Virginia CS 655

  14. Interactive Session ?- parentOf (chelsea, bill) Yes ?- parentOf (chelsea, roger) No ?- parentOf (chelsea, X) X = bill; X = hillary; University of Virginia CS 655

  15. Defining Rules • We can define a predicate in terms of other predicates: motherOf (X, M) :- parentOf (X, M), female (M) • Read: “M is the motherOf X if M is the parentOf X and M is female.” ?- motherOf (chelsea, Z) Z = hillary; University of Virginia CS 655

  16. Combining Predicates grandMotherOf (X, G) :- parentOf (X, M), motherOf (M, G) ancestorOf (X, A) :- parentOf (X, A) ancestorOf (X, A) :- parentOf (X, P), ancestorOf (P, A) University of Virginia CS 655

  17. Evaluation • Uses unification algorithm like in type inference: guess all possibilities exhaustively ?- ancestorOf (chelsea, X) X = bill; X = hillary; X = roger; X = virginia; PROLOG specifies rules tried in order. University of Virginia CS 655

  18. PROLOG Factorial factorial (0,1) factorial (N,F) :- N > 0, factorial (D, R), D is N - 1, F is N * R. ?- factorial (5, F) F = 120; ?- factorial (N, 27) no University of Virginia CS 655

  19. Programming by Example • Sometimes called “Programming by Demonstration” • Programmer demonstrates task, system records • Widely used instance: • Word/Excel/PowerPoint Macros University of Virginia CS 655

  20. Stagecast Creator • Started as KidSim Project, Apple • Before-After Rules: • Guard: predicate to match before invoking rule • Action: sequence of primitive operations Demo at end of class (time permitting) University of Virginia CS 655

  21. ToonTalk • Provide a video-game metaphor syntax to a regular programming language • Variables = Boxes • Passing Parameters = Birds University of Virginia CS 655

  22. ToonTalk Metaphors • Comparison = Scale • Robots act like guarded commands • Thought bubble is predicate • Sequence of actions after matching Demo at end of class (time permitting) University of Virginia CS 655

  23. Visual Programming A favorite subject for PhD dissertations in software engineering is graphical, or visual, programming - the application of computer graphics to software design.... Nothing even convincing, much less exciting, has yet emerged from such efforts. I am persuaded that nothing will. Fred Brooks, 1987 University of Virginia CS 655

  24. Amorphous Computing Cement 10 GFlop University of Virginia CS 655

  25. Premise • Will soon be cheap to make lots of computational stuff so long as: • It doesn’t all have to work correctly • Arrangements and interconnects are mushy • Examples: • Construct logic circuits using biological cells • Nanotechnology • How to you program it? • Get acceptable answers with high probability • Look to biology for inspiration and metaphors • Human genome: 3 Billion base pairs = 750 MB University of Virginia CS 655

  26. Model • Computing elements sprinkled on a surface or in a volume • Each can talk to a few nearby neighbors, but not reliably • Each has modest computing power and a modest amount of memory • The particles are not synchonized, nor are they regularly arranged. University of Virginia CS 655

  27. Slide adapted from Abelson/Knight/Sussman talk Why is this interesting? • Physically feasible at any scale • Forces robustness of design • Potentially extremely inexpensive • Provides the possibility of bulk computation • smart paints • smart gels • concrete by the Megaflops University of Virginia CS 655

  28. Slide adapted from Abelson/Knight/Sussman talk Amorphous Computing Medium An amorphous medium has independent computational particles, all identically programmed. Each particle is represented by a spot in the picture, and different states are shown by different colors. University of Virginia CS 655

  29. Biological Programming • Growing-Point Language [Coore99] • Two primitive datatypes: • Materials – colored stuff that can be left in amorphous medium • Pheromones – chemicals that attract or repel other growing points, spread out diffusely when secreted • Growing points may split, die, merge University of Virginia CS 655

  30. Growing Point Program (define-growing-point (A-to-B-segment) (material A-material) (tropism (ortho+ B-pheromone)) (actions (when ((sensing? B-material) (terminate)) (default (propagate))))) What is deposited as it grows Grows towards increasing quantities of B-pheromone. Stop when touching B-material. University of Virginia CS 655

  31. Growing Point Program (define-growing-point (B-point) (material B-material) (for-each-step (secrete 10 B-pheromone))) What is deposited as it grows No tropism – it is stationary. Distribute B-pheromone to neighbors, radiates approximately symmetrically, decreasing over 10 units. University of Virginia CS 655

  32. Slide adapted from Abelson/Knight/Sussman talk Start with Vdd, Vss, and a Poly Contact University of Virginia CS 655

  33. Slide adapted from Abelson/Knight/Sussman talk The poly contact sprouts a growing point that bifurcates and then grows toward the pheromones secreted by Vdd and Vss. University of Virginia CS 655

  34. Slide adapted from Abelson/Knight/Sussman talk When the growing poly gets close to Vdd and Vss it is stopped by a short-range inhibition University of Virginia CS 655

  35. Slide adapted from Abelson/Knight/Sussman talk The poly growing points die off, but first they sprout P and N transistor diffusion growing points, which grow toward Vdd and Vss, where they drop contacts. University of Virginia CS 655

  36. Slide adapted from Abelson/Knight/Sussman talk The diffusions also grow toward each other. When they hit they form a new poly contact and poly growing point. University of Virginia CS 655

  37. Slide adapted from Abelson/Knight/Sussman talk The process then repeats, growing the next inverter. University of Virginia CS 655

  38. Slide adapted from Abelson/Knight/Sussman talk This process repeats to make an arbitrarily long chain of ugly, but topologically correct inverters. This demonstrates totally local control of precision topology. University of Virginia CS 655

  39. Slide adapted from Abelson/Knight/Sussman talk (define-growing-point ((poly from-input-contact) Q-id) (material poly) (tropism constant Vdd-long Vss-long) (initialize lifetime 5) (secrete (poly-short inhibitor) Q-id) (when (= lifetime 0) (start-growing-point (poly up) Q-id) (start-growing-point (poly down) Q-id) (terminate))) University of Virginia CS 655

  40. Amorphous Computing Summary • If you have enough randomly-distributed amorphous stuff, can use GPL to produce any topology • We can build arbitrary logic out of biological stuff (DNA, RNA) • Once you can make an inverter, can program anything University of Virginia CS 655

  41. Which of PROLOG, ToonTalk, Creator, GPLs are Programming Languages? University of Virginia CS 655

  42. What is a language? (Lecture 1) • Nerdy Linguist’s Definition of Language: • A description of pairs (S, M), where S stands for sound, or any kind of surface forms, and M stands for meaning. A theory of language must specify the properties of S and M, and how they are related. • Liberal Definition of Programming Language: • A language (according to the nerdy linguist’s definition) intended to be read and written by humans and processed by machines. University of Virginia CS 655

  43. From Lecture 2: • Bruce MacLellan’s definition: A language that is intended for the expression of computer programs and that is capable of expressing any computer program. • Ravi Sethi’s definition: Notations used for specifying, organizing, and reasoning about computations. University of Virginia CS 655

  44. Charge • Tomorrow, 11:59pm – Project Reports due • Monday night: Rotunda Presentations • Next time: Jeopardy (in your project teams) University of Virginia CS 655

More Related