# Difference between revisions of "ApCoCoA-1:SAT.ConvertToCNF"

## SAT.ConvertToCNF

Converts a given quadratic (cubic) system of polynomial equations (SPE) over GF(2) to CNF. Writes the CNF to the file sat.cnf

### Syntax

```SAT.ConvertToCNF(SPE:LIST, CuttingNumber:INT, QStrategy:INT)
```

### Description

This function starts the conversion algorithm.

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

• @param CuttingNumber: Maximal support-length of the linear polynomials when their corresponding CNF is written to the file. Could be 3 - 6.

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

#### Example

```-- quadratic system:
Use R::=ZZ/(2)[x[1..3]];
F1:= xx + xx + xx + x;
F2:= x + 1;
F3:= xx + x;
SPE:=[F1,F2,F3];
SAT.ConvertToCNF(SPE,4,0);
SAT.LaunchMiniSat(<quotes>sat.cnf</quotes>);
SAT.GetResult();
--Result: [0,1,0] Test with: Eval(SPE,[0,1,0]);
```

#### Example

```-- cubic system:
Use ZZ/(2)[x[1..3]];
F1:=xxx + xx + xx + x + x +1;
F2:=xxx + xx + xx + x + x;
F3:=xx + xx + x;
SPE:=[F1,F2,F3];
SAT.ConvertToCNF(SPE,4,0);
SAT.LaunchMiniSat(<quotes>sat.cnf</quotes>);
SAT.GetResult();
--Result: [0,0,1] Test with: Eval(SPE,[0,0,1]);
```