Linearization of logical functions defined by a set of orthogonal terms. I. Theoretical aspects