00001 /*****************************************************************************/ 00002 /*! 00003 * \file theorem_manager.h 00004 * 00005 * Author: Sergey Berezin, Tue Feb 4 14:29:25 2003 00006 * 00007 * Created: Feb 05 18:29:37 GMT 2003 00008 * 00009 * <hr> 00010 * Copyright (C) 2003 by the Board of Trustees of Leland Stanford 00011 * Junior University and by New York University. 00012 * 00013 * License to use, copy, modify, sell and/or distribute this software 00014 * and its documentation for any purpose is hereby granted without 00015 * royalty, subject to the terms and conditions defined in the \ref 00016 * LICENSE file provided with this distribution. In particular: 00017 * 00018 * - The above copyright notice and this permission notice must appear 00019 * in all copies of the software and related documentation. 00020 * 00021 * - THE SOFTWARE IS PROVIDED "AS-IS", WITHOUT ANY WARRANTIES, 00022 * EXPRESSED OR IMPLIED. USE IT AT YOUR OWN RISK. 00023 * 00024 * <hr> 00025 * 00026 * CLASS: TheoremManager 00027 * 00028 * 00029 * Holds the shared data for the class Theorem 00030 */ 00031 /*****************************************************************************/ 00032 00033 #ifndef _CVC_lite__theorem_manager_h_ 00034 #define _CVC_lite__theorem_manager_h_ 00035 00036 #include "debug.h" 00037 00038 namespace CVCL { 00039 00040 class ContextManager; 00041 class ExprManager; 00042 class CLFlags; 00043 class MemoryManager; 00044 class CommonProofRules; 00045 00046 class TheoremManager { 00047 private: 00048 ContextManager* d_cm; 00049 ExprManager* d_em; 00050 const CLFlags& d_flags; 00051 MemoryManager* d_mm; 00052 MemoryManager* d_rwmm; 00053 MemoryManager* d_reflmm; 00054 bool d_withProof; 00055 bool d_withAssump; 00056 unsigned d_flag; // used for setting flags in Theorems 00057 bool d_active; //!< Whether TheoremManager is active. See also clear() 00058 CommonProofRules* d_rules; 00059 00060 CommonProofRules* createProofRules(); 00061 00062 public: 00063 //! Constructor 00064 TheoremManager(ContextManager* cm, 00065 ExprManager* em, 00066 const CLFlags& flags); 00067 //! Destructor 00068 ~TheoremManager(); 00069 //! Deactivate TheoremManager 00070 /*! No more Theorems can be created after this call, only deleted. 00071 * The purpose of this call is to dis-entangle the mutual 00072 * dependency of ExprManager and TheoremManager during destruction time. 00073 */ 00074 void clear(); 00075 //! Test whether the TheoremManager is still active 00076 bool isActive() { return d_active; } 00077 00078 ContextManager* getCM() const { return d_cm; } 00079 ExprManager* getEM() const { return d_em; } 00080 const CLFlags& getFlags() const { return d_flags; } 00081 MemoryManager* getMM() const { return d_mm; } 00082 MemoryManager* getRWMM() const { return d_rwmm; } 00083 MemoryManager* getReflMM() const { return d_reflmm; } 00084 CommonProofRules* getRules() const { return d_rules; } 00085 00086 unsigned getFlag() const { 00087 return d_flag; 00088 } 00089 00090 void clearAllFlags() { 00091 FatalAssert(++d_flag, "Theorem flag overflow."); 00092 } 00093 00094 bool withProof() { 00095 return d_withProof; 00096 } 00097 bool withAssumptions() { 00098 return d_withAssump; 00099 } 00100 00101 }; // end of class TheoremManager 00102 00103 } // end of namespace CVCL 00104 00105 #endif