Fast SAT Solver (C++, GAlib)
File detail
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: SatProblem.h 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 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>SatProblem.h</h1><a href="SatProblem_8h.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 <xdudka00@stud.fit.vutbr.cz></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 <http://www.gnu.org/licenses/>.</span>
<a name="l00018"></a>00018 <span class="comment"> */</span>
<a name="l00019"></a>00019
<a name="l00020"></a>00020 <span class="preprocessor">#ifndef SATPROBLEMIMPL_H</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define SATPROBLEMIMPL_H</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span>
<a name="l00031"></a>00031 <span class="preprocessor">#include <string></span>
<a name="l00032"></a>00032 <span class="preprocessor">#include "<a class="code" href="Scanner_8h.html" title="Extensible lexical scanner used for reading SAT Problem specification.">Scanner.h</a>"</span>
<a name="l00033"></a>00033
<a name="l00034"></a>00034 <span class="keyword">namespace </span>FastSatSolver {
<a name="l00035"></a>00035 <span class="keyword">class </span>ISatItem;
<a name="l00036"></a>00036 <span class="keyword">class </span>IFormulaEvaluator;
<a name="l00037"></a>00037
<a name="l00043"></a><a class="code" href="classFastSatSolver_1_1VariableContainer.html">00043</a> <span class="keyword">class </span><a class="code" href="classFastSatSolver_1_1VariableContainer.html" title="Container for variables names.">VariableContainer</a>
<a name="l00044"></a>00044 {
<a name="l00045"></a>00045 <span class="keyword">public</span>:
<a name="l00046"></a>00046 <a class="code" href="classFastSatSolver_1_1VariableContainer.html#00f1722e56ddf903f93f0cde9c47ab04">VariableContainer</a>();
<a name="l00047"></a>00047 <a class="code" href="classFastSatSolver_1_1VariableContainer.html#f7643e55f019aea93deabcb798965a46">~VariableContainer</a>();
<a name="l00051"></a>00051 <span class="keywordtype">int</span> <a class="code" href="classFastSatSolver_1_1VariableContainer.html#ab0d4bbd0884d04dbe281cc2b9d21206" title="Returns count of variables managed by container.">getLength</a> ( );
<a name="l00052"></a>00052
<a name="l00058"></a>00058 std::string <a class="code" href="classFastSatSolver_1_1VariableContainer.html#139a3f2e63c60e612c649a57ba1ce9dd" title="Read name of variable on desired index.">getVarName</a> (<span class="keywordtype">int</span> index );
<a name="l00059"></a>00059
<a name="l00065"></a>00065 <span class="keywordtype">int</span> <a class="code" href="classFastSatSolver_1_1VariableContainer.html#5cfe545a4a8940c871fb05f3e6d55adc" title="Add variable to container, if it wasn&#39;t there before.">addVariable</a> (std::string name );
<a name="l00066"></a>00066
<a name="l00067"></a>00067 <span class="keyword">private</span>:
<a name="l00068"></a>00068 <span class="keyword">struct </span><a class="code" href="structFastSatSolver_1_1VariableContainer_1_1Private.html">Private</a>;
<a name="l00069"></a>00069 <a class="code" href="structFastSatSolver_1_1VariableContainer_1_1Private.html">Private</a> *d;
<a name="l00070"></a>00070 };
<a name="l00071"></a>00071
<a name="l00079"></a><a class="code" href="classFastSatSolver_1_1FormulaContainer.html">00079</a> <span class="keyword">class </span><a class="code" href="classFastSatSolver_1_1FormulaContainer.html" title="Container for evaluable formulas.">FormulaContainer</a>
<a name="l00080"></a>00080 {
<a name="l00081"></a>00081 <span class="keyword">public</span>:
<a name="l00082"></a>00082 <a class="code" href="classFastSatSolver_1_1FormulaContainer.html#68821237779770a79d4e2010928b7897">FormulaContainer</a>();
<a name="l00083"></a>00083 <a class="code" href="classFastSatSolver_1_1FormulaContainer.html#0fa72f6267c27fdd75c5251fd51757ec">~FormulaContainer</a>();
<a name="l00084"></a>00084
<a name="l00088"></a>00088 <span class="keywordtype">int</span> <a class="code" href="classFastSatSolver_1_1FormulaContainer.html#ab0d4bbd0884d04dbe281cc2b9d21206" title="Returns count of formulas managed by container.">getLength</a> ( );
<a name="l00089"></a>00089
<a name="l00097"></a>00097 <span class="keywordtype">int</span> <a class="code" href="classFastSatSolver_1_1FormulaContainer.html#b7e70416f171d0356ab2437d92577906" title="Evaluate all formulas in container using given data and return satisfaction ratio...">evalAll</a> (<a class="code" href="classFastSatSolver_1_1ISatItem.html" title="Abstraction of solution candidate.">ISatItem</a> *data);
<a name="l00098"></a>00098
<a name="l00103"></a>00103 <span class="keywordtype">void</span> <a class="code" href="classFastSatSolver_1_1FormulaContainer.html#845ab97b571220fabd160567843909a9" title="Add formula to container.">addFormula</a> (<a class="code" href="classFastSatSolver_1_1IFormulaEvaluator.html" title="Evaluable formula&#39;s interface.">IFormulaEvaluator</a> *formula );
<a name="l00104"></a>00104
<a name="l00105"></a>00105 <span class="keyword">private</span>:
<a name="l00106"></a>00106 <span class="keyword">struct </span><a class="code" href="structFastSatSolver_1_1FormulaContainer_1_1Private.html">Private</a>;
<a name="l00107"></a>00107 <a class="code" href="structFastSatSolver_1_1FormulaContainer_1_1Private.html">Private</a> *d;
<a name="l00108"></a>00108 };
<a name="l00109"></a>00109
<a name="l00110"></a>00110
<a name="l00115"></a><a class="code" href="classFastSatSolver_1_1SatProblem.html">00115</a> <span class="keyword">class </span><a class="code" href="classFastSatSolver_1_1SatProblem.html" title="SAT Problem module&#39;s facade.">SatProblem</a> {
<a name="l00116"></a>00116 <span class="keyword">public</span>:
<a name="l00117"></a>00117 <a class="code" href="classFastSatSolver_1_1SatProblem.html#5d3fd105680101a0b884e521e48c3706">SatProblem</a>();
<a name="l00118"></a>00118 <a class="code" href="classFastSatSolver_1_1SatProblem.html#2a8df988c3c0c2cf1391d7de1497020d">~SatProblem</a>();
<a name="l00119"></a>00119
<a name="l00124"></a>00124 <span class="keywordtype">void</span> <a class="code" href="classFastSatSolver_1_1SatProblem.html#e4a205ad3acbe7e655676a4f31377456" title="Load SAT Problem specification from file.">loadFromFile</a> (std::string fileName );
<a name="l00125"></a>00125
<a name="l00129"></a>00129 <span class="keywordtype">void</span> <a class="code" href="classFastSatSolver_1_1SatProblem.html#60bbd7b131b3eb0838488828f574fe40" title="Load SAT Problem specification from standard input.">loadFromInput</a> ( );
<a name="l00130"></a>00130
<a name="l00134"></a>00134 <span class="keywordtype">int</span> <a class="code" href="classFastSatSolver_1_1SatProblem.html#92e7e3731c3c44467cadeb9038dd4cb9" title="Returns total count of variables managed by SatProblem.">getVarsCount</a> ( );
<a name="l00135"></a>00135
<a name="l00141"></a>00141 std::string <a class="code" href="classFastSatSolver_1_1SatProblem.html#139a3f2e63c60e612c649a57ba1ce9dd" title="Returns name of variable with desired index.">getVarName</a> (<span class="keywordtype">int</span> index );
<a name="l00142"></a>00142
<a name="l00146"></a>00146 <span class="keywordtype">int</span> <a class="code" href="classFastSatSolver_1_1SatProblem.html#fa9215848a08453610b67d1eb882c641" title="Returns total count of formulas managed by SatProblem.">getFormulasCount</a>();
<a name="l00147"></a>00147
<a name="l00151"></a>00151 <span class="keywordtype">int</span> <a class="code" href="classFastSatSolver_1_1SatProblem.html#3c6475887daf5925eadbc98109b8a3dc" title="Evaluate all formulas in container using given data and return satisfaction ratio...">getSatsCount</a> (<a class="code" href="classFastSatSolver_1_1ISatItem.html" title="Abstraction of solution candidate.">ISatItem</a> *data);
<a name="l00152"></a>00152
<a name="l00156"></a>00156 <span class="keywordtype">bool</span> <a class="code" href="classFastSatSolver_1_1SatProblem.html#e9649a3c36b3d2060e9b8bf174f9048e" title="Returns true if SAT Problem is not valid.">hasError</a> ( );
<a name="l00157"></a>00157
<a name="l00158"></a>00158 <span class="keyword">private</span>:
<a name="l00159"></a>00159 <span class="keyword">struct </span><a class="code" href="structFastSatSolver_1_1SatProblem_1_1Private.html">Private</a>;
<a name="l00160"></a>00160 <a class="code" href="structFastSatSolver_1_1SatProblem_1_1Private.html">Private</a> *d;
<a name="l00161"></a>00161 };
<a name="l00162"></a>00162
<a name="l00163"></a>00163 } <span class="comment">// namespace FastSatSolver</span>
<a name="l00164"></a>00164
<a name="l00165"></a>00165
<a name="l00166"></a>00166 <span class="preprocessor">#endif // SATPROBLEMIMPL_H</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Wed Nov 5 22:30:22 2008 for Fast SAT Solver by
<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>