Computes the weight of a Boolean function from its algebraic normal form.
Implementation based on the paper:
Ç. Çalık, A. Doğanaksoy, Computing the Weight of a Boolean Function from Its Algebraic Normal Form, Sequences and Their Applications -- SETA 2012, pp 89–100. Springer, Berlin Heidelberg (2012)