def AND(x1,x2): w1,w2,theta = 0.5,0.5,0.7 tmp = w1*x1+w2*x2 if tmp <= theta: return 0 else: return 1
(defn ADD [x1 x2] (let [w1 0.5 w2 0.5 theta 0.7 tmp (+ (* x1 w1) (* x2 w2))] (if (<= tmp theta) 0 1)))
def AND(x1,x2): w1,w2,theta = 0.5,0.5,0.7 tmp = w1*x1+w2*x2 if tmp <= theta: return 0 else: return 1
(defn ADD [x1 x2] (let [w1 0.5 w2 0.5 theta 0.7 tmp (+ (* x1 w1) (* x2 w2))] (if (<= tmp theta) 0 1)))