theorem_manager.cpp

Go to the documentation of this file.
00001 /*****************************************************************************/
00002 /*!
00003  * \file theorem_manager.cpp
00004  * 
00005  * Author: Sergey Berezin
00006  * 
00007  * Created: Feb 11 02:39:35 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  */
00027 /*****************************************************************************/
00028 // File: theorem_manager.cpp
00029 //
00030 // AUTHOR: Sergey Berezin, 07/05/02
00031 //
00032 // Defines some functions for class TheoremManager.  They are not
00033 // inlined becaule they use ExprManager (expr_manager.h), which
00034 // includes theorem_manager.h.
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 // ExprManager is not initialized in vcl yet when we are created; we
00051 // use d_em as our local cache to fetch the EM when our getEM() is
00052 // first called.
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 }

Generated on Thu Apr 13 16:57:33 2006 for CVC Lite by  doxygen 1.4.4