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

From ApCoCoAWiki
m (replaced <quotes> tag by real quotes)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Version|1}}
 
<command>
 
<command>
 
     <title>SAT.FixBits</title>
 
     <title>SAT.FixBits</title>
     <short_description>Allows to fix chosen bits in advance within a SAT input file. The new input file is "sat_fixed.cnf".
+
     <short_description>Allows to fix chosen bits in advance within a SAT input file. The new input file is <tt>sat_fixed.cnf</tt>.
 
</short_description>
 
</short_description>
 
<syntax>
 
<syntax>
Line 8: Line 9:
 
     <description>
 
     <description>
 
<itemize>
 
<itemize>
<item>@param <em>BitList</em>: The indeterminates that should get fixed
+
<item>@param <em>BitList</em>: The indeterminates that should get fixed. Format: <tt>[[IndetIndex_1,Value_1],[IndetIndex_2,Value_2],...]</tt></item>  
 
 
Format: [[IndetIndex_1,Value_1],[IndetIndex_2,Value_2],...]
 
</item>  
 
 
<item>@param <em>File</em>: File in the SAT directory of the apcocoa folder</item>
 
<item>@param <em>File</em>: File in the SAT directory of the apcocoa folder</item>
 
</itemize>
 
</itemize>
Line 22: Line 20:
 
F3:= x[1]x[2] + x[3];
 
F3:= x[1]x[2] + x[3];
 
SPE:=[F1,F2,F3];  
 
SPE:=[F1,F2,F3];  
SAT.ConvertToCNF(SPE,4,0);
+
SAT.ConvertToCNF(SPE,4,0,0);
 
SAT.FixBits([[1,0],[2,1]],"sat.cnf"); -- fixes x[1]=0 and x[2]=1
 
SAT.FixBits([[1,0],[2,1]],"sat.cnf"); -- fixes x[1]=0 and x[2]=1
 
SAT.LaunchMiniSat("sat_fixed.cnf");
 
SAT.LaunchMiniSat("sat_fixed.cnf");
Line 36: Line 34:
  
 
     <key>SAT.FixBits</key>
 
     <key>SAT.FixBits</key>
    <key>sat.FixBits</key>
 
 
     <key>FixBits</key>
 
     <key>FixBits</key>
     <wiki-category>Package_sat</wiki-category>
+
     <wiki-category>ApCoCoA-1:Package_sat</wiki-category>
 
</command>
 
</command>

Latest revision as of 13:49, 29 October 2020

This article is about a function from ApCoCoA-1.

SAT.FixBits

Allows to fix chosen bits in advance within a SAT input file. The new input file is sat_fixed.cnf.

Syntax

SAT.FixBits(BitList:LIST, File:STRING)

Description

  • @param BitList: The indeterminates that should get fixed. Format: [[IndetIndex_1,Value_1],[IndetIndex_2,Value_2],...]

  • @param File: File in the SAT directory of the apcocoa folder

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,0);
SAT.FixBits([[1,0],[2,1]],"sat.cnf"); -- fixes x[1]=0 and x[2]=1
SAT.LaunchMiniSat("sat_fixed.cnf");
SAT.GetResult();
--Result: [0,1,0] Test with: Eval(SPE,[0,1,0]);