# Package sat/SAT.ConvertToXOR

## SAT.ConvertToXOR

Converts a given quadratic (cubic) system of polynomial equations (SPE) over GF(2) to XOR-CNF and writes the output to a file.

### Syntax

```SAT.ConvertToXOR(SPE:LIST, QStrategy:INT, CStrategy:INT): STRING
```

### Description

This function takes a list of polynomials as input, converts them into XOR-CNF notation and writes the output to a file whose name is not assigned yet.

• @param SPE: A List containing the polynomial equations of the system.

• @param QStrategy: Strategy for quadratic substitution. 0 - Standard; 1 - Linear Partner; 2 - Adv. Lin. Partner;

• @param CStrategy: Strategy for cubic substitution. 0 - Standard; 1 - Quadratic Partner;

• <item>@return The (absolute) path to the file the output was written to.

#### Example

```-- quadratic system:
Use P ::= ZZ/(2)[x[1..3]];
F1 := x[1]*x[2] + x[1]*x[3] + x[2]*x[3] + x[3];
F2 := x[2] + 1;
F3 := x[1]*x[2] + x[3];
SPE :=[F1,F2,F3];
CNFPath := SAT.ConvertToXOR(SPE,0,0);
SolPath := SAT.LaunchCryptoMiniSat(CNFPath);
SAT.GetResult(SolPath,P);
-- Result: [0,1,0] Test with: Eval(SPE,[0,1,0]);
```

#### Example

```-- cubic system:
Use P ::= ZZ/(2)[x[1..3]];
F1 := x[1]*x[2]*x[3] + x[1]*x[2] + x[2]*x[3] + x[1] + x[3] +1;
F2 := x[1]*x[2]*x[3] + x[1]*x[2] + x[2]*x[3] + x[1] + x[2];
F3 := x[1]*x[2] + x[2]*x[3] + x[2];
SPE := [F1,F2,F3];
CNFPath := SAT.ConvertToXOR(SPE,0,0);
SolPath := SAT.LaunchCryptoMiniSat(CNFPath);
SAT.GetResult(SolPath,P);
-- Result: [0,0,1] Test with: Eval(SPE,[0,0,1]);
```