Česky
Kamil Dudka

Fast SAT Solver (C++, GAlib)

File detail

Name:DownloadBlindSatSolver_8cpp-source.html [Download]
Location: fss > doc > api > html
Size:22.9 KB
Last modification:2022-09-09 13:06

Source code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Fast SAT Solver: BlindSatSolver.cpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.4 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li><a href="annotated.html"><span>Classes</span></a></li>
    <li class="current"><a href="files.html"><span>Files</span></a></li>
  </ul>
</div>
<h1>BlindSatSolver.cpp</h1><a href="BlindSatSolver_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2008 Kamil Dudka &lt;xdudka00@stud.fit.vutbr.cz&gt;</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * This file is part of fss (Fast SAT Solver).</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * fss is free software: you can redistribute it and/or modify</span>
<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation, either version 3 of the License, or</span>
<a name="l00009"></a>00009 <span class="comment"> * any later version.</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * fss is distributed in the hope that it will be useful,</span>
<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00015"></a>00015 <span class="comment"> *</span>
<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00017"></a>00017 <span class="comment"> * along with fss.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00018"></a>00018 <span class="comment"> */</span>
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;assert.h&gt;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;limits.h&gt;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;math.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="fssIO_8h.html" title="I/O module.">fssIO.h</a>"</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="SatProblem_8h.html" title="SAT Problem representation.">SatProblem.h</a>"</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="BlindSatSolver_8h.html" title="BlindSatSolver class using brute force method to solve SAT problem.">BlindSatSolver.h</a>"</span>
<a name="l00026"></a>00026 
<a name="l00027"></a><a class="code" href="namespaceFastSatSolver.html">00027</a> <span class="keyword">namespace </span>FastSatSolver {
<a name="l00028"></a>00028 
<a name="l00029"></a>00029   <span class="comment">// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</span>
<a name="l00030"></a>00030   <span class="comment">// LongSatItem implementation</span>
<a name="l00031"></a><a class="code" href="classFastSatSolver_1_1LongSatItem.html#7f62d7a550870b6b737070c90b79e507">00031</a>   <a class="code" href="classFastSatSolver_1_1LongSatItem.html#7f62d7a550870b6b737070c90b79e507">LongSatItem::LongSatItem</a>(<span class="keywordtype">int</span> length, <span class="keywordtype">long</span> fromNumber):
<a name="l00032"></a>00032     length_(length),
<a name="l00033"></a>00033     lNumber_(fromNumber)
<a name="l00034"></a>00034   {
<a name="l00035"></a>00035   }
<a name="l00036"></a><a class="code" href="classFastSatSolver_1_1LongSatItem.html#3015e95951347a208c0fb77f65f42591">00036</a>   LongSatItem::~LongSatItem() {
<a name="l00037"></a>00037   }
<a name="l00038"></a><a class="code" href="classFastSatSolver_1_1LongSatItem.html#f59b115e86eaeac1f15673766852e428">00038</a>   <span class="keywordtype">int</span> <a class="code" href="classFastSatSolver_1_1LongSatItem.html#f59b115e86eaeac1f15673766852e428" title="Returns count of bits (resp. variables) managed by object.">LongSatItem::getLength</a>()<span class="keyword"> const </span>{
<a name="l00039"></a>00039     <span class="keywordflow">return</span> length_;
<a name="l00040"></a>00040   }
<a name="l00041"></a><a class="code" href="classFastSatSolver_1_1LongSatItem.html#6eb09e770c61902c2e08002415ad7280">00041</a>   <span class="keywordtype">bool</span> <a class="code" href="classFastSatSolver_1_1LongSatItem.html#6eb09e770c61902c2e08002415ad7280" title="Returns value of desired bit (resp. variable).">LongSatItem::getBit</a>(<span class="keywordtype">int</span> index)<span class="keyword"> const </span>{
<a name="l00042"></a>00042     assert(index &lt; length_);
<a name="l00043"></a>00043     <span class="keywordflow">return</span> (1L&lt;&lt;index) &amp; lNumber_;
<a name="l00044"></a>00044   }
<a name="l00045"></a><a class="code" href="classFastSatSolver_1_1LongSatItem.html#e959bffab2c4c275b776d4e97e1e211c">00045</a>   <a class="code" href="classFastSatSolver_1_1LongSatItem.html" title="ISatItem implementation used by BlindSatSolver.">LongSatItem</a>* <a class="code" href="classFastSatSolver_1_1LongSatItem.html#e959bffab2c4c275b776d4e97e1e211c" title="Returns clone of object&amp;#39;s instance.">LongSatItem::clone</a>()<span class="keyword"> const </span>{
<a name="l00046"></a>00046     <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classFastSatSolver_1_1LongSatItem.html#7f62d7a550870b6b737070c90b79e507">LongSatItem</a>(length_, lNumber_);
<a name="l00047"></a>00047   }
<a name="l00048"></a>00048 
<a name="l00049"></a>00049   <span class="comment">// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</span>
<a name="l00050"></a>00050   <span class="comment">// BlindSatSolver implementation</span>
<a name="l00051"></a><a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html">00051</a>   <span class="keyword">struct </span><a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html">BlindSatSolver::Private</a> {
<a name="l00052"></a><a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#74a878161cb263331f8413b1502a482a">00052</a>     <a class="code" href="classFastSatSolver_1_1SatProblem.html" title="SAT Problem module&amp;#39;s facade.">SatProblem</a>        *problem;
<a name="l00053"></a><a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#b97109ec4907d851efd602b621a30a3e">00053</a>     <span class="keywordtype">int</span>               stepWidth;
<a name="l00054"></a><a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#c0057b861a6148690548c9581057adfa">00054</a>     <span class="keywordtype">long</span>              end;
<a name="l00055"></a><a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#67fec00dfad51ea05ccda5e0141a5169">00055</a>     <span class="keywordtype">long</span>              current;
<a name="l00056"></a><a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#1bc226ef66470ef381678531699b15e0">00056</a>     <span class="keywordtype">float</span>             minFitness;
<a name="l00057"></a><a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#c1dfa1e4f4ce3522765951e4bb1c8902">00057</a>     <span class="keywordtype">float</span>             maxFitness;
<a name="l00058"></a><a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#a7bea5fd6643ecfff2f69e2165a5720d">00058</a>     <span class="keywordtype">double</span>            sumFitness;
<a name="l00059"></a><a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#58655307c8ff9e51b867abe16f2824d5">00059</a>     <a class="code" href="classFastSatSolver_1_1SatItemVector.html" title="Linear storage container for ISatItem objects.">SatItemVector</a>     resultSet;
<a name="l00060"></a>00060 
<a name="l00061"></a><a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#02fd73d861ef2e4aabb38c0c9ff82947">00061</a>     <span class="keywordtype">void</span> init() {
<a name="l00062"></a>00062       current = 0L;
<a name="l00063"></a>00063       minFitness = INFINITY;
<a name="l00064"></a>00064       maxFitness = 0.0;
<a name="l00065"></a>00065       sumFitness = 0.0;
<a name="l00066"></a>00066     }
<a name="l00067"></a>00067   };
<a name="l00068"></a><a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#1d787435ca6a07292943f11d39ee9f01">00068</a>   <a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#1d787435ca6a07292943f11d39ee9f01">BlindSatSolver::BlindSatSolver</a>(<a class="code" href="classFastSatSolver_1_1SatProblem.html" title="SAT Problem module&amp;#39;s facade.">SatProblem</a> *problem, <span class="keywordtype">int</span> stepWidth):
<a name="l00069"></a>00069     d(new <a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html">Private</a>)
<a name="l00070"></a>00070   {
<a name="l00071"></a>00071     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> varsCount= problem-&gt;<a class="code" href="classFastSatSolver_1_1SatProblem.html#92e7e3731c3c44467cadeb9038dd4cb9" title="Returns total count of variables managed by SatProblem.">getVarsCount</a>();
<a name="l00072"></a>00072     <span class="keywordflow">if</span> (varsCount+2 &gt;= LONG_BIT) {
<a name="l00073"></a>00073       <span class="keyword">delete</span> d;
<a name="l00074"></a>00074       <span class="keywordflow">throw</span> <a class="code" href="classFastSatSolver_1_1GenericException.html" title="Common-usage exception containing error message inside.">GenericException</a>(<span class="stringliteral">"Too much variables - can't use blind solver on this machine!"</span>);
<a name="l00075"></a>00075     }
<a name="l00076"></a>00076     d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#74a878161cb263331f8413b1502a482a">problem</a> = problem;
<a name="l00077"></a>00077     d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#b97109ec4907d851efd602b621a30a3e">stepWidth</a> = stepWidth;
<a name="l00078"></a>00078     d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#c0057b861a6148690548c9581057adfa">end</a> = 1L&lt;&lt;varsCount;
<a name="l00079"></a>00079     d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#02fd73d861ef2e4aabb38c0c9ff82947">init</a>();
<a name="l00080"></a>00080   }
<a name="l00081"></a><a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#b727e98ec0bf1ff968b16b74c82a7e00">00081</a>   <a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#b727e98ec0bf1ff968b16b74c82a7e00">BlindSatSolver::~BlindSatSolver</a>() {
<a name="l00082"></a>00082     <span class="keyword">delete</span> d;
<a name="l00083"></a>00083   }
<a name="l00084"></a><a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#0f8b9a0b5b88a1091aee75779d1b7cb7">00084</a>   <a class="code" href="classFastSatSolver_1_1SatProblem.html" title="SAT Problem module&amp;#39;s facade.">SatProblem</a>* <a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#0f8b9a0b5b88a1091aee75779d1b7cb7" title="Returns pointer to instance of SatProblem used by solver.">BlindSatSolver::getProblem</a>() {
<a name="l00085"></a>00085     <span class="keywordflow">return</span> d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#74a878161cb263331f8413b1502a482a">problem</a>;
<a name="l00086"></a>00086   }
<a name="l00087"></a><a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#7b0abc45218a7539d5c842d0d23d1c2e">00087</a>   <span class="keywordtype">int</span> <a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#7b0abc45218a7539d5c842d0d23d1c2e" title="Returns current count solutions founded by solver.">BlindSatSolver::getSolutionsCount</a>() {
<a name="l00088"></a>00088     <span class="keywordflow">return</span> d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#58655307c8ff9e51b867abe16f2824d5">resultSet</a>.<a class="code" href="classFastSatSolver_1_1SatItemVector.html#f59b115e86eaeac1f15673766852e428" title="Returns count of item managed by container.">getLength</a>();
<a name="l00089"></a>00089   }
<a name="l00090"></a><a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#afe4f04b889ee848eb52271ea1f4f9ef">00090</a>   <a class="code" href="classFastSatSolver_1_1SatItemVector.html" title="Linear storage container for ISatItem objects.">SatItemVector</a>* <a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#afe4f04b889ee848eb52271ea1f4f9ef" title="Returns a set of solutions founded by solver.">BlindSatSolver::getSolutionVector</a>() {
<a name="l00091"></a>00091     <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classFastSatSolver_1_1SatItemVector.html" title="Linear storage container for ISatItem objects.">SatItemVector</a>(d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#58655307c8ff9e51b867abe16f2824d5">resultSet</a>);
<a name="l00092"></a>00092   }
<a name="l00093"></a><a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#3e12cbdb3e43385dc45fc10f703af769">00093</a>   <span class="keywordtype">float</span> <a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#3e12cbdb3e43385dc45fc10f703af769" title="Returns fitness of the Worst solution managed by solver.">BlindSatSolver::minFitness</a>() {
<a name="l00094"></a>00094     <span class="keywordflow">return</span> d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#1bc226ef66470ef381678531699b15e0">minFitness</a>;
<a name="l00095"></a>00095   }
<a name="l00096"></a><a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#c38f955a6e6a313249883aa555ab36b6">00096</a>   <span class="keywordtype">float</span> <a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#c38f955a6e6a313249883aa555ab36b6" title="Returns average fitness computed by solver.">BlindSatSolver::avgFitness</a>() {
<a name="l00097"></a>00097     <span class="keywordflow">return</span> d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#a7bea5fd6643ecfff2f69e2165a5720d">sumFitness</a> / d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#67fec00dfad51ea05ccda5e0141a5169">current</a>;
<a name="l00098"></a>00098   }
<a name="l00099"></a><a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#a4ff4f00ef1022a70f538e32d7a2e07b">00099</a>   <span class="keywordtype">float</span> <a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#a4ff4f00ef1022a70f538e32d7a2e07b" title="Returns the Best fitness founded by solver.">BlindSatSolver::maxFitness</a>() {
<a name="l00100"></a>00100     <span class="keywordflow">return</span> d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#c1dfa1e4f4ce3522765951e4bb1c8902">maxFitness</a>;
<a name="l00101"></a>00101   }
<a name="l00102"></a>00102   <span class="comment">// protected</span>
<a name="l00103"></a><a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#25a40b6614565f755233080a384c35f1">00103</a>   <span class="keywordtype">void</span> <a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#25a40b6614565f755233080a384c35f1" title="Initialize process.">BlindSatSolver::initialize</a>() {
<a name="l00104"></a>00104     d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#02fd73d861ef2e4aabb38c0c9ff82947">init</a>();
<a name="l00105"></a>00105     d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#58655307c8ff9e51b867abe16f2824d5">resultSet</a>.<a class="code" href="classFastSatSolver_1_1SatItemVector.html#c8bb3912a3ce86b15842e79d0b421204" title="Remove all item from container and free from memory.">clear</a>();
<a name="l00106"></a>00106   }
<a name="l00107"></a>00107   <span class="comment">// protected</span>
<a name="l00108"></a><a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#931514cf013abbc0b9511a44c1f7fe48">00108</a>   <span class="keywordtype">void</span> <a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#931514cf013abbc0b9511a44c1f7fe48" title="Do one step of process.">BlindSatSolver::doStep</a>() {
<a name="l00109"></a>00109     <span class="keyword">const</span> <span class="keywordtype">int</span> nVars= d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#74a878161cb263331f8413b1502a482a">problem</a>-&gt;<a class="code" href="classFastSatSolver_1_1SatProblem.html#92e7e3731c3c44467cadeb9038dd4cb9" title="Returns total count of variables managed by SatProblem.">getVarsCount</a>();
<a name="l00110"></a>00110     <span class="keyword">const</span> <span class="keywordtype">int</span> nForms= d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#74a878161cb263331f8413b1502a482a">problem</a>-&gt;<a class="code" href="classFastSatSolver_1_1SatProblem.html#fa9215848a08453610b67d1eb882c641" title="Returns total count of formulas managed by SatProblem.">getFormulasCount</a>();
<a name="l00111"></a>00111     <span class="keyword">const</span> <span class="keywordtype">int</span> countPerStep = 1 &lt;&lt; d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#b97109ec4907d851efd602b621a30a3e">stepWidth</a>;
<a name="l00112"></a>00112     <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i&lt; countPerStep; i++) {
<a name="l00113"></a>00113       <span class="keywordflow">if</span> (d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#67fec00dfad51ea05ccda5e0141a5169">current</a> &gt;= d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#c0057b861a6148690548c9581057adfa">end</a>) {
<a name="l00114"></a>00114         <span class="comment">// all space explored</span>
<a name="l00115"></a>00115         this-&gt;<a class="code" href="classFastSatSolver_1_1AbstractProcessWatched.html#8c528baf37154d347366083f0f816846" title="Stop currently executed process as soon as possible.">stop</a>();
<a name="l00116"></a>00116         <span class="keywordflow">break</span>;
<a name="l00117"></a>00117       }
<a name="l00118"></a>00118 
<a name="l00119"></a>00119       <span class="comment">// Evalueate fitness</span>
<a name="l00120"></a>00120       <a class="code" href="classFastSatSolver_1_1LongSatItem.html" title="ISatItem implementation used by BlindSatSolver.">LongSatItem</a> data(nVars, d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#67fec00dfad51ea05ccda5e0141a5169">current</a>++);
<a name="l00121"></a>00121       <span class="keyword">const</span> <span class="keywordtype">int</span> nSats= d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#74a878161cb263331f8413b1502a482a">problem</a>-&gt;<a class="code" href="classFastSatSolver_1_1SatProblem.html#3c6475887daf5925eadbc98109b8a3dc" title="Evaluate all formulas in container using given data and return satisfaction ratio...">getSatsCount</a>(&amp;data);
<a name="l00122"></a>00122       <span class="keyword">const</span> <span class="keywordtype">float</span> fitness= <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(nSats)/nForms;
<a name="l00123"></a>00123 
<a name="l00124"></a>00124       <span class="comment">// Update statistics</span>
<a name="l00125"></a>00125       d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#a7bea5fd6643ecfff2f69e2165a5720d">sumFitness</a> += fitness;
<a name="l00126"></a>00126       <span class="keywordflow">if</span> (fitness &lt; d-&gt;<a class="code" href="classFastSatSolver_1_1BlindSatSolver.html#3e12cbdb3e43385dc45fc10f703af769" title="Returns fitness of the Worst solution managed by solver.">minFitness</a>)
<a name="l00127"></a>00127         d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#1bc226ef66470ef381678531699b15e0">minFitness</a> = fitness;
<a name="l00128"></a>00128 
<a name="l00129"></a>00129       <span class="keywordflow">if</span> (fitness &gt; d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#c1dfa1e4f4ce3522765951e4bb1c8902">maxFitness</a>) {
<a name="l00130"></a>00130         <span class="comment">// maxFitness increased</span>
<a name="l00131"></a>00131         d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#c1dfa1e4f4ce3522765951e4bb1c8902">maxFitness</a> = fitness;
<a name="l00132"></a>00132         this-&gt;<a class="code" href="classFastSatSolver_1_1AbstractSubject.html#7ff19734eb024bd6f3e2ad95647b1b27" title="Send notification to all observers (listeners).">notify</a>();
<a name="l00133"></a>00133       }
<a name="l00134"></a>00134 
<a name="l00135"></a>00135       <span class="keywordflow">if</span> (nSats == nForms) {
<a name="l00136"></a>00136         <span class="comment">// Solution found</span>
<a name="l00137"></a>00137         d-&gt;<a class="code" href="structFastSatSolver_1_1BlindSatSolver_1_1Private.html#58655307c8ff9e51b867abe16f2824d5">resultSet</a>.<a class="code" href="classFastSatSolver_1_1SatItemVector.html#e50e61bb65bb3328f6afbd8e005cb96f" title="Add item to container.">addItem</a>(data.<a class="code" href="classFastSatSolver_1_1LongSatItem.html#e959bffab2c4c275b776d4e97e1e211c" title="Returns clone of object&amp;#39;s instance.">clone</a>());
<a name="l00138"></a>00138         this-&gt;<a class="code" href="classFastSatSolver_1_1AbstractSubject.html#7ff19734eb024bd6f3e2ad95647b1b27" title="Send notification to all observers (listeners).">notify</a>();
<a name="l00139"></a>00139       }
<a name="l00140"></a>00140     }
<a name="l00141"></a>00141   }
<a name="l00142"></a>00142 
<a name="l00143"></a>00143 
<a name="l00144"></a>00144 } <span class="comment">// namespace FastSatSolver</span>
<a name="l00145"></a>00145 
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Wed Nov 5 22:30:21 2008 for Fast SAT Solver by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.4 </small></address>
</body>
</html>