1 / 27

CSE-321 Programming Languages Evaluation Contexts

CSE-321 Programming Languages Evaluation Contexts. 박성우. POSTECH April 16, 2007. Simply Typed  -Calculus. 18 Reduction Rules. Simpler?. Outline. Evaluation contexts Abstract machine C. Reduction Rules. Derivation Trees. Reducing an Expression e.

zoe
Download Presentation

CSE-321 Programming Languages Evaluation Contexts

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. CSE-321 Programming LanguagesEvaluation Contexts 박성우 POSTECH April 16, 2007

  2. Simply Typed -Calculus

  3. 18 Reduction Rules

  4. Simpler?

  5. Outline • Evaluation contexts • Abstract machine C

  6. Reduction Rules

  7. Derivation Trees

  8. Reducing an Expression e • Locate an appropriate subexpression (redex) of e • Apply a corresponding reduction rule

  9. Locate and Apply

  10. Decompose and Apply = +

  11. Decompose and Apply Expression = Redex + Context remaining intact

  12. Evaluation Contexts (CBV) • An expression with a hole ¤ in it • The hole ¤ indicates the position of a subexpression to be reduced in the next step,i.e., the redex for the next step. • Example:

  13. Reduction Strategy • Determined by the definition of evaluation contexts call-by-value call-by-name

  14. Reduction Rule

  15. Example

  16. Still Cryptic?

  17. Outline • Evaluation contexts V • Abstract machine C

  18. This Rule is a Sagi.

  19. Example • Implicit analysis • Explicit analysis

  20. Abstract Machine C • Explicit decomposition of a given expression • Uses a stack of frames instead of evaluation contexts. • Each frame corresponds to a specific step in the decomposition.

  21. Example

  22. State of the Machine

  23. Example

  24. Outline • Evaluation contexts V • Abstract machine C V • Something important!

  25. Midterm • Three hours, closed book • 20% toward your final grade • Next Wednesday, 8pm - 11pm, in the classroom April 2007 Su Mo Tu We Th Fr Sa 16 17 18 19 20 21 22 23 24 25 26 27 28

More Related