Variations on a Scheme: Nondeterministic Computing - SICP Comparison Edition" /> 4.3   <span style="color:green">Variations on a Scheme:</span> Nondeterministic Computing - SICP Comparison Edition

[1] We assume that we have previously defined a procedure function prime? is_prime that tests whether numbers are prime. Even with prime? is_prime defined, the prime-sum-pair prime_sum_pair procedure function may look suspiciously like the unhelpful pseudo-Lisp pseudo-JavaScript attempt to define the square-root function, which we described at the beginning of section 1.1.7. In fact, a square-root procedure function along those lines can actually be formulated as a nondeterministic program. By incorporating a search mechanism into the evaluator, we are eroding the distinction between purely declarative descriptions and imperative specifications of how to compute answers. We'll go even farther in this direction in section 4.4.
4.3   Variations on a Scheme: Nondeterministic Computing