Minimization of ring-sum expansion of Boolean functions