Arbitrary Oracle Function
Code
Truth Table
SAT Instance
function oracle(A, B, C, D, E) { const n = [A, B, C, D].reduce((index, bit) => index * 2 + (bit ? 1 : 0), 0); // Pack boolean inputs into an integer if ([1, 4, 6, 9, 10, 11, 12, 15].includes(n)) return true; if ([9, 14].includes(n)) return undefined; // Don't cares return false; // Another example const t1 = (((D & 1) | ((B ^ 1) & D)) ^ 1); const t2 = (A & (B | (B ^ 1))); const t3 = (A & (C ^ 1)); const t4 = (A & C); const t5 = ((D ^ 1) & B & (B ^ 1)); const t6 = (D & 0); const t7 = (((B & 0) | ((B ^ 1) & 0)) & D); const value = t1 | t2 | t3 | t4 | t5 | t6 | t7; return !!value; }
Error
Variables:
–
0
1
Random
Restore
c DIMACS CNF format p cnf 5 6 1 2 3 4 5 0 -1 -2 -3 -4 -5 0 1 -2 0 3 -4 5 0 5 0 -1 2 0
Run
→
Copy
←
Minimal Logic (Quine-McCluskey)
Circuit
K-Map
Code
Truth Table
SAT Instance
Run automatically
Maintain the same variable list
Form: DNF