灯下 登录
计算机科学 / SICP / 4.3.2 Examples of Nondeterministic Programs

Exercise 4.46 · 习题

Exercise 4.46: The evaluators in

4.1 and 4.2 do not determine what order operands are evaluated in.

We will see that the amb evaluator evaluates them from left to right.

Explain why our parsing program wouldn’t work if the operands were evaluated in

some other order.

练习 4.46:4.1 节和 4.2 节中的求值器并不确定运算对象的求值顺序。我们将看到,amb 求值器是从左到右依次对它们求值的。请解释为什么若运算对象以其他顺序求值,我们的语法分析程序将无法正常工作。