                  (list '* (list 'exp (d 'e1) (list 'dec (d 'e2)))
                        (list 'd (d 'e1) (d 'v1)))))
    "diff-power-rule"])
-(def math-ladd-zero-rule ['(+ (? x) 0) #(% 'x) "math-ladd-zero-rule"])
-(def math-radd-zero-rule ['(+ 0 (? x)) #(% 'x) "math-radd-zero-rule"])
-(def math-lprod-zero-rule ['(* (? x) 0) (fn [d] 0) "math-lprod-zero-rule"])
-(def math-rprod-zero-rule ['(* 0 (? x)) (fn [d] 0) "math-rprod-zero-rule"])
-(def math-lprod-id-rule ['(* (? x) 1) #(% 'x) "math-lprod-id-rule"])
-(def math-rprod-id-rule ['(* 1 (? x)) #(% 'x) "math-rprod-id-rule"])
-(def math-exp-zero-rule ['(exp (? x) 0) (fn [d] 1) "math-exp-zero-rule"])
-(def math-exp-id-rule ['(exp (? x) 1) #(% 'x) "math-exp-id-rule"])
-(def math-dec-rule ['(dec (number-state? x)) #(dec (% 'x)) "math-dec-rule"])
+(def ladd-zero-rule ['(+ (? x) 0) #(% 'x) "ladd-zero-rule"])
+(def radd-zero-rule ['(+ 0 (? x)) #(% 'x) "radd-zero-rule"])
+(def add-const-rule ['(+ (number-state? x) (number-state? y)) #(+ (% 'x) (% 'y)) "add-const-rule"])
+(def lprod-zero-rule ['(* (? x) 0) (fn [d] 0) "lprod-zero-rule"])
+(def rprod-zero-rule ['(* 0 (? x)) (fn [d] 0) "rprod-zero-rule"])
+(def lprod-id-rule ['(* (? x) 1) #(% 'x) "lprod-id-rule"])
+(def rprod-id-rule ['(* 1 (? x)) #(% 'x) "rprod-id-rule"])
+(def prod-const-rule ['(* (number-state? x) (number-state? y)) #(* (% 'x) (% 'y)) "prod-const-rule"])
+(def exp-zero-rule ['(exp (? x) 0) (fn [d] 1) "exp-zero-rule"])
+(def exp-id-rule ['(exp (? x) 1) #(% 'x) "exp-id-rule"])
+(def dec-rule ['(dec (number-state? x)) #(dec (% 'x)) "dec-rule"])
 ; other rules go here ...
 
 ; TODO: Clojure HAS to have a class/record facility to do this...

  (is (= 1 (control '(dec 2) rules)))
  (is (= '(+ (* 2 x) 2) (control '(d (+ (exp x 2) (* 2 x)) x) rules)))
  (is (= 2 (control '(+ (* x 0) (* 2 1)) rules)))
  )


(def rules
  [[diff-sum-rule diff-x-rule diff-const-rule diff-product-rule diff-power-rule]
   [ladd-zero-rule radd-zero-rule add-const-rule lprod-zero-rule rprod-zero-rule lprod-id-rule rprod-id-rule prod-const-rule exp-zero-rule exp-id-rule dec-rule
    ]])
   
;;; control scheme ;;;
