# Is ANF-SAT P or NP?

Given a finite set of equations in ANF, for example: $$\begin{cases} (x_1 \land x_2) \oplus (x_1 \land x_3 \land x_4) \oplus 1 = 0 \\ x_3 \oplus (x_2 \land x_3 \land x_4) = 0 \\ (x_1 \land x_4) \oplus (x_1 \land x_2) \oplus (x_3 \land x_4) = 0 \end{cases}$$

Is this P or NP?

The only assumption is that number of variables is finite.

I know it can be converted to CNF and become NP-Complete, but I can't find an algorithm for converting a general ANF to CNF which is P (so this does not imply it is NP-Complete)

This is also different from XOR-SAT as it is not linear and so Gaussian elimination is not an option.

The answer might be using Schaefer's dichotomy theorem, but I'm not sure if it applies or not.

This is similar to this question but the OP was not clear about question and there is also no clear answer, so I'm asking a clear one here.

If you are asking about the problem where the input is a system of equations in ANF (algebraic normal form) and the output is whether the system of equations is satisfiable, this problem is NP-complete.

There is a reduction from 3SAT. Suppose we have a 3CNF formula $$\varphi = C_1 \land \cdots \land C_m$$, where $$C_i$$ is the $$i$$th clause in $$\varphi$$, with variables $$x_1,\dots,x_n$$. We'll create a system of ANF equations that are satisfiable iff $$\varphi$$ is satisfiable, as follows.

First, let's take care of any negations in $$\varphi$$. For each variable $$x_i$$, introduce another variable $$y_i$$, along with the ANF equation

$$1 \oplus x_i \oplus y_i = 0.$$

Then, we can replace each negated literal $$\neg x_j$$ in $$\varphi$$ with $$y_j$$. In this way we obtain a 3CNF formula with only non-negated literals.

Next, we will introduce one ANF equation per clause, as follows. Introduce variables $$z_1,\dots,z_m$$. Suppose clause $$C_i$$ has the form $$a \lor b \lor c$$ (after removing negations). Then we will generate the ANF equation

$$z_i + abc + ab + bc + ac + a + b + c = 0.$$

Notice that this forces $$z_i$$ to be true iff clause $$C_i$$ is satisfied.

$$1 + z_1 z_2 \cdots z_m = 0.$$
This forces all of the $$z_i$$ to be true, i.e., all of the clauses $$C_i$$ to be satisfied.
Now the system of all ANF equations generated in this way is satisfiable, iff $$\varphi$$ is satisfiable.