rules.pr
1.08 KB
Addition(Addition(a*),b*)->Addition(a*,b*);
Addition(Integer.a,Integer.b)->$AddIntegers(a,b);
Addition(Integer.a,Integer.b,c*)->Addition($AddIntegers(a,b),c*);
Subtraction(a,b)->Addition(a,Multiplication(b,Integer[-1]));
Addition(a, Multiplication(a,Integer[-1]))->Integer[0];
Addition(a, Multiplication(a,Integer[-1]), b)->b;
Addition(a, Multiplication(a,Integer[-1]), b, c*)->Addition(b,c*);
Addition(a,a,b*)->Addition(Multiplication(a,Integer[2]),b*);
Addition(a,Multiplication(a,b),c*)->Addition(Multiplication(a,Addition(b,Integer[1])),c*);
Addition(Multiplication(a,b),Multiplication(a,c),d*)->Addition(Multiplication(a,Addition(b,c)),d*);
Addition(a,a)->Multiplication(a,Integer[2]);
Addition(a,Multiplication(a,b))->Multiplication(a,Addition(b,Integer[1]));
Addition(Multiplication(a,b),Multiplication(a,c))->Multiplication(a,Addition(b,c));
Multiplication(Multiplication(a*),b*)->Multiplication(a*,b*);
Multiplication(Integer[0],a*)->Integer[0];
Multiplication(Integer.a,Integer.b)->$MultiplyIntegers(a,b);
Multiplication(Integer.a,Integer.b,c*)->Multiplication($MultiplyIntegers(a,b),c*);