;e是变量吗(define(variable?x)(symbol?x));symbol?判断变量是不是符号;v1和v2是同一个变量吗(define(same-variable?v1v2)(and(variable?v1)(variable?v2)(eq?v1v2)));e是和式吗(define(sum?x)(and(pair?x)(eq?(carx)'+)));e的被加数(define(addends)(cadrs));e的加数(define(augends)(caddrs));构造起a1和a2的和式(define(make-suma1a2)(list'+a1a2));e是乘式吗(define(product?x)(and(pair?x)(eq?(carx)'*)));e的被乘数(define(multiplierp)(cadrp));e的乘数(define(multiplicandp)(caddrp));构造起来m1与m2的乘式(define(make-productm1m2)(list'*m1m2));求导(define(derivexpvar)(cond((number?exp)0)((variable?exp)(if(same-variable?expvar)10))((sum?exp)(make-sum(deriv(addendexp)var)(deriv(augendexp)var)))((product?exp)(make-sum(make-product(multiplierexp)(deriv(multiplicandexp)var))(make-product(deriv(multiplierexp)var)(multiplicandexp))))(else(error"unknown expression type -- DERIV"exp))))(deriv'(+x3)'x)(deriv'(*xy)'x)(deriv'(*(*xy)(+x3))'x)'(+10)'(+(*x0)(*1y))'(+(*(*xy)(+10))(*(+(*x0)(*1y))(+x3)))
(define(decodebitstree)(define(decode-1bitscurrent-branch)(if(null?bits)'()(let((next-branch(choose-branch(carbits)current-branch)))(if(leaf?next-branch)(cons(symbol-leafnext-branch)(decode-1(cdrbits)tree))(decode-1(cdrbits)next-branch)))))(decode-1bitstree))(define(choose-branchbitbranch)(cond((=bit0)(left-branchbranch))((=bit1)(right-branchbranch))(else(error"bad bit -- CHOOSE-BRANCH"bit))))