CVC3

TReturn.h

Go to the documentation of this file.
00001 #ifndef TRETURN_H_
00002 #define TRETURN_H_
00003 
00004 #include "LFSCProof.h"
00005 
00006 //////////////////////////////////////////
00007 // TReturn = (p_lfsc, L, c)
00008 // implements transformation
00009 /////////////////////////////////////////
00010 
00011 class TReturn : public LFSCObj
00012 {
00013 private:
00014   RefPtr< LFSCProof > d_lfsc_pf;
00015   // literals (we only store the indices) i corresponds to v_i and -i to  not v_i
00016   std::vector <int> d_L;
00017   // literals we use
00018   std::vector <int> d_L_used;
00019   // constant
00020   Rational d_c;
00021   bool d_hasRt;
00022   // constructor
00023   //flag for whether d_lfsc_pf is proving
00024   //0: psi,
00025   //1: Y(psi)               (arithmetic collapse)
00026   //2: Y2( psi )            (double implications are single implications)
00027   //3: clause( Y2( psi ) )
00028   int d_provesY;
00029   bool lcalced;
00030 public:
00031   TReturn(LFSCProof* lfsc_pf, std::vector<int>& L, std::vector<int>& Lused, Rational r, bool hasR, int pvY);
00032 
00033   Rational mult_rational( TReturn* lhs );
00034   void getL( std::vector< int >& lget, std::vector< int >& lgetu );
00035   bool hasRational() { return d_hasRt; }
00036   Rational getRational() { return d_c; }
00037   LFSCProof* getLFSCProof(){ return d_lfsc_pf.get(); }
00038   int getProvesY() { return d_provesY; }
00039   bool hasFv() { return !d_L_used.empty(); }
00040 #ifdef OPTIMIZE
00041   void calcL( std::vector< int >& lget, std::vector< int >& lgetu );
00042 #endif
00043 
00044   // make it so that the two TReturns agree on what they are proving
00045   // t1 corresponds to the conversion of pf1, proving psi, Y( ps1 ), or Y2( ps1 )
00046   // t2 corresponds to the conversion of pf2, proving psi, Y( ps1 ), or Y2( ps1 )
00047   // on return, t1->d_proveY should equal t2->d_proveY
00048   // this will return the mode they normalized on, -1 means fail
00049   static int normalize_tret( const Expr& pf1, TReturn*& t1, const Expr& pf2, TReturn*& t2, bool rev_pol = false );
00050   //normalize TReturn to prove a certain type
00051   // this will return the mode it normalized on, -1 means fail
00052   static int normalize_tr( const Expr& pf1, TReturn*& t1, int y, bool rev_pol = false, bool printErr = true );
00053   //normalize from polynomial formula to term formula atom
00054   static void normalize_to_tf( const Expr& pf, TReturn*& t1, int y );
00055 };
00056 
00057 #endif