00001 00027 // 00028 // file problem.h 00029 // defines class Problem 00030 // 00031 00032 00033 #ifndef __Problem__ 00034 #define __Problem__ 00035 00036 00037 #include "Unit.hpp" 00038 00039 00040 class FSymbol; 00041 class Options; 00042 00043 00044 // ****************** class Problem, definition ******************* 00045 00046 00047 class Problem { 00048 public: 00049 // constructors & destructors 00050 explicit Problem ( const UnitList& ); 00051 ~Problem (); 00052 void preprocess (Options&); 00053 00054 // query the structure 00055 UnitChain& units () { return _units; } 00056 00057 // properties 00058 bool hasFormulas () const { return _hasFormulas; } 00059 00060 // miscellaneous 00061 int removeUnusedDefinitions (); // the result is the number of removed definitions 00062 int removeEqualityAxioms (); 00063 int split (); 00064 void ennf (); 00065 int removeIff (); 00066 int miniscope (); 00067 void flatten (); 00068 void rectify (); 00069 void skolemize (); 00070 void clausify (); 00071 void addUnit (Unit u); // for incremental building 00072 void removeAllConjectures (); // for work with KIF 00073 const VarList& originalAnswerVariables () const 00074 { return _originalAnswerVariables; } 00075 const Literal& answerLiteral () const { return _answerLiteral; } 00076 00077 private: 00078 00079 // structure 00080 UnitChain _units; 00081 bool _hasFormulas; 00082 VarList _originalAnswerVariables; 00083 Literal _answerLiteral; 00084 00085 // auxiliary functions 00086 bool hasFreeVars (Formula&) const; 00087 int findDefinitions (); 00088 void clausify (FormulaList formulas, 00089 LiteralList literals, 00090 Unit parent); 00091 }; 00092 00093 00094 #endif // __Problem__