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 * 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 #ifndef _CVC_lite__quant_theorem_producer_h_ 00029 #define _CVC_lite__quant_theorem_producer_h_ 00030 00031 #include "quant_proof_rules.h" 00032 #include "theorem_producer.h" 00033 #include "theory_quant.h" 00034 00035 namespace CVCL { 00036 00037 class QuantTheoremProducer: public QuantProofRules, public TheoremProducer { 00038 TheoryQuant* d_theoryQuant; 00039 private: 00040 //! find all bound variables in e and maps them to true in boundVars 00041 void recFindBoundVars(const Expr& e, 00042 ExprMap<bool> & boundVars, ExprMap<bool> &visited); 00043 public: 00044 //! Constructor 00045 QuantTheoremProducer(TheoremManager* tm, TheoryQuant* theoryQuant): 00046 TheoremProducer(tm), d_theoryQuant(theoryQuant) {} 00047 00048 //! ==> NOT EXISTS (vars): e IFF FORALL (vars) NOT e 00049 virtual Theorem rewriteNotExists(const Expr& e); 00050 //! ==> NOT FORALL (vars): e IFF EXISTS (vars) NOT e 00051 virtual Theorem rewriteNotForall(const Expr& e); 00052 //! Instantiate a universally quantified formula 00053 /*! From T|-FORALL(var): e generate T|-e' where e' is obtained 00054 * from e by instantiating bound variables with terms in 00055 * vector<Expr>& terms. The vector of terms should be the same 00056 * size as the vector of bound variables in e. Also elements in 00057 * each position i need to have matching types. 00058 * \param t1 is the quantifier (a Theorem) 00059 * \param terms are the terms to instantiate. 00060 */ 00061 virtual Theorem universalInst(const Theorem& t1, 00062 const std::vector<Expr>& terms); 00063 00064 /*! @brief From T|- QUANTIFIER (vars): e we get T|-QUANTIFIER(vars') e 00065 * where vars' is obtained from vars by removing all bound variables 00066 * not used in e. If vars' is empty the produced theorem is just T|-e 00067 */ 00068 virtual Theorem boundVarElim(const Theorem& t1); 00069 00070 00071 }; 00072 00073 } 00074 00075 #endif