CVC3
|
00001 #ifndef LFSC_PRINTER_H_ 00002 #define LFSC_PRINTER_H_ 00003 00004 #include "TReturn.h" 00005 #include "LFSCConvert.h" 00006 00007 class LFSCPrinter : public LFSCObj{ 00008 private: 00009 //user assumptions 00010 std::vector <Expr> d_user_assumptions; 00011 //the converter object 00012 RefPtr< LFSCConvert > converter; 00013 //count for lets 00014 int let_i; 00015 //common proof rules (need this?) 00016 CommonProofRules* d_common_pf_rules; 00017 //for printing formulas 00018 ExprMap<int> d_print_map; 00019 ExprMap<bool> d_print_visited_map; 00020 //make the expr into possible let's 00021 void make_let_map( const Expr& e ); 00022 //print the polynomial normalization 00023 void print_poly_norm(const Expr& expr, std::ostream& s, bool pnRat = true, bool ratNeg = false ); 00024 void print_terms_h(const Expr& expr,std::ostream& s ); 00025 void print_formula_h(const Expr& clause, std::ostream& s ); 00026 public: 00027 LFSCPrinter(const Expr pf_expr, Expr qExpr, std::vector<Expr> assumps, int lfscm, CommonProofRules* commonRules); 00028 00029 //print the LFSC proof for the cvc3 proof 00030 void print_LFSC(const Expr& pf_expr); 00031 00032 //this is an expression that will be printed 00033 void set_print_expr( const Expr& expr ) { make_let_map( expr ); } 00034 //print expression 00035 void print_expr(const Expr& expr, std::ostream& s){ 00036 if( isFormula( expr ) ) 00037 print_formula( expr, s ); 00038 else 00039 print_terms( expr, s ); 00040 } 00041 //print formula 00042 void print_formula(const Expr& clause, std::ostream& s ){ 00043 //if( clause!=cascade_expr( clause, false ) ) 00044 // cout << "Warning: printing non-cascaded formula " << clause << std::endl; 00045 print_formula_h( cascade_expr( clause ), s ); 00046 } 00047 //print term 00048 void print_terms(const Expr& expr,std::ostream& s ){ 00049 //if( expr!=cascade_expr( expr, false ) ) 00050 // cout << "Warning: printing non-cascaded term " << expr << std::endl; 00051 print_terms_h( cascade_expr( expr ), s ); 00052 } 00053 }; 00054 00055 00056 #endif