Difference between revisions of "ApCoCoA-1:SAT.ConvertToXOR"

From ApCoCoAWiki
m (added version info)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Version|1|[[Package sat/SAT.ConvertToXOR]]}}
 
<command>
 
<command>
 
     <title>SAT.ConvertToXOR</title>
 
     <title>SAT.ConvertToXOR</title>
     <short_description>Converts a given quadratic (cubic) system of polynomial equations (SPE) over GF(2) to XOR-CNF. Writes the XOR-CNF to the file "sat_xor.cnf".
+
     <short_description>Converts a given quadratic (cubic) system of polynomial equations (SPE) over GF(2) to XOR-CNF. Writes the XOR-CNF to the file <tt>sat_xor.cnf</tt>.
 
 
<em>Note:</em> XOR-CNF files are only applicable with CryptoMiniSat!
 
 
</short_description>
 
</short_description>
 
<syntax>
 
<syntax>
SAT.ConvertToXOR(SPE:LIST, QStrategy:INT)
+
SAT.ConvertToXOR(SPE:LIST, QStrategy:INT, CStrategy:INT)
 
</syntax>
 
</syntax>
 
     <description>
 
     <description>
 +
<em>Note:</em> XOR-CNF files are only applicable with CryptoMiniSat!
 +
<par/>
 
This function starts an alternative conversion algorithm.
 
This function starts an alternative conversion algorithm.
  
Line 14: Line 15:
 
<item>@param <em>SPE</em>: A List containing the polynomial equations of the system.</item>  
 
<item>@param <em>SPE</em>: A List containing the polynomial equations of the system.</item>  
 
<item>@param <em>QStrategy</em>: Strategy for quadratic substitution. 0 - Standard; 1 - Linear Partner; 2 - Adv. Lin. Partner;</item>
 
<item>@param <em>QStrategy</em>: Strategy for quadratic substitution. 0 - Standard; 1 - Linear Partner; 2 - Adv. Lin. Partner;</item>
 +
<item>@param <em>CStrategy</em>: Strategy for cubic substitution. 0 - Standard; 1 - Quadratic Partner;</item>
 
</itemize>
 
</itemize>
  
Line 23: Line 25:
 
F3:= x[1]x[2] + x[3];
 
F3:= x[1]x[2] + x[3];
 
SPE:=[F1,F2,F3];  
 
SPE:=[F1,F2,F3];  
SAT.ConvertToXOR(SPE,0);
+
SAT.ConvertToXOR(SPE,0,0);
 
SAT.LaunchCryptoMiniSat("sat_xor.cnf");
 
SAT.LaunchCryptoMiniSat("sat_xor.cnf");
 
SAT.GetResult();
 
SAT.GetResult();
Line 36: Line 38:
 
F3:=x[1]x[2] + x[2]x[3] + x[2];
 
F3:=x[1]x[2] + x[2]x[3] + x[2];
 
SPE:=[F1,F2,F3];
 
SPE:=[F1,F2,F3];
SAT.ConvertToXOR(SPE,0);
+
SAT.ConvertToXOR(SPE,0,0);
 
SAT.LaunchCryptoMiniSat("sat_xor.cnf");
 
SAT.LaunchCryptoMiniSat("sat_xor.cnf");
 
SAT.GetResult();
 
SAT.GetResult();
Line 52: Line 54:
 
     <key>sat.ConvertToXOR</key>
 
     <key>sat.ConvertToXOR</key>
 
     <key>ConvertToXOR</key>
 
     <key>ConvertToXOR</key>
     <wiki-category>Package_sat</wiki-category>
+
     <wiki-category>ApCoCoA-1:Package_sat</wiki-category>
 
</command>
 
</command>

Latest revision as of 10:31, 2 November 2020

This article is about a function from ApCoCoA-1. If you are looking for the ApCoCoA-2 version of it, see Package sat/SAT.ConvertToXOR.

SAT.ConvertToXOR

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

Syntax

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

Description

Note: XOR-CNF files are only applicable with CryptoMiniSat!

This function starts an alternative conversion algorithm.

  • @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;

Example

-- quadratic system:
Use R::=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]; 
SAT.ConvertToXOR(SPE,0,0);
SAT.LaunchCryptoMiniSat("sat_xor.cnf");
SAT.GetResult();
--Result: [0,1,0] Test with: Eval(SPE,[0,1,0]);

Example

-- cubic system:
Use 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];
SAT.ConvertToXOR(SPE,0,0);
SAT.LaunchCryptoMiniSat("sat_xor.cnf");
SAT.GetResult();
--Result: [0,0,1] Test with: Eval(SPE,[0,0,1]);