00001 /*****************************************************************************/ 00002 /*! 00003 * \file proof.h 00004 * 00005 * Author: Sergey Berezin 00006 * 00007 * Created: Dec 10 00:37:49 GMT 2002 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: Proof 00029 // 00030 // AUTHOR: Sergey Berezin, 12/03/2002 00031 // 00032 // Abstract: 00033 // 00034 // Proof is a wrapper around Expr, to prevent accidental mix-up. Only 00035 // proof rules and adaptors are supposed to use any of its methods. 00036 /////////////////////////////////////////////////////////////////////////////// 00037 #ifndef _CVC_lite__expr_h_ 00038 #include "expr.h" 00039 #endif 00040 00041 #ifndef _CVC_lite__proof_h_ 00042 #define _CVC_lite__proof_h_ 00043 00044 namespace CVCL { 00045 00046 class Proof { 00047 private: 00048 Expr d_proof; 00049 public: 00050 Proof(const Expr &e) : d_proof(e) { } // Constructor 00051 Proof(const Proof& p) : d_proof(p.d_proof) { } // Copy constructor 00052 Proof() : d_proof() { } // Null proof constructor 00053 Expr getExpr() const { return d_proof; } // Extract the expr handle 00054 bool isNull() const { return d_proof.isNull(); } 00055 // Printing 00056 friend std::ostream& operator<<(std::ostream& os, const Proof& pf); 00057 std::string toString() const { 00058 std::ostringstream ss; 00059 ss<<(*this); 00060 return ss.str(); 00061 } 00062 }; // End of class Proof 00063 00064 inline std::ostream& operator<<(std::ostream& os, const Proof& pf) { 00065 return os << "Proof(" << pf.getExpr() << ")"; 00066 } 00067 00068 inline bool operator==(const Proof& pf1, const Proof& pf2) { 00069 return pf1.getExpr() == pf2.getExpr(); 00070 } 00071 00072 }; // end of namespace CVCL 00073 #endif