Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu Evaluation strategy?

Dikenal juga sebagai: normal-order reduction · call by name · call by value · lazy evaluation

Definition 5.5 University Computer Science — Year 3 · Bab 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.
Baca dalam konteks →