Simulation of an Averager as a Constraint System
Simulation of an Averager as a Constraint System
Celsius Fahrenheit Converter as a Constraint System:
Half adder simulation and probing of delays:
Or Gate as a combination of inverter and and gates.
The code below memoizes a function.
As an example, fibonacci is memoized.
Implementation of Church numerals, of calculus and the addition procedure.
A procedure smooth that takes as input a procedure that computes f and returns a procedure that computes the smoothed f.
Also implemented is a procedure that computes the n-fold smoothed function.
An infinite continued fraction is an expression of the form
Suppose that n and d are procedures of one argument (the term index i) that return the Ni and Di of the terms of the continued fraction.
Define a procedure cont-frac such that evaluating (cont-frac n d k) computes the value of the k-term finite continued fraction. Check your procedure by approximating 1/ using
(cont-frac (lambda (i) 1.0)
(lambda (i) 1.0)
k)
for successive values of k.