const4aints as a desig7 pa9er7
play

Const4aints as a Desig7 Pa9er7 Hesam Samimi Alessandro - PowerPoint PPT Presentation

Const4aints as a Desig7 Pa9er7 Hesam Samimi Alessandro War0h Mahdi Eslamimehr Alan Bor7ing Lab Labs MODULE bakeCarrotCake MAIN var timer, pan, bowl, grease, flour; oven.start(); WHILE (oven.heat < 350) END WHILE;


  1. Const4aints as a Desig7 Pa9er7 Hesam Samimi Alessandro War0h Mahdi Eslamimehr Alan Bor7ing Lab Labs

  2. MODULE bakeCarrotCake MAIN var timer, pan, bowl, grease, flour; oven.start(); WHILE (oven.heat < 350) END WHILE; add(&pan, &grease); add(&pan, &flour); add(&bowl, &egg1); add(&bowl, &vanilla); add(&bowl, &carrots); timer.start(); place(&bowl, &oven); WHILE (timer.time() < 50) if (toothPickInCenterOfCake() && itComesOutClean()) { break; /* HACK FIXME */ } END WHILE; timer.reset(); WHILE (timer.time() < 10) END WHILE; remove(&bowl, &over); END

  3. CARROT CAKE Serves: 18 Calories: 575 1. Preheat oven to 350 degrees F (175 degrees C). Grease and flour ✔ a 9x13 inch pan. 2. In a large bowl, beat together eggs, oil, white sugar and 2 ✔ teaspoons vanilla. Mix in flour, baking soda, baking powder, salt and cinnamon. Stir in carrots. Fold in pecans. Pour into prepared pan. 3. Bake in the preheated oven for 40 to 50 minutes, or until a ✔ toothpick inserted into the center of the cake comes out clean. Let cool in pan for 10 minutes, then turn out onto a wire rack and cool completely.

  4. CARROT CAKE Serves: 18 Calories: 575 1. Preheat oven to 350 degrees F (175 degrees C). Grease and flour ✔ a 9x13 inch pan. 2. In a large bowl, beat together eggs, oil, white sugar and 2 ✔ teaspoons vanilla. Mix in flour, baking soda, baking powder, salt and cinnamon. Stir in carrots. Fold in pecans. Pour into prepared pan. 3. Bake in the preheated oven for 40 to 50 minutes, or until a ✔ toothpick inserted into the center of the cake comes out clean. Let cool in pan for 10 minutes, then turn out onto a wire rack and cool completely.

  5. CARROT CAKE Serves: 18 Calories: 575 1. Preheat oven to 350 degrees F (175 degrees C). Grease and flour 1K-1M LoC a 9x13 inch pan. 2. In a large bowl, beat together eggs, oil, white sugar and 2 teaspoons vanilla. Mix in flour, baking soda, baking powder, salt and cinnamon. Stir in carrots. Fold in pecans. Pour into prepared pan. 3. Bake in the preheated oven for 40 to 50 minutes, or until a toothpick inserted into the center of the cake comes out clean. Let ⊙ � ⊙ cool in pan for 10 minutes, then turn out onto a wire rack and cool meaning ?? ☹ completely.

  6. CARROT CAKE what Serves: 18 Calories: 575 how 1. Preheat oven to 350 degrees F (175 degrees C). Grease and flour ✔ a 9x13 inch pan. 2. In a large bowl, beat together eggs, oil, white sugar and 2 ✔ teaspoons vanilla. Mix in flour, baking soda, baking powder, salt and cinnamon. Stir in carrots. Fold in pecans. Pour into prepared pan. 3. Bake in the preheated oven for 40 to 50 minutes, or until a ✔ toothpick inserted into the center of the cake comes out clean. Let cool in pan for 10 minutes, then turn out onto a wire rack and cool completely.

  7. CARROT CAKE what ✗ Serves: 18 20 ✗ Calories: 575 350 1. 2. 3.

  8. CARROT CAKE what ✗ Serves: 18 20 ✗ Calories: 575 350 how 1. ??? 2. ⊙ � ⊙ 3.

  9. CARROT CAKE what Serves: 18 Calories: 575 ✗ how constraint constraint solver solver a solution

  10. CARROT CAKE what ✗ Serves: 18 20 ✗ Calories: 575 350 ✗ how constraint constraint solver solver a solution

  11. constraint constraint solver solver ☹

  12. constraint constraint solver solver ☹ ☹ perforGance exJressivitL

  13. MODULE bakeCarrotCake fallback to… MAIN var timer, pan, bowl, grease, flour; oven.start(); WHILE (oven.heat < 350) END WHILE; add(&pan, &grease); add(&pan, &flour); add(&bowl, &egg1); add(&bowl, &vanilla); add(&bowl, &carrots); timer.start(); place(&bowl, &oven); WHILE (timer.time() < 50) if (toothPickInCenterOfCake() && itComesOutClean()) { break; /* HACK FIXME */ } END WHILE; ugly... timer.reset(); WHILE (timer.time() < 10) END WHILE; works, fast! remove(&bowl, &over); END

  14. backg4ound

  15. backg4ound First purely declarative prog4amming system?

  16. Ivan Sutherland’s Sketchpad - 1961

  17. inspiration Ivan Sutherland’s Sketchpad - 1961 method

  18. solution

  19. prog4am

  20. prog4am constraints

  21. prog4am constraints UI to interact w/ const4aints

  22. prog4am constraints API in IMP specific solvers to define coded in const4aints imperative langZage & how to solve

  23. prog4am ü modularitL constraints constraints ü understandabilitL ü ex0ensibilitL imperative imperative ü emergent behavior code code ü flexbilitL ü efficiency ü practicalitL code SMT SAT numeric … {

  24. prog4am constraints constraints imperative imperative code code

  25. prog4am 1. class definitions data • constraint • 2. data 3. continuous behaviors constraints • 4. discrete behaviors (events) trigger • handler • add/remove • data/constraint •

  26. API to interact prog4am constraints w/ const4aints

  27. 2. data

  28. 3. const4aints

  29. 4. events

  30. UI to interact prog4am constraints w/ const4aints

  31. prog4am constraints API in IMP specific solvers to define coded in const4aints imperative langZage & how to solve

  32. l p1 p2 Defining a Const4aint

  33. Solving constraint in isolation

  34. l p1 p2 Solving a Const4aint

  35. Solving constraint in isolation

  36. Merging Solutions

  37. Solving constraint in isolation hardcoded iterative (relaxation)

  38. Solving

  39. Demo: Benefits

  40. Related Work Mixed Prog4amming Const4aint as a Desig7 e.g. Const4aint Imperative Pa9er7 (CDP) Prog4amming (CIP) ‘90 const4aints const4aints always vs. x + y = code 100 code y := 40; prog4am prog4am

  41. Thank you! h9J://www.cdglabs.org/sketchpad14

  42. 4. events

  43. 4. events

  44. Execution…

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend