I'm not sure what you are exactly trying to do, but do you want to add another rule like defrule(finddiff, a1(dif(u, s1, i1) .... ) ... note that your rule matches only du literally, not u. or you could try a pattern variable, e.g. matchedeclare(uuuu, all) where uuuu would be du or u.