i am struggling for quite a while with this. trying to understand why the following function can be calculated in polynomial time(in regards to the input length)
defining a function from assignments of truth values to a set of booleans to 3CNF propositions:
the function gets an assignment of truth values to a set of n boolean variables $x_1,x_2,...,x_n$ (n ≥ 3) (meaning each boolean variables gets either 0 or 1).
the function returns a 3CNF proposition that upholds(maintains) the following:
1)each clause of the proposition contains exactly three literals
2)the proposition consists of only the variables $x_1,x_2,..,x_n$
3)the three literals in each clause are of different variables(there are no double literals in the clause, and none of the clauses consists of complimentary literals)
4)the proposition is satisfiable and the only assignment that satisfies the proposition is the assignment the function obtained as an input.
prove that the given function can be calculated in a polynomial time in regards to the input size
i don't understand how can it be computed in a polynomial time in regards to the input size. tried to look everywhere, this site, online, sipser's book and nothing. similar problems are usually from the NP family.
could someone please explain to me how this one can be polynomially computed? i just can't understand that
EDIT: this is how the final 3CNF should look in my opinion: $(l_1 \lor l_2 \lor x_1) \land (\lnot x_1 \lor l_3 \lor x_2) \land (\lnot x_2 \lor l4 \lor x_3)\land ... \land(\lnot x_{n-3} \lor l_{n-1} \lor l_n)$ (from $(l_1 \lor l_2\lor...\lor l_n)$).
but what i don't understand is why is it polynomial, could someone please explain to me why can it be computed polynomially in regards to input size?