00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 #include "theorem_value.h"
00032 #include "memory_manager_chunks.h"
00033 #include "memory_manager_malloc.h"
00034 #include "command_line_flags.h"
00035 #include "common_proof_rules.h"
00036 
00037 
00038 using namespace std;
00039 using namespace CVC3;
00040 
00041 
00042 
00043 
00044 
00045 
00046 TheoremManager::TheoremManager(ContextManager* cm,
00047                                ExprManager* em,
00048                                const CLFlags& flags)
00049   : d_cm(cm), d_em(em), d_flags(flags),
00050     d_withProof(flags["proofs"].getBool()),
00051     d_withAssump(true), d_flag(1),
00052     d_active(true)
00053 {
00054   d_em->newKind(PF_APPLY, "|-");
00055   d_em->newKind(PF_HOLE, "**");
00056   DebugAssert(!d_withProof || d_withAssump, 
00057         "TheoremManager(): proofs without assumptions are not allowed");
00058   if (flags["mm"].getString() == "chunks") {
00059     d_mm = new MemoryManagerChunks(sizeof(RegTheoremValue));
00060     d_rwmm = new MemoryManagerChunks(sizeof(RWTheoremValue));
00061   } else {
00062     d_mm = new MemoryManagerMalloc();
00063     d_rwmm = new MemoryManagerMalloc();
00064   }
00065   d_rules = createProofRules();
00066 }
00067 
00068 
00069 TheoremManager::~TheoremManager()
00070 {
00071   delete d_mm;
00072   delete d_rwmm;
00073 }
00074 
00075 
00076 void TheoremManager::clear() {
00077   delete d_rules;
00078   d_active=false;
00079 }