quant_theorem_producer.h

Go to the documentation of this file.
00001 /*****************************************************************************/
00002 /*!
00003  * \file quant_theorem_producer.h
00004  * 
00005  * Author: Daniel Wichs
00006  * 
00007  * Created: Jul 07 22:22:38 GMT 2003
00008  *
00009  * <hr>
00010  *
00011  * License to use, copy, modify, sell and/or distribute this software
00012  * and its documentation for any purpose is hereby granted without
00013  * royalty, subject to the terms and conditions defined in the \ref
00014  * LICENSE file provided with this distribution.
00015  * 
00016  * <hr>
00017  * 
00018  */
00019 /*****************************************************************************/
00020 #ifndef _cvc3__quant_theorem_producer_h_
00021 #define _cvc3__quant_theorem_producer_h_
00022 
00023 #include "quant_proof_rules.h"
00024 #include "theorem_producer.h"
00025 #include "theory_quant.h"
00026 
00027 namespace CVC3 {
00028   
00029   class QuantTheoremProducer: public QuantProofRules, public TheoremProducer {
00030     TheoryQuant* d_theoryQuant;
00031   private:
00032     //! find all bound variables in e and maps them to true in boundVars
00033     void recFindBoundVars(const Expr& e, 
00034         ExprMap<bool> & boundVars, ExprMap<bool> &visited);
00035   public:
00036     //! Constructor
00037     QuantTheoremProducer(TheoremManager* tm, TheoryQuant* theoryQuant):
00038       TheoremProducer(tm), d_theoryQuant(theoryQuant) {}
00039 
00040     virtual Theorem addNewConst(const Expr& e) ;
00041 
00042     //! ==> NOT EXISTS (vars): e  IFF FORALL (vars) NOT e
00043     virtual Theorem rewriteNotExists(const Expr& e);
00044     //! ==> NOT FORALL (vars): e  IFF EXISTS (vars) NOT e 
00045     virtual Theorem rewriteNotForall(const Expr& e);
00046     //! Instantiate a  universally quantified formula
00047     /*! From T|-FORALL(var): e generate T|-e' where e' is obtained
00048      * from e by instantiating bound variables with terms in
00049      * vector<Expr>& terms.  The vector of terms should be the same
00050      * size as the vector of bound variables in e. Also elements in
00051      * each position i need to have matching types.
00052      * \param t1 is the quantifier (a Theorem)
00053      * \param terms are the terms to instantiate.
00054      * \param quantLevel the quantification level for the theorem.
00055      */
00056     virtual Theorem universalInst(const Theorem& t1,
00057           const std::vector<Expr>& terms, int quantLevel);
00058 
00059     virtual Theorem universalInst(const Theorem& t1,
00060           const std::vector<Expr>& terms);
00061 
00062 
00063     virtual Theorem partialUniversalInst(const Theorem& t1,
00064            const std::vector<Expr>& terms,
00065            int quantLevel) ;
00066 
00067     
00068     /*! @brief From T|- QUANTIFIER (vars): e we get T|-QUANTIFIER(vars') e
00069      * where vars' is obtained from vars by removing all bound variables
00070      *  not used in e. If vars' is empty the produced theorem is just T|-e
00071      */
00072     virtual Theorem boundVarElim(const Theorem& t1);
00073 
00074     virtual Theorem adjustVarUniv(const Theorem& t1, 
00075           const std::vector<Expr>& newBvs);
00076 
00077     virtual Theorem packVar(const Theorem& t1);
00078 
00079     virtual Theorem pullVarOut(const Theorem& t1);
00080 
00081 
00082   }; 
00083 
00084 } 
00085 
00086 #endif

Generated on Tue Jul 3 14:33:38 2007 for CVC3 by  doxygen 1.5.1