Com vec.py e mat.py implementados: $ python3 Python 3.6.15 (default, May 10 2022, 13:43:14) [GCC Apple LLVM 13.0.0 (clang-1300.0.29.30)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> from vec import Vec >>> from GF2 import one >>> D = {(x, y) for x in {0, 1} for y in {0, 1}} >>> j = Vec(D, {(x, y): one for (x, y) in D}) >>> b_00 = j - Vec(D, {(1, 1): one}) >>> b_01 = j - Vec(D, {(1, 0): one}) >>> b_10 = j - Vec(D, {(0, 1): one}) >>> b_11 = j - Vec(D, {(0, 0): one}) >>> import matutil as mu >>> A = mu.coldict2mat({0: b_00, 1: b_01, 2: b_10, 3: b_11}) >>> import vecutil as vu >>> b = Vec(D, {(0,0): one, (1,0): one}) >>> from solver import solve >>> x = solve(A, b) >>> A * x == b True >>> print(A) 0 1 2 3 ----------------- (0, 0) | one one one 0 (0, 1) | one one 0 one (1, 0) | one 0 one one (1, 1) | 0 one one one >>> print(b) (0, 0) (0, 1) (1, 0) (1, 1) ---------------------------- one 0 one 0 >>> print(x) 0 1 2 3 ------------ 0 one 0 one >>> quit() $