function fillTernary(setList) {
setList(oddFn);
setList(evenFn);
for (let i = 0; i < 2 ** 3; i++) {
for (let fn of [andFn, orFn, countEq1, countNeq1, countLeq1]) {
setList(applyNegations(fn, i));
}
}
for (let i of [0, 0b001, 0b010, 0b100]) {
setList(applyNegations(eqFn, i));
setList(applyNegations(neqFn, i));
}
for (let order of [
[0, 1, 2],
[1, 2, 0],
[2, 0, 1]
]) {
for (let i = 0; i < 2 ** 3; i++) {
for (let fn of [orAnd, andOr, mux, eqImpl, neqImpl]) {
setList(applyNegations(permuteFn(fn, order), i));
}
}
for (let i = 0; i < 2 ** 2; i++) {
setList(permuteFn(applyNegations(andEq, i), order));
setList(permuteFn(applyNegations(orEq, i), order));
}
for (let i = 0; i < 2; i++) {
for (let fn of [eqAnd, xorAnd, eqOr, xorOr]) {
setList(permuteFn(applyNegations(fn, i << 2), order));
}
}
}
}