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
00032
00033
00034
00035
00036
00037
00038
00039 #include "theorem_value.h"
00040 #include "memory_manager_chunks.h"
00041 #include "memory_manager_malloc.h"
00042 #include "command_line_flags.h"
00043 #include "common_proof_rules.h"
00044
00045
00046 using namespace std;
00047 using namespace CVCL;
00048
00049
00050
00051
00052
00053
00054 TheoremManager::TheoremManager(ContextManager* cm,
00055 ExprManager* em,
00056 const CLFlags& flags)
00057 : d_cm(cm), d_em(em), d_flags(flags),
00058 d_withProof(flags["proofs"].getBool()),
00059 d_withAssump(flags["assump"].getBool()), d_flag(1),
00060 d_active(true)
00061 {
00062 d_em->newKind(PF_APPLY, "|-");
00063 d_em->newKind(PF_HOLE, "**");
00064 DebugAssert(!d_withProof || d_withAssump,
00065 "TheoremManager(): proofs without assumptions are not allowed");
00066 if (flags["mm"].getString() == "chunks") {
00067 d_mm = new MemoryManagerChunks(sizeof(TheoremValue));
00068 d_rwmm = new MemoryManagerChunks(sizeof(RWTheoremValue));
00069 d_reflmm = new MemoryManagerChunks(sizeof(ReflexivityTheoremValue));
00070 } else {
00071 d_mm = new MemoryManagerMalloc();
00072 d_rwmm = new MemoryManagerMalloc();
00073 d_reflmm = new MemoryManagerMalloc();
00074 }
00075 d_rules = createProofRules();
00076 }
00077
00078
00079 TheoremManager::~TheoremManager()
00080 {
00081 delete d_mm;
00082 delete d_rwmm;
00083 delete d_reflmm;
00084 }
00085
00086
00087 void TheoremManager::clear() {
00088 delete d_rules;
00089 d_active=false;
00090 }