Commit 50012727 authored by Daniel Le Berre's avatar Daniel Le Berre

Add support for native xor constraints in Gate Translator.

parent f59ab3e4
Pipeline #5939 failed with stages
in 27 minutes and 57 seconds
......@@ -318,6 +318,21 @@ public class GateTranslator extends SolverDecorator<ISolver> {
return constrs;
}
/**
* translate <code>y &lt;=&gt; x1 xor x2 xor ... xor xn</code> into a native
* xor constraint.
*
* @param y
* @param literals
* @return a native xor constraint
* @since 2.3.6
*
*/
public IConstr nativeXor(int y, IVecInt literals) {
literals.push(-y);
return addParity(literals, false);
}
/**
* translate
* <code>y &lt;=&gt; (x1 &lt;=&gt; x2 &lt;=&gt; ... &lt;=&gt; xn)</code>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment