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 FOROMULA_H 00021 #define FOROMULA_H 00022 00031 #include "SatProblem.h" 00032 00033 00034 namespace FastSatSolver { 00035 00041 class IFormulaBuilder 00042 { 00043 public: 00044 virtual ~IFormulaBuilder() { } 00045 00052 virtual int parse (Token token ) = 0; 00053 00058 virtual bool isValid ( ) = 0; 00059 }; 00060 00069 class IFormulaEvaluator 00070 { 00071 public: 00072 virtual ~IFormulaEvaluator() { } 00073 00079 virtual bool eval (ISatItem *data ) = 0; 00080 }; 00081 00088 class InterpretedFormula: 00089 public IFormulaBuilder, 00090 public IFormulaEvaluator 00091 { 00092 public: 00093 InterpretedFormula(); 00094 ~InterpretedFormula(); 00095 00099 int parse (Token token ); 00100 00104 bool isValid ( ); 00105 00109 bool eval (ISatItem *data ); 00110 00111 private: 00112 struct Private; 00113 Private *const d; 00114 }; 00115 00116 00117 } // namespace FastSatSolver 00118 00119 00120 #endif // FOROMULA_H