1 / 20

The Return of Chef (TROC) A Programming Language for Cooking Recipes and Nutrition Analysis

The Return of Chef (TROC) A Programming Language for Cooking Recipes and Nutrition Analysis. TROC Project Team. Jia Chen – Language Architect Jeff Hull – Tester and Validator Kuang Shen – System Integrator Yiping Xu – Tools Guru. The Purpose of TROC. Healthy Diet  Lifestyle

liana
Download Presentation

The Return of Chef (TROC) A Programming Language for Cooking Recipes and Nutrition Analysis

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. The Return of Chef (TROC) A Programming Language for Cooking Recipes and Nutrition Analysis

  2. TROC Project Team • Jia Chen – Language Architect • Jeff Hull – Tester and Validator • Kuang Shen – System Integrator • Yiping Xu – Tools Guru

  3. The Purpose of TROC • Healthy Diet  Lifestyle various diet services found on/offline which theory do I follow?? how to know the healthiness of my own diet hard for amateur to calculate the nutrition facts

  4. The Purpose of TROC • Then comes TROC! { 1create your own recipes for daily diet; 2 have nutrition facts auto-calculated; 3 adjust recipe to “healthize” diet; 4 recalculate, if still unsatisfied GOTO line 3; 5 cook; 6 inject food; }

  5. Design Principles • Syntax: - Close to recipe convention |- Less ambiguous |- Smooth learning curve 20-Minute Beef Stew 3 pounds boneless beef, cut into cubes 1/3 cup flour 1 ½ cups wine 3 tablespoons oliveoil 1 onion, chopped 2 carrots, cut into pieces 1 pound potatoes, cut into pieces Salt and ground pepper Coat beef with flour, salt and pepper; Warm oliveoil with pressure cooker for 3 minutes; Add wine,beef,onion,potato and carrot into the cooker; Cook on “high” for 20 minutes; Serve. Dish 20_Minute_BeefStew { beefToBeStewed: 3 lb BonelessBeef; flour: 1/3 cup Flour; salt: 2 g Salt; pepper: 1 g GroundPepper; oliveOil: 3 teaspoon OliveOil wine: 1.5 cup RedWine; onion: 1 unit Onion; carrot: 2 unit Carrot; potato: 0.5 lb Potato; cut beefToBeStewed into cubes; chop onion; cut [carrot,potato] into pieces; coat beefToBeStewed with [salt, pepper, flour]; cook oliveOil with PressureCooker for 3 minute; cook [beefToBeStewed, onionToBeChopped, garlic, carrot, potato, wine, oliveOil] with PressureCooker mode HIGH for 20 minute; }

  6. Design Principles • Semantics:- Strongly Typed e.g. Rule: Cook Ingredient with Cookware Cook Beef with PressureCooker Cook Beef with MixingBowl - Static Typing - Object inheritance - Integrated Metric System e.g. olvOil: 3 teaspoon OliveOil; equivalent to 0.5 oz OliveOil Translation done at compile time

  7. Runtime • Runtime Routine Calls -Program written in TROC is translated into java code which call functions in TROC run-time API • Nutrition Facts Calculation -Embedded in the TROC API functions, based on the ingredients, tools and operations involved - Formula based on the online authentic nutrient database created and maintained by Nutrition.gov

  8. Execution Output • Using external library to output result from Microsoft Excel

  9. JLex: Lexer Input_file.troc CUP: Parser Type Checking Symbol Table Troc API (written in JAVA) Exception Handling Semantic Analyzer Intermediate Code Generator Java Compiler JVM Output

  10. Runtime Environment

  11. Runtime Environment • Troc Type Definition • Cook Operation API

  12. Seafood Fruit Vegetable Condiment Meat Beef Chicken Pork Troc Type Hierarchy Ingredient CookWare …… ……

  13. Inheritance If there is something that is not one of the food type we already have, Inheritance! Grammar: Mushroom is a kind of Vegetable with white color, 10 Juiciness…... M1 : 20 g Mushroom;

  14. Cook Operation API • Cut (IngredientType beingCutObject, ToolType toolID, int Weight,) • Cook(IngredientType beingCookedObject, ContainerTyper , int Weight) Other cook operations that we support: Place, Crush, Marinate, Coat,…

  15. Runtime API Functionality • Calculate the nutrition • Based on the formula • Render the chart

  16. Runtime Output

  17. Test Plan • Smoke Test • Begin by testing the high level features • Unit Testing • Create test cases for every function in API • black-box approach • compare the actual results with expected results • Regression Testing • Maintained a test file, where for every new grammar construct added, we will run the test file to maintain program consistency • Tested for: • Logical errors/inconsistencies • Syntax inconsistencies • Overall success of instructions

  18. Conclusions • What We Learned • Aside from some healthy recipes… • Gained Valuable Group work experience • How to cope when a team member quits • The ins and outs of designing a Language • How to limit the scope and complexity of your project

  19. Why Use our Language? • The benefits of healthy eating are too numerous to name. Our language can help you cook and eat healthier.

  20. Questions?

More Related