#!/bin/python3 from ternary_ops import * def print_op(op): op = op.matrix syms = ["i", "0", "1"] print(" | i 0 1") print("---+-------") for line, sym in zip(op, syms): disp_line = " " + sym + " |" for val in line: disp_line += " " + syms[val+1] print(disp_line) print() i = j = 0 count = 0 for op in gen_op(): i += 1 if (op.is_commutative() and not op.is_degenerate()): j += 1 if(is_complete({op})): count += 1 print(count, " / ", j, " / ", i) print_op(op)