Files
boolean-tools/tests/test_nonlinearity.py
2026-05-18 15:23:22 +02:00

14 lines
287 B
Python

from walsh.walsh import nonlinearity
def test_nonlinearity_linear_function():
assert nonlinearity("x1 XOR x2") == 0
def test_nonlinearity_or():
assert nonlinearity("x1 OR x2") == 1
def test_nonlinearity_majority():
assert nonlinearity("x1*x2 XOR x1*x3 XOR x2*x3") == 2