Given a list (array) of $n$ variables, what's the algorithm that creates a CNF Formula that will make the SAT solver return assignments in which exactly one variable is true?
I know I'm not 100% with the terms here, but I just got this assignment, having SAT explained to me today.
To make things clear I'll translate the text of the exerise:
Code a function that, given a list of variable names, returns a CNF formula for which its "list of satisfactory assignments" matches all the instances for which only one variable gets the value TRUE.
The function signature is as follows
public static int[][] exactlyOne(int[] varNames) {}
n=3anda,b,care my variables.(a or !b or !c) and (!a or b or !c) and (!a or !b or c). Is that what you mean? if yes,a,b,c=truewill be a satisfactory assignment... – McLovin Nov 17 '17 at 01:22(a or b or !c) and (a or !b or c) and (!a or b or c)? – McLovin Nov 17 '17 at 01:26