SICP Exercise 3.33 constraint propagation averager

Exercise 3.33.  Using primitive multiplier, adder, and constant constraints, define a procedure averager that takes three connectors ab, and c as inputs and establishes the constraint that the value of c is the average of the values of a and b.

SOLUTION

The code is here.

The picture below shows how the constraints and connectors are assembled:


Comments

Popular posts from this blog

SICP Exercise 2.56 differentiation rule

SICP Exercise 1.28 (Miller-Rabin Test)

SICP Exercise 4.18 a alternative strategy for interpreting internal definitions