ApCoCoA-1:SAT.ConvertToCNF: Difference between revisions

From ApCoCoAWiki
Stadler (talk | contribs)
Stadler (talk | contribs)
No edit summary
Line 1: Line 1:
<command>
<command>
     <title>SAT.ConvertToCNF</title>
     <title>SAT.ConvertToCNF</title>
     <short_description>Converts a given quadratic (cubic) system of polynomial equations (SPE) over GF(2) to CNF. Writes the CNF to the file "sat.cnf"</short_description>
     <short_description>Converts a given quadratic (cubic) system of polynomial equations (SPE) over GF(2) to CNF. Writes the CNF to the file <quotes>sat.cnf</quotes></short_description>
<syntax>
<syntax>
SAT.ConvertToCNF(SPE:LIST, CuttingNumber:INT, QStrategy:INT)
SAT.ConvertToCNF(SPE:LIST, CuttingNumber:INT, QStrategy:INT)
Line 10: Line 10:
<itemize>
<itemize>
<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>CuttingNumber</em>: Max. support-length of the linear polynomials when their corresponding CNF is written to the file. Could be 3 - 6. </item>
<item>@param <em>CuttingNumber</em>: Maximal support-length of the linear polynomials when their corresponding CNF is written to the file. Could be 3 - 6. </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>
</itemize>
</itemize>
Line 22: Line 22:
SPE:=[F1,F2,F3];  
SPE:=[F1,F2,F3];  
SAT.ConvertToCNF(SPE,4,0);
SAT.ConvertToCNF(SPE,4,0);
SAT.LaunchMiniSat("sat.cnf");
SAT.LaunchMiniSat(<quotes>sat.cnf</quotes>);
SAT.GetResult();
SAT.GetResult();
--Result: [0,1,0] Test with: Eval(SPE,[0,1,0]);
--Result: [0,1,0] Test with: Eval(SPE,[0,1,0]);
Line 35: Line 35:
SPE:=[F1,F2,F3];
SPE:=[F1,F2,F3];
SAT.ConvertToCNF(SPE,4,0);
SAT.ConvertToCNF(SPE,4,0);
SAT.LaunchMiniSat("sat.cnf");
SAT.LaunchMiniSat(<quotes>sat.cnf</quotes>);
SAT.GetResult();
SAT.GetResult();
--Result: [0,0,1] Test with: Eval(SPE,[0,0,1]);
--Result: [0,0,1] Test with: Eval(SPE,[0,0,1]);
Line 48: Line 48:


     <key>SAT.ConvertToCNF</key>
     <key>SAT.ConvertToCNF</key>
    <key>sat.ConvertToCNF</key>
     <key>ConvertToCNF</key>
     <key>ConvertToCNF</key>
     <wiki-category>Package_sat</wiki-category>
     <wiki-category>Package_sat</wiki-category>
</command>
</command>

Revision as of 11:44, 15 October 2009

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:= 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.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:=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.ConvertToCNF(SPE,4,0);
SAT.LaunchMiniSat(<quotes>sat.cnf</quotes>);
SAT.GetResult();
--Result: [0,0,1] Test with: Eval(SPE,[0,0,1]);