<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>CVC3: theorem.cpp Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.4 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">CVC3 <span id="projectnumber">2.4.1</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <div class="title">theorem.cpp</div> </div> </div> <div class="contents"> <a href="theorem_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*****************************************************************************/</span><span class="comment"></span> <a name="l00002"></a>00002 <span class="comment">/*!</span> <a name="l00003"></a>00003 <span class="comment"> * \file theorem.cpp</span> <a name="l00004"></a>00004 <span class="comment"> * </span> <a name="l00005"></a>00005 <span class="comment"> * Author: Sergey Berezin</span> <a name="l00006"></a>00006 <span class="comment"> * </span> <a name="l00007"></a>00007 <span class="comment"> * Created: Dec 10 00:37:49 GMT 2002</span> <a name="l00008"></a>00008 <span class="comment"> *</span> <a name="l00009"></a>00009 <span class="comment"> * <hr></span> <a name="l00010"></a>00010 <span class="comment"> *</span> <a name="l00011"></a>00011 <span class="comment"> * License to use, copy, modify, sell and/or distribute this software</span> <a name="l00012"></a>00012 <span class="comment"> * and its documentation for any purpose is hereby granted without</span> <a name="l00013"></a>00013 <span class="comment"> * royalty, subject to the terms and conditions defined in the \ref</span> <a name="l00014"></a>00014 <span class="comment"> * LICENSE file provided with this distribution.</span> <a name="l00015"></a>00015 <span class="comment"> * </span> <a name="l00016"></a>00016 <span class="comment"> * <hr></span> <a name="l00017"></a>00017 <span class="comment"> * </span> <a name="l00018"></a>00018 <span class="comment"> */</span> <a name="l00019"></a>00019 <span class="comment">/*****************************************************************************/</span> <a name="l00020"></a>00020 <span class="comment">// CLASS: Theorem</span> <a name="l00021"></a>00021 <span class="comment">//</span> <a name="l00022"></a>00022 <span class="comment">// AUTHOR: Sergey Berezin, 07/05/02</span> <a name="l00023"></a>00023 <span class="comment">//</span> <a name="l00024"></a>00024 <span class="comment">// See theorem.h file for more information.</span><span class="comment"></span> <a name="l00025"></a>00025 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span> <a name="l00026"></a>00026 <span class="comment"></span> <a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="theorem_8h.html">theorem.h</a>"</span> <a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="theorem__value_8h.html">theorem_value.h</a>"</span> <a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="command__line__flags_8h.html">command_line_flags.h</a>"</span> <a name="l00030"></a>00030 <a name="l00031"></a>00031 <span class="keyword">namespace </span>CVC3 { <a name="l00032"></a>00032 <span class="keyword">using namespace </span>std; <a name="l00033"></a>00033 <span class="comment"></span> <a name="l00034"></a>00034 <span class="comment"> //! Compare Theorems by their expressions. Return -1, 0, or 1.</span> <a name="l00035"></a>00035 <span class="comment"></span><span class="comment"> /*!</span> <a name="l00036"></a>00036 <span class="comment"> * This is an arbitrary total ordering on Theorems. For</span> <a name="l00037"></a>00037 <span class="comment"> * simplicity, we define rewrite theorems (e1 = e2 or e1 <=> e2) to</span> <a name="l00038"></a>00038 <span class="comment"> * be smaller than other theorems.</span> <a name="l00039"></a>00039 <span class="comment"> */</span> <a name="l00040"></a>00040 <span class="comment">/*</span> <a name="l00041"></a>00041 <span class="comment"> int compare(const Theorem& t1, const Theorem& t2) {</span> <a name="l00042"></a>00042 <span class="comment"> return compare(t1.getExpr(), t2.getExpr());</span> <a name="l00043"></a>00043 <span class="comment"> }</span> <a name="l00044"></a>00044 <span class="comment"> */</span> <a name="l00045"></a><a class="code" href="namespaceCVC3.html#af26f4c5293b2c35442c0bf480fc3d826">00045</a> <span class="keywordtype">int</span> <a class="code" href="namespaceCVC3.html#ac06ac2fd4db699104b790f98b7abba71">compare</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>& t1, <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>& t2) { <a name="l00046"></a>00046 <span class="keywordflow">if</span>(t1.<a class="code" href="classCVC3_1_1Theorem.html#a696e2281069af317ec3fb6510845ca6c">d_thm</a> == t2.<a class="code" href="classCVC3_1_1Theorem.html#a696e2281069af317ec3fb6510845ca6c">d_thm</a>) <span class="keywordflow">return</span> 0; <a name="l00047"></a>00047 <span class="keywordflow">if</span>(t1.<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>()) <span class="keywordflow">return</span> -1; <span class="comment">// Null Theorem is less than other theorems</span> <a name="l00048"></a>00048 <span class="keywordflow">if</span>(t2.<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>()) <span class="keywordflow">return</span> 1; <a name="l00049"></a>00049 <a name="l00050"></a>00050 <span class="keywordtype">bool</span> rw1(t1.<a class="code" href="classCVC3_1_1Theorem.html#a362c1d70e03803d804bbe300e5f6dc87">isRewrite</a>()), rw2(t2.<a class="code" href="classCVC3_1_1Theorem.html#a362c1d70e03803d804bbe300e5f6dc87">isRewrite</a>()); <a name="l00051"></a>00051 <a name="l00052"></a>00052 <span class="keywordflow">if</span>(!rw2) <span class="keywordflow">return</span> <a class="code" href="namespaceCVC3.html#ac06ac2fd4db699104b790f98b7abba71">compare</a>(t1, t2.<a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>()); <a name="l00053"></a>00053 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(!rw1) <span class="keywordflow">return</span> -<a class="code" href="namespaceCVC3.html#ac06ac2fd4db699104b790f98b7abba71">compare</a>(t2, t1.<a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>()); <a name="l00054"></a>00054 <span class="keywordflow">else</span> { <a name="l00055"></a>00055 <span class="keywordtype">int</span> res(<a class="code" href="namespaceCVC3.html#ac06ac2fd4db699104b790f98b7abba71">compare</a>(t1.<a class="code" href="classCVC3_1_1Theorem.html#a206c04f39fbbcacef2337148675553f4">getLHS</a>(), t2.<a class="code" href="classCVC3_1_1Theorem.html#a206c04f39fbbcacef2337148675553f4">getLHS</a>())); <a name="l00056"></a>00056 <span class="keywordflow">if</span>(res==0) res = <a class="code" href="namespaceCVC3.html#ac06ac2fd4db699104b790f98b7abba71">compare</a>(t1.<a class="code" href="classCVC3_1_1Theorem.html#a97d957fcbf9094480851b1d2e5d3729f">getRHS</a>(), t2.<a class="code" href="classCVC3_1_1Theorem.html#a97d957fcbf9094480851b1d2e5d3729f">getRHS</a>()); <a name="l00057"></a>00057 <span class="keywordflow">return</span> res; <a name="l00058"></a>00058 } <a name="l00059"></a>00059 } <a name="l00060"></a>00060 <span class="comment">/*</span> <a name="l00061"></a>00061 <span class="comment"> int compare(const Theorem& t1, const Expr& e2) {</span> <a name="l00062"></a>00062 <span class="comment"> return compare(t1.getExpr(), e2);</span> <a name="l00063"></a>00063 <span class="comment"> }</span> <a name="l00064"></a>00064 <span class="comment"> */</span> <a name="l00065"></a><a class="code" href="namespaceCVC3.html#aca9ad03bfd5d26fba6d03718bcb49869">00065</a> <span class="keywordtype">int</span> <a class="code" href="namespaceCVC3.html#ac06ac2fd4db699104b790f98b7abba71">compare</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>& t1, <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& e2) { <a name="l00066"></a>00066 <span class="keywordtype">bool</span> rw1(t1.<a class="code" href="classCVC3_1_1Theorem.html#a362c1d70e03803d804bbe300e5f6dc87">isRewrite</a>()), rw2(e2.<a class="code" href="group__ExprPkg.html#gac4af2026c180da0f18d66ac616f61f3a">isEq</a>() || e2.<a class="code" href="group__ExprPkg.html#gabe385fb97505cccb75702378511c5375">isIff</a>()); <a name="l00067"></a>00067 <span class="keywordflow">if</span>(!rw1) { <a name="l00068"></a>00068 <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& e1 = t1.<a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>(); <a name="l00069"></a>00069 rw1 = (e1.<a class="code" href="group__ExprPkg.html#gac4af2026c180da0f18d66ac616f61f3a">isEq</a>() || e1.<a class="code" href="group__ExprPkg.html#gabe385fb97505cccb75702378511c5375">isIff</a>()); <a name="l00070"></a>00070 } <a name="l00071"></a>00071 <span class="keywordflow">if</span>(rw1) { <a name="l00072"></a>00072 <span class="keywordflow">if</span>(rw2) { <a name="l00073"></a>00073 <span class="keywordtype">int</span> res(<a class="code" href="namespaceCVC3.html#ac06ac2fd4db699104b790f98b7abba71">compare</a>(t1.<a class="code" href="classCVC3_1_1Theorem.html#a206c04f39fbbcacef2337148675553f4">getLHS</a>(), e2[0])); <a name="l00074"></a>00074 <span class="keywordflow">if</span>(res==0) res = <a class="code" href="namespaceCVC3.html#ac06ac2fd4db699104b790f98b7abba71">compare</a>(t1.<a class="code" href="classCVC3_1_1Theorem.html#a97d957fcbf9094480851b1d2e5d3729f">getRHS</a>(), e2[1]); <a name="l00075"></a>00075 <span class="keywordflow">return</span> res; <a name="l00076"></a>00076 } <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1; <a name="l00077"></a>00077 } <span class="keywordflow">else</span> { <a name="l00078"></a>00078 <span class="keywordflow">if</span>(rw2) <span class="keywordflow">return</span> 1; <a name="l00079"></a>00079 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <a class="code" href="namespaceCVC3.html#ac06ac2fd4db699104b790f98b7abba71">compare</a>(t1.<a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>(), e2); <a name="l00080"></a>00080 } <a name="l00081"></a>00081 } <a name="l00082"></a>00082 <a name="l00083"></a><a class="code" href="namespaceCVC3.html#af87b5038044e2f5706e30e5ed6f7584e">00083</a> <span class="keywordtype">int</span> <a class="code" href="namespaceCVC3.html#af87b5038044e2f5706e30e5ed6f7584e">compareByPtr</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>& t1, <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>& t2) { <a name="l00084"></a>00084 <span class="keywordflow">if</span>(t1.<a class="code" href="classCVC3_1_1Theorem.html#a696e2281069af317ec3fb6510845ca6c">d_thm</a> == t2.<a class="code" href="classCVC3_1_1Theorem.html#a696e2281069af317ec3fb6510845ca6c">d_thm</a>) <span class="keywordflow">return</span> 0; <a name="l00085"></a>00085 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(t1.<a class="code" href="classCVC3_1_1Theorem.html#a696e2281069af317ec3fb6510845ca6c">d_thm</a> < t2.<a class="code" href="classCVC3_1_1Theorem.html#a696e2281069af317ec3fb6510845ca6c">d_thm</a>) <span class="keywordflow">return</span> -1; <a name="l00086"></a>00086 <span class="keywordflow">else</span> <span class="keywordflow">return</span> 1; <a name="l00087"></a>00087 } <a name="l00088"></a>00088 <a name="l00089"></a>00089 <a name="l00090"></a>00090 <span class="comment">// Assignment operator</span> <a name="l00091"></a><a class="code" href="classCVC3_1_1Theorem.html#adacab84dc4dc38aeb12ddabcb3c4a51d">00091</a> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>& <a class="code" href="classCVC3_1_1Theorem.html#adacab84dc4dc38aeb12ddabcb3c4a51d">Theorem::operator=</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>& th) { <a name="l00092"></a>00092 <span class="comment">// Handle self-assignment</span> <a name="l00093"></a>00093 <span class="keywordflow">if</span>(<span class="keyword">this</span> == &th) <span class="keywordflow">return</span> *<span class="keyword">this</span>; <a name="l00094"></a>00094 <span class="keywordflow">if</span>(d_thm == th.<a class="code" href="classCVC3_1_1Theorem.html#a696e2281069af317ec3fb6510845ca6c">d_thm</a>) <span class="keywordflow">return</span> *<span class="keyword">this</span>; <a name="l00095"></a>00095 <a name="l00096"></a>00096 <span class="keywordtype">long</span> tmp = th.<a class="code" href="classCVC3_1_1Theorem.html#a696e2281069af317ec3fb6510845ca6c">d_thm</a>; <a name="l00097"></a>00097 <a name="l00098"></a>00098 <span class="comment">// Increase the refcount on th</span> <a name="l00099"></a>00099 <span class="keywordflow">if</span> (tmp & 0x1) { <a name="l00100"></a>00100 <a class="code" href="classCVC3_1_1TheoremValue.html">TheoremValue</a>* tv = (<a class="code" href="classCVC3_1_1TheoremValue.html">TheoremValue</a>*) (tmp & (~(0x1))); <a name="l00101"></a>00101 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(tv-><a class="code" href="classCVC3_1_1TheoremValue.html#a138c67c7a778d8e0d525a658439f105c" title="How many pointers to this theorem value.">d_refcount</a> > 0, <a name="l00102"></a>00102 <span class="stringliteral">"Theorem::operator=: invariant violated"</span>); <a name="l00103"></a>00103 ++(tv-><a class="code" href="classCVC3_1_1TheoremValue.html#a138c67c7a778d8e0d525a658439f105c" title="How many pointers to this theorem value.">d_refcount</a>); <a name="l00104"></a>00104 } <a name="l00105"></a>00105 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (tmp != 0) { <a name="l00106"></a>00106 th.<a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()-><a class="code" href="classCVC3_1_1ExprValue.html#a0547e925398643e7779baf97d324e32e" title="Increment reference counter.">incRefcount</a>(); <a name="l00107"></a>00107 } <a name="l00108"></a>00108 <a name="l00109"></a>00109 <span class="comment">// Decrease the refcount on this</span> <a name="l00110"></a>00110 <span class="keywordflow">if</span> (d_thm & 0x1) { <a name="l00111"></a>00111 <a class="code" href="classCVC3_1_1TheoremValue.html">TheoremValue</a>* tv = thm(); <a name="l00112"></a>00112 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(tv-><a class="code" href="classCVC3_1_1TheoremValue.html#a138c67c7a778d8e0d525a658439f105c" title="How many pointers to this theorem value.">d_refcount</a> > 0, <a name="l00113"></a>00113 <span class="stringliteral">"Theorem::operator=: invariant violated"</span>); <a name="l00114"></a>00114 <span class="keywordflow">if</span>(--(tv-><a class="code" href="classCVC3_1_1TheoremValue.html#a138c67c7a778d8e0d525a658439f105c" title="How many pointers to this theorem value.">d_refcount</a>) == 0) { <a name="l00115"></a>00115 <a class="code" href="classCVC3_1_1MemoryManager.html">MemoryManager</a>* mm = tv-><a class="code" href="classCVC3_1_1TheoremValue.html#af8bf999e469afe124c04bfbbb6aba1e2">getMM</a>(); <a name="l00116"></a>00116 <span class="keyword">delete</span> tv; <a name="l00117"></a>00117 mm-><a class="code" href="classCVC3_1_1MemoryManager.html#ad29fac88d3a07566d9a8f9dc8d8e059c">deleteData</a>(tv); <a name="l00118"></a>00118 } <a name="l00119"></a>00119 } <a name="l00120"></a>00120 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (d_thm != 0) { <a name="l00121"></a>00121 exprValue()->decRefcount(); <a name="l00122"></a>00122 } <a name="l00123"></a>00123 <a name="l00124"></a>00124 d_thm = tmp; <a name="l00125"></a>00125 <a name="l00126"></a>00126 <span class="keywordflow">return</span> *<span class="keyword">this</span>; <a name="l00127"></a>00127 } <a name="l00128"></a>00128 <a name="l00129"></a>00129 <a name="l00130"></a>00130 <span class="comment">// Constructors</span> <a name="l00131"></a><a class="code" href="classCVC3_1_1Theorem.html#ae7e657235650f951a2e61affb3a55ef2">00131</a> <a class="code" href="classCVC3_1_1Theorem.html#a4b7574a16eed728fac6e37d2404fdbf8">Theorem::Theorem</a>(<a class="code" href="classCVC3_1_1TheoremManager.html">TheoremManager</a>* tm, <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> &thm, <a name="l00132"></a>00132 <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Assumptions.html">Assumptions</a>& assump, <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Proof.html">Proof</a>& pf, <a name="l00133"></a>00133 <span class="keywordtype">bool</span> isAssump, <span class="keywordtype">int</span> scope) { <a name="l00134"></a>00134 <a class="code" href="classCVC3_1_1TheoremValue.html">TheoremValue</a>* tv; <a name="l00135"></a>00135 <span class="keywordflow">if</span> (thm.<a class="code" href="group__ExprPkg.html#gac4af2026c180da0f18d66ac616f61f3a">isEq</a>() || thm.<a class="code" href="group__ExprPkg.html#gabe385fb97505cccb75702378511c5375">isIff</a>()) { <a name="l00136"></a>00136 <span class="keywordflow">if</span> (thm[0] == thm[1]) { <a name="l00137"></a>00137 d_expr = thm[0].<a class="code" href="group__ExprPkg.html#ga3a08bea4e8715a268083e1671e340a2e">d_expr</a>; <a name="l00138"></a>00138 d_expr-><a class="code" href="classCVC3_1_1ExprValue.html#a0547e925398643e7779baf97d324e32e" title="Increment reference counter.">incRefcount</a>(); <a name="l00139"></a>00139 <span class="keywordflow">return</span>; <a name="l00140"></a>00140 } <a name="l00141"></a>00141 tv = <span class="keyword">new</span>(tm-><a class="code" href="classCVC3_1_1TheoremManager.html#a1ab310c8d6cfd68063379902b371a924">getRWMM</a>()) <a class="code" href="classCVC3_1_1RWTheoremValue.html">RWTheoremValue</a>(tm, thm, assump, pf, isAssump, scope); <a name="l00142"></a>00142 } <a name="l00143"></a>00143 <span class="keywordflow">else</span> <a name="l00144"></a>00144 tv = <span class="keyword">new</span>(tm-><a class="code" href="classCVC3_1_1TheoremManager.html#a62b8cd3f917ca0fb580dde6c483db361">getMM</a>()) <a class="code" href="classCVC3_1_1RegTheoremValue.html">RegTheoremValue</a>(tm, thm, assump, pf, isAssump, scope); <a name="l00145"></a>00145 tv-><a class="code" href="classCVC3_1_1TheoremValue.html#a138c67c7a778d8e0d525a658439f105c" title="How many pointers to this theorem value.">d_refcount</a>++; <a name="l00146"></a>00146 d_thm = ((intptr_t)tv)|0x1; <a name="l00147"></a>00147 <span class="comment">// TRACE("theorem", "Theorem(e) => ", *this, "");</span> <a name="l00148"></a>00148 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!withProof() || !pf.<a class="code" href="classCVC3_1_1Proof.html#a24acb4848153feb8b0c88eb825b92046">isNull</a>(), <a name="l00149"></a>00149 <span class="stringliteral">"Null proof in theorem:\n"</span>+toString()); <a name="l00150"></a>00150 } <a name="l00151"></a>00151 <a name="l00152"></a><a class="code" href="classCVC3_1_1Theorem.html#a1e1b1005316fefef5d78a7c4d3ae6060">00152</a> <a class="code" href="classCVC3_1_1Theorem.html#a4b7574a16eed728fac6e37d2404fdbf8">Theorem::Theorem</a>(<a class="code" href="classCVC3_1_1TheoremManager.html">TheoremManager</a>* tm, <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& lhs, <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& rhs, <a name="l00153"></a>00153 <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Assumptions.html">Assumptions</a>& assump, <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Proof.html">Proof</a>& pf, <span class="keywordtype">bool</span> isAssump, <a name="l00154"></a>00154 <span class="keywordtype">int</span> scope) { <a name="l00155"></a>00155 <span class="keywordflow">if</span> (lhs == rhs) { <a name="l00156"></a>00156 d_expr = lhs.<a class="code" href="group__ExprPkg.html#ga3a08bea4e8715a268083e1671e340a2e">d_expr</a>; <a name="l00157"></a>00157 d_expr-><a class="code" href="classCVC3_1_1ExprValue.html#a0547e925398643e7779baf97d324e32e" title="Increment reference counter.">incRefcount</a>(); <a name="l00158"></a>00158 <span class="keywordflow">return</span>; <a name="l00159"></a>00159 } <a name="l00160"></a>00160 <a class="code" href="classCVC3_1_1TheoremValue.html">TheoremValue</a>* tv = <span class="keyword">new</span>(tm-><a class="code" href="classCVC3_1_1TheoremManager.html#a1ab310c8d6cfd68063379902b371a924">getRWMM</a>()) <a name="l00161"></a>00161 <a class="code" href="classCVC3_1_1RWTheoremValue.html">RWTheoremValue</a>(tm, lhs, rhs, assump, pf, isAssump, scope); <a name="l00162"></a>00162 tv-><a class="code" href="classCVC3_1_1TheoremValue.html#a138c67c7a778d8e0d525a658439f105c" title="How many pointers to this theorem value.">d_refcount</a>++; <a name="l00163"></a>00163 d_thm = ((long)tv)|0x1; <a name="l00164"></a>00164 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!withProof() || !pf.<a class="code" href="classCVC3_1_1Proof.html#a24acb4848153feb8b0c88eb825b92046">isNull</a>(), <a name="l00165"></a>00165 <span class="stringliteral">"Null proof in theorem:\n"</span>+toString()); <a name="l00166"></a>00166 } <a name="l00167"></a>00167 <a name="l00168"></a>00168 <a name="l00169"></a>00169 <span class="comment">// Copy constructor</span> <a name="l00170"></a><a class="code" href="classCVC3_1_1Theorem.html#a43974f559b8faa8db89d81993e911881">00170</a> <a class="code" href="classCVC3_1_1Theorem.html#a4b7574a16eed728fac6e37d2404fdbf8">Theorem::Theorem</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> &th) : d_thm(th.d_thm) { <a name="l00171"></a>00171 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a696e2281069af317ec3fb6510845ca6c">d_thm</a> & 0x1) { <a name="l00172"></a>00172 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(<a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()->d_refcount > 0, <a name="l00173"></a>00173 <span class="stringliteral">"Theorem(const Theorem&): refcount = "</span> <a name="l00174"></a>00174 + <a class="code" href="namespaceCVC3.html#af69618103f1f0f2eadada0796a2a940c">int2string</a>(<a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()->d_refcount)); <a name="l00175"></a>00175 <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a138c67c7a778d8e0d525a658439f105c" title="How many pointers to this theorem value.">d_refcount</a>++; <a name="l00176"></a>00176 <span class="comment">// TRACE("theorem", "Theorem(Theorem&) => ", *this, "");</span> <a name="l00177"></a>00177 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a696e2281069af317ec3fb6510845ca6c">d_thm</a> != 0) { <a name="l00178"></a>00178 <a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()-><a class="code" href="classCVC3_1_1ExprValue.html#a0547e925398643e7779baf97d324e32e" title="Increment reference counter.">incRefcount</a>(); <a name="l00179"></a>00179 } <a name="l00180"></a>00180 } <a name="l00181"></a>00181 <a name="l00182"></a><a class="code" href="classCVC3_1_1Theorem.html#ab27afa1904c73f44a38dae8945749a6a">00182</a> <a class="code" href="classCVC3_1_1Theorem.html#a4b7574a16eed728fac6e37d2404fdbf8">Theorem::Theorem</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& e) : d_expr(e.d_expr) <a name="l00183"></a>00183 { <a name="l00184"></a>00184 <a class="code" href="classCVC3_1_1Theorem.html#a798f8085ec077b69aae198a155077774">d_expr</a>-><a class="code" href="classCVC3_1_1ExprValue.html#a0547e925398643e7779baf97d324e32e" title="Increment reference counter.">incRefcount</a>(); <a name="l00185"></a>00185 } <a name="l00186"></a>00186 <a name="l00187"></a>00187 <span class="comment">// Destructor</span> <a name="l00188"></a><a class="code" href="classCVC3_1_1Theorem.html#ad72ac2b7be75f1b2848e9d6199c01c83">00188</a> <a class="code" href="classCVC3_1_1Theorem.html#ad72ac2b7be75f1b2848e9d6199c01c83">Theorem::~Theorem</a>() { <a name="l00189"></a>00189 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a696e2281069af317ec3fb6510845ca6c">d_thm</a> & 0x1) { <a name="l00190"></a>00190 <a class="code" href="classCVC3_1_1TheoremValue.html">TheoremValue</a>* tv = <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>(); <a name="l00191"></a>00191 <span class="comment">// TRACE("theorem", "~Theorem(", *this, ") {");</span> <a name="l00192"></a>00192 <a class="code" href="debug_8h.html#a600cb2d68efe7cc413cccbb5714c7016">IF_DEBUG</a>(<a class="code" href="debug_8h.html#a2637b2fffa22e3c9fad40cda8fcc3bce" title="If something goes horribly wrong, print a message and abort immediately with exit(1).">FatalAssert</a>(tv-><a class="code" href="classCVC3_1_1TheoremValue.html#a138c67c7a778d8e0d525a658439f105c" title="How many pointers to this theorem value.">d_refcount</a> > 0, <a name="l00193"></a>00193 <span class="stringliteral">"~Theorem(): refcount = "</span> <a name="l00194"></a>00194 + <a class="code" href="namespaceCVC3.html#af69618103f1f0f2eadada0796a2a940c">int2string</a>(tv-><a class="code" href="classCVC3_1_1TheoremValue.html#a138c67c7a778d8e0d525a658439f105c" title="How many pointers to this theorem value.">d_refcount</a>));) <a name="l00195"></a>00195 <span class="keywordflow">if</span>((--tv-><a class="code" href="classCVC3_1_1TheoremValue.html#a138c67c7a778d8e0d525a658439f105c" title="How many pointers to this theorem value.">d_refcount</a>) == 0) { <a name="l00196"></a>00196 <span class="comment">// TRACE_MSG("theorem", "~Theorem(): deleting");</span> <a name="l00197"></a>00197 <a class="code" href="classCVC3_1_1MemoryManager.html">MemoryManager</a>* mm = tv-><a class="code" href="classCVC3_1_1TheoremValue.html#af8bf999e469afe124c04bfbbb6aba1e2">getMM</a>(); <a name="l00198"></a>00198 <span class="keyword">delete</span> tv; <a name="l00199"></a>00199 mm-><a class="code" href="classCVC3_1_1MemoryManager.html#ad29fac88d3a07566d9a8f9dc8d8e059c">deleteData</a>(tv); <a name="l00200"></a>00200 } <a name="l00201"></a>00201 } <a name="l00202"></a>00202 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a696e2281069af317ec3fb6510845ca6c">d_thm</a> != 0) { <a name="l00203"></a>00203 <a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()-><a class="code" href="classCVC3_1_1ExprValue.html#a8d62c9c4397548013dc302147903756e" title="Decrement reference counter.">decRefcount</a>(); <a name="l00204"></a>00204 } <a name="l00205"></a>00205 } <a name="l00206"></a>00206 <a name="l00207"></a><a class="code" href="classCVC3_1_1Theorem.html#aeb41e125749338e05d680beca6df9ee4">00207</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#aeb41e125749338e05d680beca6df9ee4">Theorem::printx</a>()<span class="keyword"> const </span>{ <a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>().<a class="code" href="group__ExprPkg.html#ga76180628bc1561af88e41be586973fac" title="Print the expression in the specified format.">print</a>(); } <a name="l00208"></a><a class="code" href="classCVC3_1_1Theorem.html#a44f518efb0307d256450628cbc6085d2">00208</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#a44f518efb0307d256450628cbc6085d2">Theorem::printxnodag</a>()<span class="keyword"> const </span>{ <a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>().<a class="code" href="group__ExprPkg.html#ga974964d4dba5b50f35ee03e2418e7fe9" title="Print the expression as AST without dagifying.">printnodag</a>(); } <a name="l00209"></a><a class="code" href="classCVC3_1_1Theorem.html#ab188a2869b745cb0d5f0e1f0d9081dfa">00209</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#ab188a2869b745cb0d5f0e1f0d9081dfa">Theorem::pprintx</a>()<span class="keyword"> const </span>{ <a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>().<a class="code" href="group__ExprPkg.html#ga3aa47bf8af3f2c88b8bc27e0cd07554e" title="Pretty-print the expression.">pprint</a>(); } <a name="l00210"></a><a class="code" href="classCVC3_1_1Theorem.html#a2ccfcbaed17e735e3e008900d5a06e78">00210</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#a2ccfcbaed17e735e3e008900d5a06e78">Theorem::pprintxnodag</a>()<span class="keyword"> const </span>{ <a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>().<a class="code" href="group__ExprPkg.html#ga010ae48d41f33790c6b9bb10829105e3" title="Pretty-print without dagifying.">pprintnodag</a>(); } <a name="l00211"></a><a class="code" href="classCVC3_1_1Theorem.html#af412e1fca4a31f24a63c948f85c18358">00211</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#af412e1fca4a31f24a63c948f85c18358">Theorem::print</a>()<span class="keyword"> const </span>{ cout << <a class="code" href="classCVC3_1_1Theorem.html#ac4b1c9570ffb9cc901627ef2abb9ff77">toString</a>() << <a class="code" href="group__ExprStream__Manip.html#ga05b0ea7353ec24fa8e7e272d7a7875d8" title="Print the end-of-line.">endl</a>; } <a name="l00212"></a>00212 <a name="l00213"></a>00213 <span class="comment">// Test if we are running in a proof production mode and with assumptions</span> <a name="l00214"></a><a class="code" href="classCVC3_1_1Theorem.html#ad4573ca6be017cab3c83d28c2dbcebd8">00214</a> <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1Theorem.html#ad4573ca6be017cab3c83d28c2dbcebd8">Theorem::withProof</a>()<span class="keyword"> const </span>{ <a name="l00215"></a>00215 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()-><a class="code" href="classCVC3_1_1ExprValue.html#ae0b397b57244e8e5bb59cb95641b14d0" title="Our expr. manager.">d_em</a>-><a class="code" href="group__EM__Priv.html#ga4aa1269ec9df849a4b7654742408d2ca" title="Fetch the TheoremManager.">getTM</a>()-><a class="code" href="classCVC3_1_1TheoremManager.html#a462f27eb0eca420b334354a9ddc7a257">withProof</a>(); <a name="l00216"></a>00216 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#af0167eefead6921ed3919808bc0f9845" title="Theorem Manager.">d_tm</a>-><a class="code" href="classCVC3_1_1TheoremManager.html#a462f27eb0eca420b334354a9ddc7a257">withProof</a>(); <a name="l00217"></a>00217 } <a name="l00218"></a>00218 <a name="l00219"></a><a class="code" href="classCVC3_1_1Theorem.html#a90349125fe644e8a075e1a47a49872c7">00219</a> <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1Theorem.html#a90349125fe644e8a075e1a47a49872c7">Theorem::withAssumptions</a>()<span class="keyword"> const </span>{ <a name="l00220"></a>00220 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()-><a class="code" href="classCVC3_1_1ExprValue.html#ae0b397b57244e8e5bb59cb95641b14d0" title="Our expr. manager.">d_em</a>-><a class="code" href="group__EM__Priv.html#ga4aa1269ec9df849a4b7654742408d2ca" title="Fetch the TheoremManager.">getTM</a>()-><a class="code" href="classCVC3_1_1TheoremManager.html#a0a4f7d2aac078ca32b1dacb5d0af25c4">withAssumptions</a>(); <a name="l00221"></a>00221 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#af0167eefead6921ed3919808bc0f9845" title="Theorem Manager.">d_tm</a>-><a class="code" href="classCVC3_1_1TheoremManager.html#a0a4f7d2aac078ca32b1dacb5d0af25c4">withAssumptions</a>(); <a name="l00222"></a>00222 } <a name="l00223"></a>00223 <a name="l00224"></a><a class="code" href="classCVC3_1_1Theorem.html#a362c1d70e03803d804bbe300e5f6dc87">00224</a> <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1Theorem.html#a362c1d70e03803d804bbe300e5f6dc87">Theorem::isRewrite</a>()<span class="keyword"> const </span>{ <a name="l00225"></a>00225 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::isRewrite(): we are Null"</span>); <a name="l00226"></a>00226 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>() || <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a123ac5cf8dde8d8ba3ca7d47a7d9bfde">isRewrite</a>(); <a name="l00227"></a>00227 } <a name="l00228"></a>00228 <a name="l00229"></a>00229 <span class="comment">// Return the theorem value as an Expr</span> <a name="l00230"></a><a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">00230</a> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> <a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">Theorem::getExpr</a>()<span class="keyword"> const </span>{ <a name="l00231"></a>00231 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::getExpr(): we are Null"</span>); <a name="l00232"></a>00232 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) { <a name="l00233"></a>00233 <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> e(<a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()); <a name="l00234"></a>00234 <span class="keywordflow">if</span> (e.<a class="code" href="group__ExprPkg.html#gad527acb49daef3591b78c748746e7eef" title="Test if e is a term (as opposed to a predicate/formula)">isTerm</a>()) <span class="keywordflow">return</span> e.<a class="code" href="group__ExprPkg.html#gacb48495ca445c895f95d0c3c1ae2070b">eqExpr</a>(e); <a name="l00235"></a>00235 <span class="keywordflow">else</span> <span class="keywordflow">return</span> e.<a class="code" href="group__ExprPkg.html#gaae017ca8e68af655ba285c985dd9fba5">iffExpr</a>(e); <a name="l00236"></a>00236 } <a name="l00237"></a>00237 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#ada6a2145dda62e6d3bd6781c7ef96141">getExpr</a>(); <a name="l00238"></a>00238 } <a name="l00239"></a>00239 <a name="l00240"></a><a class="code" href="classCVC3_1_1Theorem.html#a206c04f39fbbcacef2337148675553f4">00240</a> <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& <a class="code" href="classCVC3_1_1Theorem.html#a206c04f39fbbcacef2337148675553f4">Theorem::getLHS</a>()<span class="keyword"> const </span>{ <a name="l00241"></a>00241 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::getLHS: we are Null"</span>); <a name="l00242"></a>00242 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <span class="keywordflow">return</span> *((<a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>*)(&<a class="code" href="classCVC3_1_1Theorem.html#a798f8085ec077b69aae198a155077774">d_expr</a>)); <a name="l00243"></a>00243 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a183c518edb1e346997882c5cce931fa3">getLHS</a>(); <a name="l00244"></a>00244 } <a name="l00245"></a>00245 <a name="l00246"></a><a class="code" href="classCVC3_1_1Theorem.html#a97d957fcbf9094480851b1d2e5d3729f">00246</a> <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& <a class="code" href="classCVC3_1_1Theorem.html#a97d957fcbf9094480851b1d2e5d3729f">Theorem::getRHS</a>()<span class="keyword"> const </span>{ <a name="l00247"></a>00247 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::getRHS: we are Null"</span>); <a name="l00248"></a>00248 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <span class="keywordflow">return</span> *((<a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>*)(&<a class="code" href="classCVC3_1_1Theorem.html#a798f8085ec077b69aae198a155077774">d_expr</a>)); <a name="l00249"></a>00249 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#ae28c3198351296f187065e78bba73a1f">getRHS</a>(); <a name="l00250"></a>00250 } <a name="l00251"></a>00251 <a name="l00252"></a>00252 <span class="comment">// Return the assumptions.</span> <a name="l00253"></a>00253 <span class="comment">// void Theorem::getAssumptions(Assumptions& a) const</span> <a name="l00254"></a>00254 <span class="comment">// {</span> <a name="l00255"></a>00255 <span class="comment">// a = getAssumptionsRef();</span> <a name="l00256"></a>00256 <span class="comment">// }</span> <a name="l00257"></a>00257 <a name="l00258"></a>00258 <a name="l00259"></a><a class="code" href="classCVC3_1_1Theorem.html#ab3e8c740e4da0bd7ae74754ef25af049">00259</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#ab3e8c740e4da0bd7ae74754ef25af049">Theorem::getAssumptionsRec</a>(set<Expr>& assumptions)<span class="keyword"> const</span> <a name="l00260"></a>00260 <span class="keyword"></span>{ <a name="l00261"></a>00261 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>() || <a class="code" href="classCVC3_1_1Theorem.html#a1695c9afc9a5c1f8cd000d40b9e2a9cd" title="Check if the flag attribute is set.">isFlagged</a>()) <span class="keywordflow">return</span>; <a name="l00262"></a>00262 <a class="code" href="classCVC3_1_1Theorem.html#af83d6b4d71bfb558296a1c296a69c3d7" title="Set the flag attribute.">setFlag</a>(); <a name="l00263"></a>00263 <span class="keywordflow">if</span>(<a class="code" href="classCVC3_1_1Theorem.html#a05282db6832afb4f198d8c6b2b67aeb1">isAssump</a>()) { <a name="l00264"></a>00264 assumptions.insert(<a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>()); <a name="l00265"></a>00265 } <a name="l00266"></a>00266 <span class="keywordflow">else</span> { <a name="l00267"></a>00267 <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Assumptions.html">Assumptions</a>& a = <a class="code" href="classCVC3_1_1Theorem.html#a5e9ab00a613df15cc02f55edb55a67b3">getAssumptionsRef</a>(); <a name="l00268"></a>00268 <span class="keywordflow">for</span>(<a class="code" href="classCVC3_1_1Assumptions_1_1iterator.html" title="Iterator for the Assumptions: points to class Theorem.">Assumptions::iterator</a> i=a.<a class="code" href="classCVC3_1_1Assumptions.html#ac3e7d0e1796c83edf687aac063bdba06">begin</a>(), iend=a.<a class="code" href="classCVC3_1_1Assumptions.html#afc875bbe97e4e2d74a2cdc824f783bfb">end</a>(); i!=iend; ++i) <a name="l00269"></a>00269 (*i).getAssumptionsRec(assumptions); <a name="l00270"></a>00270 } <a name="l00271"></a>00271 } <a name="l00272"></a>00272 <a name="l00273"></a>00273 <a name="l00274"></a><a class="code" href="classCVC3_1_1Theorem.html#a524b4dafa4fb8f14742baa856612d92b">00274</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#a524b4dafa4fb8f14742baa856612d92b">Theorem::getLeafAssumptions</a>(vector<Expr>& assumptions, <a name="l00275"></a>00275 <span class="keywordtype">bool</span> negate)<span class="keyword"> const</span> <a name="l00276"></a>00276 <span class="keyword"></span>{ <a name="l00277"></a>00277 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>() || <a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <span class="keywordflow">return</span>; <a name="l00278"></a>00278 set<Expr> assumpSet; <a name="l00279"></a>00279 <a class="code" href="classCVC3_1_1Theorem.html#a621ab2150eedc0e3b38d34275ac206cd" title="Clear the flag attribute in all the theorems.">clearAllFlags</a>(); <a name="l00280"></a>00280 <a class="code" href="classCVC3_1_1Theorem.html#ab3e8c740e4da0bd7ae74754ef25af049">getAssumptionsRec</a>(assumpSet); <a name="l00281"></a>00281 <span class="comment">// Order assumptions by their creation time</span> <a name="l00282"></a>00282 <span class="keywordflow">for</span>(set<Expr>::iterator i=assumpSet.begin(), iend=assumpSet.end(); <a name="l00283"></a>00283 i!=iend; ++i) <a name="l00284"></a>00284 assumptions.push_back(negate ? (*i).negate() : *i); <a name="l00285"></a>00285 } <a name="l00286"></a>00286 <a name="l00287"></a>00287 <a name="l00288"></a><a class="code" href="classCVC3_1_1Theorem.html#adf7fd8a76fe1052914bc88ed3a303660">00288</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#adf7fd8a76fe1052914bc88ed3a303660">Theorem::GetSatAssumptionsRec</a>(vector<Theorem>& assumptions)<span class="keyword"> const</span> <a name="l00289"></a>00289 <span class="keyword"></span>{ <a name="l00290"></a>00290 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>() && !<a class="code" href="classCVC3_1_1Theorem.html#a1695c9afc9a5c1f8cd000d40b9e2a9cd" title="Check if the flag attribute is set.">isFlagged</a>(), <span class="stringliteral">"Invariant violated"</span>); <a name="l00291"></a>00291 <a class="code" href="classCVC3_1_1Theorem.html#af83d6b4d71bfb558296a1c296a69c3d7" title="Set the flag attribute.">setFlag</a>(); <a name="l00292"></a>00292 <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> e = <a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>(); <a name="l00293"></a>00293 <span class="keywordflow">if</span> (e.<a class="code" href="group__ExprPkg.html#gaac535dae48f02fcd093a5b1b1a062211" title="Test if e is an abstract literal.">isAbsLiteral</a>()) { <a name="l00294"></a>00294 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a05282db6832afb4f198d8c6b2b67aeb1">isAssump</a>() || <a name="l00295"></a>00295 e.<a class="code" href="group__ExprPkg.html#ga8b55ff94d7f47d1166350cf308f2dd09">isRegisteredAtom</a>() || <a name="l00296"></a>00296 (e.<a class="code" href="group__ExprPkg.html#ga1a898858ccadce833df5a294c7740f11">isNot</a>() && e[0].<a class="code" href="group__ExprPkg.html#ga8b55ff94d7f47d1166350cf308f2dd09">isRegisteredAtom</a>())) { <a name="l00297"></a>00297 assumptions.push_back(*<span class="keyword">this</span>); <a name="l00298"></a>00298 <span class="keywordflow">return</span>; <a name="l00299"></a>00299 } <a name="l00300"></a>00300 } <a name="l00301"></a>00301 <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Assumptions.html">Assumptions</a>& a = <a class="code" href="classCVC3_1_1Theorem.html#a5e9ab00a613df15cc02f55edb55a67b3">getAssumptionsRef</a>(); <a name="l00302"></a>00302 <span class="keywordflow">for</span> (<a class="code" href="classCVC3_1_1Assumptions_1_1iterator.html" title="Iterator for the Assumptions: points to class Theorem.">Assumptions::iterator</a> i = a.<a class="code" href="classCVC3_1_1Assumptions.html#ac3e7d0e1796c83edf687aac063bdba06">begin</a>(); i != a.<a class="code" href="classCVC3_1_1Assumptions.html#afc875bbe97e4e2d74a2cdc824f783bfb">end</a>(); i++) { <a name="l00303"></a>00303 <span class="keywordflow">if</span> ((*i).isRefl() || (*i).isFlagged()) <span class="keywordflow">continue</span>; <a name="l00304"></a>00304 (*i).GetSatAssumptionsRec(assumptions); <a name="l00305"></a>00305 } <a name="l00306"></a>00306 } <a name="l00307"></a>00307 <a name="l00308"></a>00308 <a name="l00309"></a><a class="code" href="classCVC3_1_1Theorem.html#aad446d2963572258f7b8f0c74fb9e299">00309</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#aad446d2963572258f7b8f0c74fb9e299">Theorem::GetSatAssumptions</a>(vector<Theorem>& assumptions)<span class="keyword"> const </span>{ <a name="l00310"></a>00310 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>() && !<a class="code" href="classCVC3_1_1Theorem.html#a1695c9afc9a5c1f8cd000d40b9e2a9cd" title="Check if the flag attribute is set.">isFlagged</a>(), <span class="stringliteral">"Invariant violated"</span>); <a name="l00311"></a>00311 <a class="code" href="classCVC3_1_1Theorem.html#af83d6b4d71bfb558296a1c296a69c3d7" title="Set the flag attribute.">setFlag</a>(); <a name="l00312"></a>00312 <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Assumptions.html">Assumptions</a>& a = <a class="code" href="classCVC3_1_1Theorem.html#a5e9ab00a613df15cc02f55edb55a67b3">getAssumptionsRef</a>(); <a name="l00313"></a>00313 <span class="keywordflow">for</span> (<a class="code" href="classCVC3_1_1Assumptions_1_1iterator.html" title="Iterator for the Assumptions: points to class Theorem.">Assumptions::iterator</a> i = a.<a class="code" href="classCVC3_1_1Assumptions.html#ac3e7d0e1796c83edf687aac063bdba06">begin</a>(); i != a.<a class="code" href="classCVC3_1_1Assumptions.html#afc875bbe97e4e2d74a2cdc824f783bfb">end</a>(); i++) { <a name="l00314"></a>00314 <span class="keywordflow">if</span> ((*i).isRefl() || (*i).isFlagged()) <span class="keywordflow">continue</span>; <a name="l00315"></a>00315 (*i).GetSatAssumptionsRec(assumptions); <a name="l00316"></a>00316 } <a name="l00317"></a>00317 } <a name="l00318"></a>00318 <a name="l00319"></a>00319 <a name="l00320"></a><a class="code" href="classCVC3_1_1Theorem.html#a0c8eec45e649b4608ba1c88ca5f2e617">00320</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#a0c8eec45e649b4608ba1c88ca5f2e617">Theorem::getAssumptionsAndCongRec</a>(set<Expr>& assumptions, <a name="l00321"></a>00321 vector<Expr>& congruences)<span class="keyword"> const</span> <a name="l00322"></a>00322 <span class="keyword"></span>{ <a name="l00323"></a>00323 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>() || <a class="code" href="classCVC3_1_1Theorem.html#a1695c9afc9a5c1f8cd000d40b9e2a9cd" title="Check if the flag attribute is set.">isFlagged</a>()) <span class="keywordflow">return</span>; <a name="l00324"></a>00324 <a class="code" href="classCVC3_1_1Theorem.html#af83d6b4d71bfb558296a1c296a69c3d7" title="Set the flag attribute.">setFlag</a>(); <a name="l00325"></a>00325 <span class="keywordflow">if</span>(<a class="code" href="classCVC3_1_1Theorem.html#a05282db6832afb4f198d8c6b2b67aeb1">isAssump</a>()) { <a name="l00326"></a>00326 assumptions.insert(<a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>()); <a name="l00327"></a>00327 } <a name="l00328"></a>00328 <span class="keywordflow">else</span> { <a name="l00329"></a>00329 <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Assumptions.html">Assumptions</a>& a = <a class="code" href="classCVC3_1_1Theorem.html#a5e9ab00a613df15cc02f55edb55a67b3">getAssumptionsRef</a>(); <a name="l00330"></a>00330 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#ad413df893f7cc81cd2e0a59178b981db" title="Is theorem an instance of substitution.">isSubst</a>() && a.<a class="code" href="classCVC3_1_1Assumptions.html#ad6687116416453b9120a6e97141b631d">size</a>() == 1) { <a name="l00331"></a>00331 vector<Expr> hyp; <a name="l00332"></a>00332 <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>& <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a> = *(a.<a class="code" href="classCVC3_1_1Assumptions.html#ac3e7d0e1796c83edf687aac063bdba06">begin</a>()); <a name="l00333"></a>00333 thm.<a class="code" href="classCVC3_1_1Theorem.html#a0c8eec45e649b4608ba1c88ca5f2e617">getAssumptionsAndCongRec</a>(assumptions, congruences); <a name="l00334"></a>00334 <span class="keywordflow">if</span> (thm.<a class="code" href="classCVC3_1_1Theorem.html#a362c1d70e03803d804bbe300e5f6dc87">isRewrite</a>() && thm.<a class="code" href="classCVC3_1_1Theorem.html#a206c04f39fbbcacef2337148675553f4">getLHS</a>().<a class="code" href="group__ExprPkg.html#gad527acb49daef3591b78c748746e7eef" title="Test if e is a term (as opposed to a predicate/formula)">isTerm</a>() <a name="l00335"></a>00335 && thm.<a class="code" href="classCVC3_1_1Theorem.html#a206c04f39fbbcacef2337148675553f4">getLHS</a>().<a class="code" href="group__ExprPkg.html#ga48a9219339b394280550069ac7b0474f" title="Test if e is atomic.">isAtomic</a>() && thm.<a class="code" href="classCVC3_1_1Theorem.html#a97d957fcbf9094480851b1d2e5d3729f">getRHS</a>().<a class="code" href="group__ExprPkg.html#ga48a9219339b394280550069ac7b0474f" title="Test if e is atomic.">isAtomic</a>() && <a name="l00336"></a>00336 !thm.<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) { <a name="l00337"></a>00337 hyp.push_back(!thm.<a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>()); <a name="l00338"></a>00338 } <a name="l00339"></a>00339 <span class="keywordflow">else</span> <span class="keywordflow">return</span>; <a name="l00340"></a>00340 <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& e = <a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>(); <a name="l00341"></a>00341 <span class="keywordflow">if</span> (e.<a class="code" href="group__ExprPkg.html#ga4b575e0a191cc42706ff5b5a169c3069" title="Test if e is an atomic formula.">isAtomicFormula</a>()) { <a name="l00342"></a>00342 <span class="keywordflow">if</span> (e[0] < e[1]) { <a name="l00343"></a>00343 hyp.push_back(e[1].eqExpr(e[0])); <a name="l00344"></a>00344 } <a name="l00345"></a>00345 <span class="keywordflow">else</span> { <a name="l00346"></a>00346 hyp.push_back(e); <a name="l00347"></a>00347 } <a name="l00348"></a>00348 congruences.push_back(<a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>(<a class="code" href="kinds_8h.html#aa10c9e8951b8ccf714a59ec321bdac5ba96727447c0ad447987df1c6415aef074">OR</a>, hyp)); <a name="l00349"></a>00349 } <a name="l00350"></a>00350 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (e[0].isAtomicFormula() && !e[0].isEq()) { <a name="l00351"></a>00351 hyp.push_back(!e[0]); <a name="l00352"></a>00352 hyp.push_back(e[1]); <a name="l00353"></a>00353 congruences.push_back(<a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>(<a class="code" href="kinds_8h.html#aa10c9e8951b8ccf714a59ec321bdac5ba96727447c0ad447987df1c6415aef074">OR</a>, hyp)); <a name="l00354"></a>00354 hyp.pop_back(); <a name="l00355"></a>00355 hyp.pop_back(); <a name="l00356"></a>00356 hyp.push_back(e[0]); <a name="l00357"></a>00357 hyp.push_back(!e[1]); <a name="l00358"></a>00358 congruences.push_back(<a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>(<a class="code" href="kinds_8h.html#aa10c9e8951b8ccf714a59ec321bdac5ba96727447c0ad447987df1c6415aef074">OR</a>, hyp)); <a name="l00359"></a>00359 } <a name="l00360"></a>00360 } <a name="l00361"></a>00361 <span class="keywordflow">else</span> { <a name="l00362"></a>00362 <a class="code" href="classCVC3_1_1Assumptions_1_1iterator.html" title="Iterator for the Assumptions: points to class Theorem.">Assumptions::iterator</a> i=a.<a class="code" href="classCVC3_1_1Assumptions.html#ac3e7d0e1796c83edf687aac063bdba06">begin</a>(), iend=a.<a class="code" href="classCVC3_1_1Assumptions.html#afc875bbe97e4e2d74a2cdc824f783bfb">end</a>(); <a name="l00363"></a>00363 <span class="keywordflow">for</span>(; i!=iend; ++i) <a name="l00364"></a>00364 (*i).getAssumptionsAndCongRec(assumptions, congruences); <a name="l00365"></a>00365 } <a name="l00366"></a>00366 } <a name="l00367"></a>00367 } <a name="l00368"></a>00368 <a name="l00369"></a>00369 <a name="l00370"></a><a class="code" href="classCVC3_1_1Theorem.html#a69c948a7ecc79597eac8eb816e8d76a1">00370</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#a69c948a7ecc79597eac8eb816e8d76a1">Theorem::getAssumptionsAndCong</a>(vector<Expr>& assumptions, <a name="l00371"></a>00371 vector<Expr>& congruences, <a name="l00372"></a>00372 <span class="keywordtype">bool</span> negate)<span class="keyword"> const</span> <a name="l00373"></a>00373 <span class="keyword"></span>{ <a name="l00374"></a>00374 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>() || <a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <span class="keywordflow">return</span>; <a name="l00375"></a>00375 set<Expr> assumpSet; <a name="l00376"></a>00376 <a class="code" href="classCVC3_1_1Theorem.html#a621ab2150eedc0e3b38d34275ac206cd" title="Clear the flag attribute in all the theorems.">clearAllFlags</a>(); <a name="l00377"></a>00377 <a class="code" href="classCVC3_1_1Theorem.html#a0c8eec45e649b4608ba1c88ca5f2e617">getAssumptionsAndCongRec</a>(assumpSet, congruences); <a name="l00378"></a>00378 <span class="comment">// Order assumptions by their creation time</span> <a name="l00379"></a>00379 <span class="keywordflow">for</span>(set<Expr>::iterator i=assumpSet.begin(), iend=assumpSet.end(); <a name="l00380"></a>00380 i!=iend; ++i) <a name="l00381"></a>00381 assumptions.push_back(negate ? (*i).negate() : *i); <a name="l00382"></a>00382 } <a name="l00383"></a>00383 <a name="l00384"></a>00384 <a name="l00385"></a><a class="code" href="classCVC3_1_1Theorem.html#a5e9ab00a613df15cc02f55edb55a67b3">00385</a> <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Assumptions.html">Assumptions</a>& <a class="code" href="classCVC3_1_1Theorem.html#a5e9ab00a613df15cc02f55edb55a67b3">Theorem::getAssumptionsRef</a>()<span class="keyword"> const</span> <a name="l00386"></a>00386 <span class="keyword"></span>{ <a name="l00387"></a>00387 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::getAssumptionsRef: we are Null"</span>); <a name="l00388"></a>00388 <span class="keywordflow">if</span> (!<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) { <a name="l00389"></a>00389 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a375f504a8a9844005b2eb8e055483829">getAssumptionsRef</a>(); <a name="l00390"></a>00390 } <a name="l00391"></a>00391 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Assumptions.html#af309a39e2e013cc62b6d94c5812ad86b">Assumptions::emptyAssump</a>(); <a name="l00392"></a>00392 } <a name="l00393"></a>00393 <a name="l00394"></a>00394 <a name="l00395"></a><a class="code" href="classCVC3_1_1Theorem.html#a05282db6832afb4f198d8c6b2b67aeb1">00395</a> <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1Theorem.html#a05282db6832afb4f198d8c6b2b67aeb1">Theorem::isAssump</a>()<span class="keyword"> const </span>{ <a name="l00396"></a>00396 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::isAssump: we are Null"</span>); <a name="l00397"></a>00397 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>() ? <span class="keyword">false</span> : <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#aaaabd2fab47103f9a4574c380c790a11">isAssump</a>(); <a name="l00398"></a>00398 } <a name="l00399"></a>00399 <a name="l00400"></a>00400 <span class="comment">// Return the proof of the theorem. If running without proofs,</span> <a name="l00401"></a>00401 <span class="comment">// return the Null proof.</span> <a name="l00402"></a><a class="code" href="classCVC3_1_1Theorem.html#a2d8352c07a756c3837683a27a1e659ef">00402</a> <a class="code" href="classCVC3_1_1Proof.html">Proof</a> <a class="code" href="classCVC3_1_1Theorem.html#a2d8352c07a756c3837683a27a1e659ef">Theorem::getProof</a>()<span class="keyword"> const </span>{ <a name="l00403"></a>00403 <span class="keyword">static</span> <a class="code" href="classCVC3_1_1Proof.html">Proof</a> null; <a name="l00404"></a>00404 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::getProof: we are Null"</span>); <a name="l00405"></a>00405 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) { <a name="l00406"></a>00406 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Proof.html">Proof</a>(<a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>(<a class="code" href="kinds_8h.html#aa10c9e8951b8ccf714a59ec321bdac5baee1a6e6a0705cce09e48dbe8d3f26572">PF_APPLY</a>, <a name="l00407"></a>00407 <a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()->d_em->newVarExpr(<span class="stringliteral">"refl"</span>), <a name="l00408"></a>00408 <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>(<a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()))); <a name="l00409"></a>00409 } <a name="l00410"></a>00410 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#ad4573ca6be017cab3c83d28c2dbcebd8">withProof</a>() == <span class="keyword">true</span>) <a name="l00411"></a>00411 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#af7120729a27c693ca032d176cf33e595">getProof</a>(); <a name="l00412"></a>00412 <span class="keywordflow">else</span> <a name="l00413"></a>00413 <span class="keywordflow">return</span> null; <a name="l00414"></a>00414 } <a name="l00415"></a>00415 <a name="l00416"></a><a class="code" href="classCVC3_1_1Theorem.html#a1695c9afc9a5c1f8cd000d40b9e2a9cd">00416</a> <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1Theorem.html#a1695c9afc9a5c1f8cd000d40b9e2a9cd" title="Check if the flag attribute is set.">Theorem::isFlagged</a>()<span class="keyword"> const </span>{ <a name="l00417"></a>00417 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::isFlagged: we are Null"</span>); <a name="l00418"></a>00418 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()-><a class="code" href="classCVC3_1_1ExprValue.html#ae0b397b57244e8e5bb59cb95641b14d0" title="Our expr. manager.">d_em</a>-><a class="code" href="group__EM__Priv.html#ga4aa1269ec9df849a4b7654742408d2ca" title="Fetch the TheoremManager.">getTM</a>()-><a class="code" href="classCVC3_1_1TheoremManager.html#ae44dabfc954acbba69c98ac56fc09600">isFlagged</a>((<span class="keywordtype">long</span>)<a class="code" href="classCVC3_1_1Theorem.html#a798f8085ec077b69aae198a155077774">d_expr</a>); <a name="l00419"></a>00419 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a1b91df4037f8888079646e7aefe174a2">isFlagged</a>(); <a name="l00420"></a>00420 } <a name="l00421"></a>00421 <a name="l00422"></a><a class="code" href="classCVC3_1_1Theorem.html#a621ab2150eedc0e3b38d34275ac206cd">00422</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#a621ab2150eedc0e3b38d34275ac206cd" title="Clear the flag attribute in all the theorems.">Theorem::clearAllFlags</a>()<span class="keyword"> const </span>{ <a name="l00423"></a>00423 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::clearAllFlags: we are Null"</span>); <a name="l00424"></a>00424 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) { <a name="l00425"></a>00425 <a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()-><a class="code" href="classCVC3_1_1ExprValue.html#ae0b397b57244e8e5bb59cb95641b14d0" title="Our expr. manager.">d_em</a>-><a class="code" href="group__EM__Priv.html#ga4aa1269ec9df849a4b7654742408d2ca" title="Fetch the TheoremManager.">getTM</a>()-><a class="code" href="classCVC3_1_1TheoremManager.html#a53386d08efa4d0f18524129b3d653bef">clearAllFlags</a>(); <a name="l00426"></a>00426 } <span class="keywordflow">else</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#ace65848828d3d96490a45a52ff7f8f73">clearAllFlags</a>(); <a name="l00427"></a>00427 } <a name="l00428"></a>00428 <a name="l00429"></a><a class="code" href="classCVC3_1_1Theorem.html#af83d6b4d71bfb558296a1c296a69c3d7">00429</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#af83d6b4d71bfb558296a1c296a69c3d7" title="Set the flag attribute.">Theorem::setFlag</a>()<span class="keyword"> const </span>{ <a name="l00430"></a>00430 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::setFlag: we are Null"</span>); <a name="l00431"></a>00431 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()-><a class="code" href="classCVC3_1_1ExprValue.html#ae0b397b57244e8e5bb59cb95641b14d0" title="Our expr. manager.">d_em</a>-><a class="code" href="group__EM__Priv.html#ga4aa1269ec9df849a4b7654742408d2ca" title="Fetch the TheoremManager.">getTM</a>()-><a class="code" href="classCVC3_1_1TheoremManager.html#a510895405d8502401bb6715e54ee58a3">setFlag</a>((<span class="keywordtype">long</span>)<a class="code" href="classCVC3_1_1Theorem.html#a798f8085ec077b69aae198a155077774">d_expr</a>); <a name="l00432"></a>00432 <span class="keywordflow">else</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#aee29e499025f39a5b04b610dee9dae0c">setFlag</a>(); <a name="l00433"></a>00433 } <a name="l00434"></a>00434 <a name="l00435"></a><a class="code" href="classCVC3_1_1Theorem.html#a293ebbc3162763fbbeaa9fbd8ea1c657">00435</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#a293ebbc3162763fbbeaa9fbd8ea1c657" title="Check if the flag attribute is set.">Theorem::setCachedValue</a>(<span class="keywordtype">int</span> value)<span class="keyword"> const </span>{ <a name="l00436"></a>00436 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::setCachedValue: we are Null"</span>); <a name="l00437"></a>00437 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()-><a class="code" href="classCVC3_1_1ExprValue.html#ae0b397b57244e8e5bb59cb95641b14d0" title="Our expr. manager.">d_em</a>-><a class="code" href="group__EM__Priv.html#ga4aa1269ec9df849a4b7654742408d2ca" title="Fetch the TheoremManager.">getTM</a>()-><a class="code" href="classCVC3_1_1TheoremManager.html#a1412941ea97bc56950827c7d28c6ba54">setCachedValue</a>((<span class="keywordtype">long</span>)<a class="code" href="classCVC3_1_1Theorem.html#a798f8085ec077b69aae198a155077774">d_expr</a>, value); <a name="l00438"></a>00438 <span class="keywordflow">else</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a9d2d00b50cf9eb8f5378cb8d289a412c">setCachedValue</a>(value); <a name="l00439"></a>00439 } <a name="l00440"></a>00440 <a name="l00441"></a><a class="code" href="classCVC3_1_1Theorem.html#a0062fd610006e5bc0b4093ae72943342">00441</a> <span class="keywordtype">int</span> <a class="code" href="classCVC3_1_1Theorem.html#a0062fd610006e5bc0b4093ae72943342" title="Check if the flag attribute is set.">Theorem::getCachedValue</a>()<span class="keyword"> const </span>{ <a name="l00442"></a>00442 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::getCachedValue: we are Null"</span>); <a name="l00443"></a>00443 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()-><a class="code" href="classCVC3_1_1ExprValue.html#ae0b397b57244e8e5bb59cb95641b14d0" title="Our expr. manager.">d_em</a>-><a class="code" href="group__EM__Priv.html#ga4aa1269ec9df849a4b7654742408d2ca" title="Fetch the TheoremManager.">getTM</a>()-><a class="code" href="classCVC3_1_1TheoremManager.html#aa0bc4b6cb911dd5e40efcab60c3f1255">getCachedValue</a>((<span class="keywordtype">long</span>)<a class="code" href="classCVC3_1_1Theorem.html#a798f8085ec077b69aae198a155077774">d_expr</a>); <a name="l00444"></a>00444 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a223a1c591286bee75524a573bc87518e">getCachedValue</a>(); <a name="l00445"></a>00445 } <a name="l00446"></a>00446 <a name="l00447"></a><a class="code" href="classCVC3_1_1Theorem.html#a979f97355a4ecd2d8d8b96b679df5240">00447</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#a979f97355a4ecd2d8d8b96b679df5240" title="Set flag stating that theorem is an instance of substitution.">Theorem::setSubst</a>()<span class="keyword"> const </span>{ <a name="l00448"></a>00448 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>() && !<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>(), <span class="stringliteral">"CVC3::Theorem::setSubst: invalid thm"</span>); <a name="l00449"></a>00449 <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a31762e3d339154a150064b0e91c6497d">setSubst</a>(); <a name="l00450"></a>00450 } <a name="l00451"></a>00451 <a name="l00452"></a><a class="code" href="classCVC3_1_1Theorem.html#ad413df893f7cc81cd2e0a59178b981db">00452</a> <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1Theorem.html#ad413df893f7cc81cd2e0a59178b981db" title="Is theorem an instance of substitution.">Theorem::isSubst</a>()<span class="keyword"> const </span>{ <a name="l00453"></a>00453 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::isSubst: we are Null"</span>); <a name="l00454"></a>00454 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00455"></a>00455 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a7bc742af6a03964e8c4d9fc876426e5e">isSubst</a>(); <a name="l00456"></a>00456 } <a name="l00457"></a>00457 <a name="l00458"></a><a class="code" href="classCVC3_1_1Theorem.html#a30644e9241516daa6483f5d9c0be4caf">00458</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#a30644e9241516daa6483f5d9c0be4caf" title="Set the "expand" attribute.">Theorem::setExpandFlag</a>(<span class="keywordtype">bool</span> val)<span class="keyword"> const </span>{ <a name="l00459"></a>00459 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::setExpandFlag: we are Null"</span>); <a name="l00460"></a>00460 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()-><a class="code" href="classCVC3_1_1ExprValue.html#ae0b397b57244e8e5bb59cb95641b14d0" title="Our expr. manager.">d_em</a>-><a class="code" href="group__EM__Priv.html#ga4aa1269ec9df849a4b7654742408d2ca" title="Fetch the TheoremManager.">getTM</a>()-><a class="code" href="classCVC3_1_1TheoremManager.html#ab70781500f12974614ac06e1118d502f">setExpandFlag</a>((<span class="keywordtype">long</span>)<a class="code" href="classCVC3_1_1Theorem.html#a798f8085ec077b69aae198a155077774">d_expr</a>, val); <a name="l00461"></a>00461 <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a67f5136c43e385f2398841f8ad94d18a">setExpandFlag</a>(val); <a name="l00462"></a>00462 } <a name="l00463"></a>00463 <a name="l00464"></a><a class="code" href="classCVC3_1_1Theorem.html#a2eefa550b2e04a012adc03ba456af38b">00464</a> <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1Theorem.html#a2eefa550b2e04a012adc03ba456af38b" title="Check the "expand" attribute.">Theorem::getExpandFlag</a>()<span class="keyword"> const </span>{ <a name="l00465"></a>00465 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::getExpandFlag: we are Null"</span>); <a name="l00466"></a>00466 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()-><a class="code" href="classCVC3_1_1ExprValue.html#ae0b397b57244e8e5bb59cb95641b14d0" title="Our expr. manager.">d_em</a>-><a class="code" href="group__EM__Priv.html#ga4aa1269ec9df849a4b7654742408d2ca" title="Fetch the TheoremManager.">getTM</a>()-><a class="code" href="classCVC3_1_1TheoremManager.html#abd4fa692d21d8d1a4ba9db570c615847">getExpandFlag</a>((<span class="keywordtype">long</span>)<a class="code" href="classCVC3_1_1Theorem.html#a798f8085ec077b69aae198a155077774">d_expr</a>); <a name="l00467"></a>00467 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#ae88fe39382cb64565b4a30a0ad170797">getExpandFlag</a>(); <a name="l00468"></a>00468 } <a name="l00469"></a>00469 <a name="l00470"></a><a class="code" href="classCVC3_1_1Theorem.html#a575a8519a298b25db8b728f4c273972c">00470</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#a575a8519a298b25db8b728f4c273972c" title="Set the "literal" attribute.">Theorem::setLitFlag</a>(<span class="keywordtype">bool</span> val)<span class="keyword"> const </span>{ <a name="l00471"></a>00471 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::setLitFlag: we are Null"</span>); <a name="l00472"></a>00472 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()-><a class="code" href="classCVC3_1_1ExprValue.html#ae0b397b57244e8e5bb59cb95641b14d0" title="Our expr. manager.">d_em</a>-><a class="code" href="group__EM__Priv.html#ga4aa1269ec9df849a4b7654742408d2ca" title="Fetch the TheoremManager.">getTM</a>()-><a class="code" href="classCVC3_1_1TheoremManager.html#a0e3e5bbc0f9539fe1e45f4091602e66a">setLitFlag</a>((<span class="keywordtype">long</span>)<a class="code" href="classCVC3_1_1Theorem.html#a798f8085ec077b69aae198a155077774">d_expr</a>, val); <a name="l00473"></a>00473 <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#ae9091cd1e351cd1e00f9f57e286e1414">setLitFlag</a>(val); <a name="l00474"></a>00474 } <a name="l00475"></a>00475 <a name="l00476"></a><a class="code" href="classCVC3_1_1Theorem.html#a8442e9bc88086d84648ccea5b373cdb0">00476</a> <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1Theorem.html#a8442e9bc88086d84648ccea5b373cdb0" title="Check the "literal" attribute.">Theorem::getLitFlag</a>()<span class="keyword"> const </span>{ <a name="l00477"></a>00477 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::getLitFlag: we are Null"</span>); <a name="l00478"></a>00478 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a67e2a295b1598057cfbb51120a0c1ad6">exprValue</a>()-><a class="code" href="classCVC3_1_1ExprValue.html#ae0b397b57244e8e5bb59cb95641b14d0" title="Our expr. manager.">d_em</a>-><a class="code" href="group__EM__Priv.html#ga4aa1269ec9df849a4b7654742408d2ca" title="Fetch the TheoremManager.">getTM</a>()-><a class="code" href="classCVC3_1_1TheoremManager.html#a57daffd1ce5675f8d58694213e89fb93">getLitFlag</a>((<span class="keywordtype">long</span>)<a class="code" href="classCVC3_1_1Theorem.html#a798f8085ec077b69aae198a155077774">d_expr</a>); <a name="l00479"></a>00479 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a74e6ab319ca0b6945ae472ba30698aae">getLitFlag</a>(); <a name="l00480"></a>00480 } <a name="l00481"></a>00481 <a name="l00482"></a><a class="code" href="classCVC3_1_1Theorem.html#aed1590a02166f6099e5538dbf681a60c">00482</a> <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1Theorem.html#aed1590a02166f6099e5538dbf681a60c" title="Check if the theorem is a literal.">Theorem::isAbsLiteral</a>()<span class="keyword"> const </span>{ <a name="l00483"></a>00483 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>().<a class="code" href="group__ExprPkg.html#gaac535dae48f02fcd093a5b1b1a062211" title="Test if e is an abstract literal.">isAbsLiteral</a>(); <a name="l00484"></a>00484 } <a name="l00485"></a>00485 <a name="l00486"></a><a class="code" href="classCVC3_1_1Theorem.html#a112466d9793abcf97015233ffdc4ec5e">00486</a> <span class="keywordtype">int</span> <a class="code" href="classCVC3_1_1Theorem.html#a112466d9793abcf97015233ffdc4ec5e">Theorem::getScope</a>()<span class="keyword"> const </span>{ <a name="l00487"></a>00487 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::getScope: we are Null"</span>); <a name="l00488"></a>00488 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>() ? 0 : <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a9c11008cb459d81b618c10913057435c">getScope</a>(); <a name="l00489"></a>00489 } <a name="l00490"></a>00490 <a name="l00491"></a><a class="code" href="classCVC3_1_1Theorem.html#a26b6f0af9e9b2f2a8c22a7dcb9fbb0b1">00491</a> <span class="keywordtype">unsigned</span> <a class="code" href="classCVC3_1_1Theorem.html#a26b6f0af9e9b2f2a8c22a7dcb9fbb0b1" title="Return quantification level for this theorem.">Theorem::getQuantLevel</a>()<span class="keyword"> const </span>{ <a name="l00492"></a>00492 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::getQuantLevel: we are Null"</span>); <a name="l00493"></a>00493 <a class="code" href="kinds_8h.html#aa10c9e8951b8ccf714a59ec321bdac5ba7fa27e82c6c4f69434225ed81e5d151e">TRACE</a>(<span class="stringliteral">"quant-level"</span>, <span class="stringliteral">"isRefl? "</span>, <a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>(), <span class="stringliteral">""</span>); <a name="l00494"></a>00494 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>() ? 0 : <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a5548a7ad205c1fee8fa49309d865cf44">getQuantLevel</a>(); <a name="l00495"></a>00495 } <a name="l00496"></a>00496 <a name="l00497"></a><a class="code" href="classCVC3_1_1Theorem.html#abd3642f4230db7cd61aab78fdcc329e3">00497</a> <span class="keywordtype">unsigned</span> <a class="code" href="classCVC3_1_1Theorem.html#abd3642f4230db7cd61aab78fdcc329e3">Theorem::getQuantLevelDebug</a>()<span class="keyword"> const </span>{ <a name="l00498"></a>00498 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::getQuantLevel: we are Null"</span>); <a name="l00499"></a>00499 <a class="code" href="kinds_8h.html#aa10c9e8951b8ccf714a59ec321bdac5ba7fa27e82c6c4f69434225ed81e5d151e">TRACE</a>(<span class="stringliteral">"quant-level"</span>, <span class="stringliteral">"isRefl? "</span>, <a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>(), <span class="stringliteral">""</span>); <a name="l00500"></a>00500 <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>() ? 0 : <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#ae091d4527d043cdf0bd83ba56ab98ca3">getQuantLevelDebug</a>(); <a name="l00501"></a>00501 } <a name="l00502"></a>00502 <a name="l00503"></a>00503 <a name="l00504"></a><a class="code" href="classCVC3_1_1Theorem.html#ab3309c937f827595d1d92fa48cb5a471">00504</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#ab3309c937f827595d1d92fa48cb5a471" title="Set the quantification level for this theorem.">Theorem::setQuantLevel</a>(<span class="keywordtype">unsigned</span> level) { <a name="l00505"></a>00505 <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(!<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>(), <span class="stringliteral">"CVC3::Theorem::setQuantLevel: we are Null"</span>); <a name="l00506"></a>00506 <span class="comment">// DebugAssert(!isRefl(), "CVC3::Theorem::setQuantLevel: we are Refl");</span> <a name="l00507"></a>00507 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) <span class="keywordflow">return</span>; <a name="l00508"></a>00508 <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a4a305d7049aab9528a6205250303c574">setQuantLevel</a>(level); <a name="l00509"></a>00509 } <a name="l00510"></a>00510 <a name="l00511"></a><a class="code" href="classCVC3_1_1Theorem.html#abe268eaf2b89ffdc4ccb291c0a2eaeb9">00511</a> <span class="keywordtype">size_t</span> <a class="code" href="classCVC3_1_1Theorem.html#abe268eaf2b89ffdc4ccb291c0a2eaeb9">Theorem::hash</a>()<span class="keyword"> const </span>{ <a name="l00512"></a>00512 <span class="keyword">static</span> <a class="code" href="structHash_1_1hash.html">std::hash<long int></a> h; <a name="l00513"></a>00513 <span class="keywordflow">return</span> h(<a class="code" href="classCVC3_1_1Theorem.html#a696e2281069af317ec3fb6510845ca6c">d_thm</a>); <a name="l00514"></a>00514 } <a name="l00515"></a>00515 <a name="l00516"></a><a class="code" href="classCVC3_1_1Theorem.html#a472f420688e07c506969a4ed6b9a110e">00516</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1Theorem.html#a472f420688e07c506969a4ed6b9a110e">Theorem::recursivePrint</a>(<span class="keywordtype">int</span>& i)<span class="keyword"> const </span>{ <a name="l00517"></a>00517 <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Assumptions_1_1iterator.html" title="Iterator for the Assumptions: points to class Theorem.">Assumptions::iterator</a> iend = <a class="code" href="classCVC3_1_1Theorem.html#a5e9ab00a613df15cc02f55edb55a67b3">getAssumptionsRef</a>().<a class="code" href="classCVC3_1_1Assumptions.html#afc875bbe97e4e2d74a2cdc824f783bfb">end</a>(); <a name="l00518"></a>00518 <a class="code" href="classCVC3_1_1Assumptions_1_1iterator.html" title="Iterator for the Assumptions: points to class Theorem.">Assumptions::iterator</a> it = <a class="code" href="classCVC3_1_1Theorem.html#a5e9ab00a613df15cc02f55edb55a67b3">getAssumptionsRef</a>().<a class="code" href="classCVC3_1_1Assumptions.html#ac3e7d0e1796c83edf687aac063bdba06">begin</a>(); <a name="l00519"></a>00519 <span class="keywordflow">if</span> (!<a class="code" href="classCVC3_1_1Theorem.html#a05282db6832afb4f198d8c6b2b67aeb1">isAssump</a>()) { <a name="l00520"></a>00520 <span class="keywordflow">for</span> (; it != iend; ++it) { <a name="l00521"></a>00521 <span class="keywordflow">if</span> (it->isFlagged()) <span class="keywordflow">continue</span>; <a name="l00522"></a>00522 it->recursivePrint(i); <a name="l00523"></a>00523 it->setFlag(); <a name="l00524"></a>00524 } <a name="l00525"></a>00525 } <a name="l00526"></a>00526 <a name="l00527"></a>00527 <a class="code" href="classCVC3_1_1Theorem.html#a293ebbc3162763fbbeaa9fbd8ea1c657" title="Check if the flag attribute is set.">setCachedValue</a>(i++); <a name="l00528"></a>00528 cout << <span class="stringliteral">"["</span> << <a class="code" href="classCVC3_1_1Theorem.html#a0062fd610006e5bc0b4093ae72943342" title="Check if the flag attribute is set.">getCachedValue</a>() <a name="l00529"></a>00529 << <span class="stringliteral">"]@"</span> << <a class="code" href="classCVC3_1_1Theorem.html#a112466d9793abcf97015233ffdc4ec5e">getScope</a>() << <span class="stringliteral">"\tTheorem: {"</span>; <a name="l00530"></a>00530 <a name="l00531"></a>00531 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a05282db6832afb4f198d8c6b2b67aeb1">isAssump</a>()) { <a name="l00532"></a>00532 cout << <span class="stringliteral">"assump"</span>; <a name="l00533"></a>00533 } <a name="l00534"></a>00534 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a5e9ab00a613df15cc02f55edb55a67b3">getAssumptionsRef</a>().empty()) { <a name="l00535"></a>00535 cout << <span class="stringliteral">"empty"</span>; <a name="l00536"></a>00536 } <a name="l00537"></a>00537 <span class="keywordflow">else</span> { <a name="l00538"></a>00538 <span class="keywordflow">for</span> (it = <a class="code" href="classCVC3_1_1Theorem.html#a5e9ab00a613df15cc02f55edb55a67b3">getAssumptionsRef</a>().begin(); it != iend; ++it) { <a name="l00539"></a>00539 <span class="keywordflow">if</span> (it != <a class="code" href="classCVC3_1_1Theorem.html#a5e9ab00a613df15cc02f55edb55a67b3">getAssumptionsRef</a>().begin()) cout << <span class="stringliteral">", "</span>; <a name="l00540"></a>00540 cout << <span class="stringliteral">"["</span> << it->getCachedValue() << <span class="stringliteral">"]"</span> ; <a name="l00541"></a>00541 } <a name="l00542"></a>00542 } <a name="l00543"></a>00543 cout << <span class="stringliteral">"}"</span> << <a class="code" href="group__ExprStream__Manip.html#ga05b0ea7353ec24fa8e7e272d7a7875d8" title="Print the end-of-line.">endl</a> << <span class="stringliteral">"\t\t|- "</span> << <a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>(); <a name="l00544"></a>00544 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#ad413df893f7cc81cd2e0a59178b981db" title="Is theorem an instance of substitution.">isSubst</a>()) cout << <span class="stringliteral">" [[Subst]]"</span>; <a name="l00545"></a>00545 cout << <a class="code" href="group__ExprStream__Manip.html#ga05b0ea7353ec24fa8e7e272d7a7875d8" title="Print the end-of-line.">endl</a>; <a name="l00546"></a>00546 } <a name="l00547"></a>00547 <a name="l00548"></a>00548 <a name="l00549"></a>00549 <span class="comment">// Return the scope level at which this theorem was created</span> <a name="l00550"></a>00550 <span class="comment">// int Theorem::getScope() const {</span> <a name="l00551"></a>00551 <span class="comment">// DebugAssert(!isNull(), "CVC3::Theorem::getScope: we are Null");</span> <a name="l00552"></a>00552 <span class="comment">// return thm()->getScope();</span> <a name="l00553"></a>00553 <span class="comment">// }</span> <a name="l00554"></a>00554 <a name="l00555"></a>00555 <span class="comment">// Assumptions Theorem::getUserAssumptions() const {</span> <a name="l00556"></a>00556 <span class="comment">// ExprMap<Theorem> em;</span> <a name="l00557"></a>00557 <span class="comment">// Assumptions a = getAssumptionsCopy();</span> <a name="l00558"></a>00558 <a name="l00559"></a>00559 <span class="comment">// collectAssumptions(a, em);</span> <a name="l00560"></a>00560 <a name="l00561"></a>00561 <span class="comment">// return a;</span> <a name="l00562"></a>00562 <span class="comment">// }</span> <a name="l00563"></a>00563 <a name="l00564"></a>00564 <span class="comment">// void collectAssumptions(Assumptions &a, ExprMap<Theorem> em ) const {</span> <a name="l00565"></a>00565 <span class="comment">// if (isAssump()) {</span> <a name="l00566"></a>00566 <span class="comment">// // cache?</span> <a name="l00567"></a>00567 <span class="comment">// return;</span> <a name="l00568"></a>00568 <span class="comment">// }</span> <a name="l00569"></a>00569 <a name="l00570"></a>00570 <span class="comment">// const Assumptions a2 = thm()->getAssumptions();</span> <a name="l00571"></a>00571 <span class="comment">// a.add(a2);</span> <a name="l00572"></a>00572 <span class="comment">// Assumptions::iterator a2begin = a2.begin();</span> <a name="l00573"></a>00573 <span class="comment">// const Assumptions::iterator a2end = a2.end();</span> <a name="l00574"></a>00574 <a name="l00575"></a>00575 <a name="l00576"></a>00576 <span class="comment">// }</span> <a name="l00577"></a>00577 <a name="l00578"></a>00578 <a name="l00579"></a>00579 <span class="comment">// Printing Theorem</span> <a name="l00580"></a><a class="code" href="classCVC3_1_1Theorem.html#a6ead218343fdbf3e92c26d8c76b9d399">00580</a> ostream& <a class="code" href="classCVC3_1_1Theorem.html#af412e1fca4a31f24a63c948f85c18358">Theorem::print</a>(ostream& os, <span class="keyword">const</span> <span class="keywordtype">string</span>& name)<span class="keyword"> const </span>{ <a name="l00581"></a>00581 <span class="keywordflow">if</span>(<a class="code" href="classCVC3_1_1Theorem.html#afc6fdb0507eb3669e28d9be5ed0bd333">isNull</a>()) <span class="keywordflow">return</span> os << name << <span class="stringliteral">"(Null)"</span>; <a name="l00582"></a>00582 <a class="code" href="classCVC3_1_1ExprManager.html">ExprManager</a> *em = <a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>().<a class="code" href="group__ExprPkg.html#gab57ce3dfa78947a906241d090c7cf34d">getEM</a>(); <a name="l00583"></a>00583 <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a16f074e60b9e076187efb478889d2c47">isRefl</a>()) os << <a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>(); <a name="l00584"></a>00584 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classCVC3_1_1Theorem.html#a90349125fe644e8a075e1a47a49872c7">withAssumptions</a>()) { <a name="l00585"></a>00585 em-><a class="code" href="group__EM__Priv.html#gaf1a5a30e0f0ed0a3e59201530d39d49a" title="Increment the current transient indentation by n.">incIndent</a>(name.size()+2); <a name="l00586"></a>00586 os << name << <span class="stringliteral">"(["</span> << <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>() << <span class="stringliteral">"#"</span> << <a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()-><a class="code" href="classCVC3_1_1TheoremValue.html#a138c67c7a778d8e0d525a658439f105c" title="How many pointers to this theorem value.">d_refcount</a> << <span class="stringliteral">"]@"</span> <a name="l00587"></a>00587 << <a class="code" href="classCVC3_1_1Theorem.html#a112466d9793abcf97015233ffdc4ec5e">getScope</a>() << <span class="stringliteral">"\n["</span>; <a name="l00588"></a>00588 <span class="keywordflow">if</span>(<a class="code" href="classCVC3_1_1Theorem.html#a05282db6832afb4f198d8c6b2b67aeb1">isAssump</a>()) os << <span class="stringliteral">"Assump"</span>; <a name="l00589"></a>00589 <span class="keywordflow">else</span> { <a name="l00590"></a>00590 <span class="keywordflow">if</span>(<a class="code" href="classCVC3_1_1Theorem.html#a12de358e2b6cb67415f508ceca6913d1">thm</a>()->d_tm->getFlags()[<span class="stringliteral">"print-assump"</span>].getBool() <a name="l00591"></a>00591 && em-><a class="code" href="group__EM__Priv.html#gaaec477005a23531fa15d27282658aab8" title="Check if the ExprManager is still active (clear() was not called)">isActive</a>()) <a name="l00592"></a>00592 os << <a class="code" href="classCVC3_1_1Theorem.html#a5e9ab00a613df15cc02f55edb55a67b3">getAssumptionsRef</a>(); <a name="l00593"></a>00593 <span class="keywordflow">else</span> <a name="l00594"></a>00594 os << <span class="stringliteral">"<assumptions>"</span>; <a name="l00595"></a>00595 } <a name="l00596"></a>00596 os << <span class="stringliteral">"]\n |--- "</span>; <a name="l00597"></a>00597 em-><a class="code" href="group__EM__Priv.html#ga54ddb950b6bd35316d1cefe3fd506149" title="Get initial indentation.">indent</a>(7); <a name="l00598"></a>00598 <span class="keywordflow">if</span>(em-><a class="code" href="group__EM__Priv.html#gaaec477005a23531fa15d27282658aab8" title="Check if the ExprManager is still active (clear() was not called)">isActive</a>()) os << <a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>(); <a name="l00599"></a>00599 <span class="keywordflow">else</span> os << <span class="stringliteral">"(being destructed)"</span>; <a name="l00600"></a>00600 <span class="keywordflow">if</span>(<a class="code" href="classCVC3_1_1Theorem.html#ad4573ca6be017cab3c83d28c2dbcebd8">withProof</a>()) <a name="l00601"></a>00601 os << <span class="stringliteral">"\n Proof = "</span> << <a class="code" href="classCVC3_1_1Theorem.html#a2d8352c07a756c3837683a27a1e659ef">getProof</a>(); <a name="l00602"></a>00602 <span class="keywordflow">return</span> os << <span class="stringliteral">")"</span>; <a name="l00603"></a>00603 } <a name="l00604"></a>00604 <span class="keywordflow">else</span> { <a name="l00605"></a>00605 em-><a class="code" href="group__EM__Priv.html#gaf1a5a30e0f0ed0a3e59201530d39d49a" title="Increment the current transient indentation by n.">incIndent</a>(name.size()+1); <a name="l00606"></a>00606 os << name << <span class="stringliteral">"("</span>; <a name="l00607"></a>00607 <span class="keywordflow">if</span>(em-><a class="code" href="group__EM__Priv.html#gaaec477005a23531fa15d27282658aab8" title="Check if the ExprManager is still active (clear() was not called)">isActive</a>()) os << <a class="code" href="classCVC3_1_1Theorem.html#af2b97ae5d270ddf1013bf4f3867a7e5d">getExpr</a>(); <a name="l00608"></a>00608 <span class="keywordflow">else</span> os << <span class="stringliteral">"being destructed"</span>; <a name="l00609"></a>00609 <span class="keywordflow">return</span> os << <span class="stringliteral">")"</span>; <a name="l00610"></a>00610 } <a name="l00611"></a>00611 <span class="keywordflow">return</span> os; <a name="l00612"></a>00612 } <a name="l00613"></a>00613 <a name="l00614"></a>00614 <a name="l00615"></a>00615 } <span class="comment">// end of namespace CVC3</span> </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated on Wed Sep 7 2011 for CVC3 by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address> </body> </html>