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 4.18 a alternative strategy for interpreting internal definitions

SICP Exercise 3.11 make-account internal definitions with local state

SICP Exercise 3.13 make-cycle