00001 /* 00002 * Copyright (C) 2008 Kamil Dudka <xdudka00@stud.fit.vutbr.cz> 00003 * 00004 * This file is part of fss (Fast SAT Solver). 00005 * 00006 * fss is free software: you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation, either version 3 of the License, or 00009 * any later version. 00010 * 00011 * fss is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with fss. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #ifndef SATPROBLEMIMPL_H 00021 #define SATPROBLEMIMPL_H 00022 00031 #include <string> 00032 #include "Scanner.h" 00033 00034 namespace FastSatSolver { 00035 class ISatItem; 00036 class IFormulaEvaluator; 00037 00043 class VariableContainer 00044 { 00045 public: 00046 VariableContainer(); 00047 ~VariableContainer(); 00051 int getLength ( ); 00052 00058 std::string getVarName (int index ); 00059 00065 int addVariable (std::string name ); 00066 00067 private: 00068 struct Private; 00069 Private *d; 00070 }; 00071 00079 class FormulaContainer 00080 { 00081 public: 00082 FormulaContainer(); 00083 ~FormulaContainer(); 00084 00088 int getLength ( ); 00089 00097 int evalAll (ISatItem *data); 00098 00103 void addFormula (IFormulaEvaluator *formula ); 00104 00105 private: 00106 struct Private; 00107 Private *d; 00108 }; 00109 00110 00115 class SatProblem { 00116 public: 00117 SatProblem(); 00118 ~SatProblem(); 00119 00124 void loadFromFile (std::string fileName ); 00125 00129 void loadFromInput ( ); 00130 00134 int getVarsCount ( ); 00135 00141 std::string getVarName (int index ); 00142 00146 int getFormulasCount(); 00147 00151 int getSatsCount (ISatItem *data); 00152 00156 bool hasError ( ); 00157 00158 private: 00159 struct Private; 00160 Private *d; 00161 }; 00162 00163 } // namespace FastSatSolver 00164 00165 00166 #endif // SATPROBLEMIMPL_H
1.5.4