Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Evaluation strategy?

Ook bekend als: normal-order reduction · call by name · call by value · lazy evaluation

Definition 5.5 University Computer Science — Year 3 · Hoofdstuk 5 — The Lambda Calculus and Operational Semantics

An evaluation strategy chooses which redex to reduce next. Normal-order reduction reduces the leftmost outermost redex, also under a λ\lambda. Call by name does the same but never reduces under a λ\lambda or inside an argument. Call by value reduces a redex (λx. M) N(\lambda x.\,M)\,N only once NN is a value (here, an abstraction), and never under a λ\lambda. Lazy evaluation (call by need) is call by name in which an argument, once evaluated, is shared by all the places that use it.

All the reducts of one term, an arrow per -step (reduction_graph_of_the_figure enumerates them: six terms, seven arrows). Normal order copies the unreduced argument and reduces it twice; call by value reduces it once, before the copy.
All the reducts of one term, an arrow per β\beta-step (reduction_graph_of_the_figure enumerates them: six terms, seven arrows). Normal order copies the unreduced argument and reduces it twice; call by value reduces it once, before the copy.
Lees in het hoofdstuk →