| OCR Text |
Show Driving Process Answer-collector ?- curve_in_range(-10, 10, 1, [2,5], L) I I sub1 = {L = Y_values} I created and waits for the I binding of Y_values I v ?- range(-10, 10, 1, curve(-10, 1, [2,5]), Y_values) I I sub2 = I I v {A = poly( -10, [ 2, 5]) I demands reduction of L1 = curve(-9, 1, [2,5]) poly( -10 , [2,5]) Y_values = A"L2} and waits for the binding of L2 I ?- range(-9, 1 0 , 1 , curve ( - 9 , 1 , [ 2 , 5 ] ) , L 2 ) I I sub3 = {A' = poly( -9, [ 2, 5]) I demands reduction of I L 11 = curve ( -8, 1 , [ 2, 5]) poly ( -9, [ 2, 5]) I L2 = A 1 "L2 1 } and waits for the V binding of L2 1 I ?- range ( -8, 10, 1 , curve ( -8, 1 , [ 2, 5 ] ) , L2 1 ) Figure 19: A sample execution of Example 13 121 Finally, we will have L bound to a list of twenty-one integers. Note that it was the second process that actually demanded· complete reductions for un-expanded function calls of poly. 0 A mini-interpreter for Funlog has been implemented in Dec-20 Prolog (see Appendix). All the major examples presented in this chapter have been tested using the interpreter. 6.2.5 The Composition of Funlog Programs In general, the composition of Funlog program is largely dependent on the user's intuitions about the problem to be solved and his or her preference of the way he or she wants to solve it. Typically, it is appropriate to write tunc-tion definitions for those program segments that are best thought of as one way computations that involve no backtracking, and Prolog clauses for the remaining program segments. Funlog then provides a natural environment for such an interweaving of logic and functions. In addition, it also provides the |