Hi Marabou team,
I encountered a case where Marabou returns a SAT witness that violates a linear equality constraint explicitly specified in the .ipq file. To demonstrate the issue, I’ve created a Google Colab script that uses maraboupy to load and solve the query (which represents a ReLU neural network), and then shows that one of the linear equality constraints is actually not satisfied by the returned witness.
The main steps in the colab are as follows:
-
Solving the Query with Marabou
The script first loads an .ipq file that captures the input-output behavior of a neural network.
Then, Marabou solves the query and returns a SAT witness where all input variables are set to 0 and values are assigned to all intermediate and output variables.
-
Manual Evaluation of a Constraint
We select one specific linear equality constraint from the .ipq file for which we know that the constraint is violated.
The constraint is specified in the colab and is of the form:
x_target = a₁ * x₁ + a₂ * x₂ + ... + aₙ * xₙ
We use Marabou’s values for the variables on the right-hand side to compute a value for x_target based on this equation in our own python code. Then we compare this computed value to the value Marabou assigned to x_target.
-
Discrepancy Detection
The manually computed value of x_target does not match the value assigned by Marabou in its solution. The difference is significant, showing that the constraint is violated and that the SAT witness is incorrect.
-
Sanity Check via ONNX Runtime
The variable x_target happens to correspond to the output node of the neural network. We independently evaluate the network using ONNX Runtime on the fixed input and obtain a value for the output node. This ONNX-derived value matches our manual computation, confirming that the Marabou-assigned value is incorrect.
I’ve encountered similar incorrect SAT witnesses in other cases as well and was not yet able to come up with a workaround for them.
That is why I'd highly appreciate any advice on this issue and I am happy to provide more details.
Best regards,
Mustafa
Link to relevant files that are also automatically downloaded within the colab:
Hi Marabou team,
I encountered a case where Marabou returns a
SATwitness that violates a linear equality constraint explicitly specified in the.ipqfile. To demonstrate the issue, I’ve created a Google Colab script that usesmaraboupyto load and solve the query (which represents a ReLU neural network), and then shows that one of the linear equality constraints is actually not satisfied by the returned witness.The main steps in the colab are as follows:
Solving the Query with Marabou
The script first loads an
.ipqfile that captures the input-output behavior of a neural network.Then, Marabou solves the query and returns a
SATwitness where all input variables are set to 0 and values are assigned to all intermediate and output variables.Manual Evaluation of a Constraint
We select one specific linear equality constraint from the
.ipqfile for which we know that the constraint is violated.The constraint is specified in the colab and is of the form:
x_target = a₁ * x₁ + a₂ * x₂ + ... + aₙ * xₙ
We use Marabou’s values for the variables on the right-hand side to compute a value for
x_targetbased on this equation in our own python code. Then we compare this computed value to the value Marabou assigned tox_target.Discrepancy Detection
The manually computed value of
x_targetdoes not match the value assigned by Marabou in its solution. The difference is significant, showing that the constraint is violated and that theSATwitness is incorrect.Sanity Check via ONNX Runtime
The variable
x_targethappens to correspond to the output node of the neural network. We independently evaluate the network using ONNX Runtime on the fixed input and obtain a value for the output node. This ONNX-derived value matches our manual computation, confirming that the Marabou-assigned value is incorrect.I’ve encountered similar incorrect
SATwitnesses in other cases as well and was not yet able to come up with a workaround for them.That is why I'd highly appreciate any advice on this issue and I am happy to provide more details.
Best regards,
Mustafa
Link to relevant files that are also automatically downloaded within the colab: