common_theorem_producer.h

Go to the documentation of this file.
00001 /*****************************************************************************/
00002 /*!
00003  * \file common_theorem_producer.h
00004  * 
00005  * Author: Sergey Berezin
00006  * 
00007  * Created: Feb 05 03:40:36 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 // CLASS: CommonTheoremProducer
00029 //
00030 // AUTHOR: Sergey Berezin, 12/09/2002
00031 //
00032 // Description: Implementation of the proof rules for ground
00033 // equational logic (reflexivity, symmetry, transitivity, and
00034 // substitutivity).
00035 //
00036 ///////////////////////////////////////////////////////////////////////////////
00037 
00038 #ifndef _CVC_lite__common_theorem_producer_h_
00039 #define _CVC_lite__common_theorem_producer_h_
00040 
00041 #include "common_proof_rules.h"
00042 #include "theorem_producer.h"
00043 #include "theorem.h"
00044 #include "cdmap.h"
00045 
00046 namespace CVCL {
00047 
00048   class CommonTheoremProducer: public CommonProofRules, public TheoremProducer {
00049   private:
00050 
00051     // TODO: do we need to record skolem axioms?  do we need context-dependence?
00052 
00053     // skolem axioms
00054     std::vector<Theorem> d_skolem_axioms;
00055 
00056     /* @brief Keep skolemization axioms so that they can be reused 
00057        without being recreated each time */
00058     CDMap<Expr, Theorem> d_skolemized_thms;
00059 
00060     //! Mapping of e to "|- e = v" for fresh Skolem vars v
00061     CDMap<Expr, Theorem> d_skolemVars;
00062 
00063   public:
00064     CommonTheoremProducer(TheoremManager* tm);
00065     virtual ~CommonTheoremProducer() { }
00066 
00067     Theorem assumpRule(const Expr& a, int scope = -1);
00068     Theorem reflexivityRule(const Expr& a);
00069     Theorem rewriteReflexivity(const Expr& t);
00070     Theorem symmetryRule(const Theorem& a1_eq_a2);
00071     Theorem rewriteUsingSymmetry(const Expr& a1_eq_a2);
00072     Theorem transitivityRule(const Theorem& a1_eq_a2,
00073                              const Theorem& a2_eq_a3);
00074     Theorem substitutivityRule(const Op& op,
00075                                const std::vector<Theorem>& thms);
00076     Theorem substitutivityRule(const Expr& e,
00077                                const std::vector<unsigned>& changed,
00078                                const std::vector<Theorem>& thms);
00079     Theorem contradictionRule(const Theorem& e, const Theorem& not_e);
00080     Theorem iffTrue(const Theorem& e);
00081     Theorem iffNotFalse(const Theorem& e);
00082     Theorem iffTrueElim(const Theorem& e);
00083     Theorem iffFalseElim(const Theorem& e);
00084     Theorem iffContrapositive(const Theorem& thm);
00085     Theorem notNotElim(const Theorem& e);
00086     Theorem iffMP(const Theorem& e1, const Theorem& e1_iff_e2);
00087     Theorem implMP(const Theorem& e1, const Theorem& e1_impl_e2);
00088     Theorem andElim(const Theorem& e, int i);
00089     Theorem andIntro(const Theorem& e1, const Theorem& e2);
00090     Theorem andIntro(const std::vector<Theorem>& es);
00091     Theorem implIntro(const Theorem& phi, const std::vector<Expr>& assump);
00092     Theorem implContrapositive(const Theorem& thm);
00093     Theorem notToIff(const Theorem& not_e);
00094     Theorem rewriteIff(const Expr& e);
00095     Theorem rewriteAnd(const Expr& e);
00096     Theorem rewriteOr(const Expr& e);
00097     Theorem rewriteNotTrue(const Expr& e);
00098     Theorem rewriteNotFalse(const Expr& e);
00099     Theorem rewriteNotNot(const Expr& e);
00100     Theorem rewriteNotForall(const Expr& forallExpr);
00101     Theorem rewriteNotExists(const Expr& existsExpr);
00102     Expr skolemize(const Expr& e);
00103     Theorem skolemizeRewrite(const Expr& e);
00104     Theorem skolemizeRewriteVar(const Expr& e);
00105     Theorem varIntroRule(const Expr& e);
00106     Theorem skolemize(const Theorem& thm);
00107     Theorem varIntroSkolem(const Expr& e);
00108     Theorem trueTheorem();
00109     Theorem rewriteAnd(const Theorem& e);
00110     Theorem rewriteOr(const Theorem& e);
00111 
00112     std::vector<Theorem>& getSkolemAxioms() { return d_skolem_axioms; }
00113     void clearSkolemAxioms() { d_skolem_axioms.clear(); }
00114 
00115   }; // end of class CommonTheoremProducer
00116 
00117 } // end of namespace CVCL
00118 
00119 #endif

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