<!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: TReturn.h 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">TReturn.h</div> </div> </div> <div class="contents"> <a href="TReturn_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef TRETURN_H_</span> <a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define TRETURN_H_</span> <a name="l00003"></a>00003 <span class="preprocessor"></span> <a name="l00004"></a>00004 <span class="preprocessor">#include "<a class="code" href="LFSCProof_8h.html">LFSCProof.h</a>"</span> <a name="l00005"></a>00005 <span class="comment"></span> <a name="l00006"></a>00006 <span class="comment">//////////////////////////////////////////</span> <a name="l00007"></a>00007 <span class="comment"></span><span class="comment">// TReturn = (p_lfsc, L, c)</span> <a name="l00008"></a>00008 <span class="comment">// implements transformation</span><span class="comment"></span> <a name="l00009"></a>00009 <span class="comment">/////////////////////////////////////////</span> <a name="l00010"></a>00010 <span class="comment"></span> <a name="l00011"></a><a class="code" href="classTReturn.html">00011</a> <span class="keyword">class </span><a class="code" href="classTReturn.html">TReturn</a> : <span class="keyword">public</span> <a class="code" href="classLFSCObj.html">LFSCObj</a> <a name="l00012"></a>00012 { <a name="l00013"></a>00013 <span class="keyword">private</span>: <a name="l00014"></a><a class="code" href="classTReturn.html#a934ee85a303379f5c699b88be35224ad">00014</a> <a class="code" href="classRefPtr.html">RefPtr< LFSCProof ></a> <a class="code" href="classTReturn.html#a934ee85a303379f5c699b88be35224ad">d_lfsc_pf</a>; <a name="l00015"></a>00015 <span class="comment">// literals (we only store the indices) i corresponds to v_i and -i to not v_i</span> <a name="l00016"></a><a class="code" href="classTReturn.html#a7b8e49b2d097ca45103e11e0dd2019aa">00016</a> std::vector <int> <a class="code" href="classTReturn.html#a7b8e49b2d097ca45103e11e0dd2019aa">d_L</a>; <a name="l00017"></a>00017 <span class="comment">// literals we use</span> <a name="l00018"></a><a class="code" href="classTReturn.html#ab2e40626799f04887f80159b0d74521a">00018</a> std::vector <int> <a class="code" href="classTReturn.html#ab2e40626799f04887f80159b0d74521a">d_L_used</a>; <a name="l00019"></a>00019 <span class="comment">// constant</span> <a name="l00020"></a><a class="code" href="classTReturn.html#a2306f247630ba7d133db2e63651a584a">00020</a> <a class="code" href="classCVC3_1_1Rational.html">Rational</a> <a class="code" href="classTReturn.html#a2306f247630ba7d133db2e63651a584a">d_c</a>; <a name="l00021"></a><a class="code" href="classTReturn.html#a3aeca59a077b015fe579ad447ac94e29">00021</a> <span class="keywordtype">bool</span> <a class="code" href="classTReturn.html#a3aeca59a077b015fe579ad447ac94e29">d_hasRt</a>; <a name="l00022"></a>00022 <span class="comment">// constructor</span> <a name="l00023"></a>00023 <span class="comment">//flag for whether d_lfsc_pf is proving</span> <a name="l00024"></a>00024 <span class="comment">//0: psi,</span> <a name="l00025"></a>00025 <span class="comment">//1: Y(psi) (arithmetic collapse)</span> <a name="l00026"></a>00026 <span class="comment">//2: Y2( psi ) (double implications are single implications)</span> <a name="l00027"></a>00027 <span class="comment">//3: clause( Y2( psi ) )</span> <a name="l00028"></a><a class="code" href="classTReturn.html#a698d236c454a4d9ebe3c461d38d9dab0">00028</a> <span class="keywordtype">int</span> <a class="code" href="classTReturn.html#a698d236c454a4d9ebe3c461d38d9dab0">d_provesY</a>; <a name="l00029"></a><a class="code" href="classTReturn.html#aa05c68c3ad6926cb6bd48335092c9c4e">00029</a> <span class="keywordtype">bool</span> <a class="code" href="classTReturn.html#aa05c68c3ad6926cb6bd48335092c9c4e">lcalced</a>; <a name="l00030"></a>00030 <span class="keyword">public</span>: <a name="l00031"></a>00031 <a class="code" href="classTReturn.html#a9554576fa26fd8e19942ff4a2f566bbf">TReturn</a>(<a class="code" href="classLFSCProof.html">LFSCProof</a>* lfsc_pf, std::vector<int>& L, std::vector<int>& Lused, <a class="code" href="classCVC3_1_1Rational.html">Rational</a> r, <span class="keywordtype">bool</span> hasR, <span class="keywordtype">int</span> pvY); <a name="l00032"></a>00032 <a name="l00033"></a>00033 <a class="code" href="classCVC3_1_1Rational.html">Rational</a> <a class="code" href="classTReturn.html#ac7a0e50d750845a8cfd72bc9faf4949d">mult_rational</a>( <a class="code" href="classTReturn.html">TReturn</a>* lhs ); <a name="l00034"></a>00034 <span class="keywordtype">void</span> <a class="code" href="classTReturn.html#ab5fe603ed277f47bdc014df335f33a44">getL</a>( std::vector< int >& lget, std::vector< int >& lgetu ); <a name="l00035"></a><a class="code" href="classTReturn.html#abae84e878863b3a6978d7dde0d52522a">00035</a> <span class="keywordtype">bool</span> <a class="code" href="classTReturn.html#abae84e878863b3a6978d7dde0d52522a">hasRational</a>() { <span class="keywordflow">return</span> <a class="code" href="classTReturn.html#a3aeca59a077b015fe579ad447ac94e29">d_hasRt</a>; } <a name="l00036"></a><a class="code" href="classTReturn.html#afc199e16f310243abfdf0f08f248401b">00036</a> <a class="code" href="classCVC3_1_1Rational.html">Rational</a> <a class="code" href="classTReturn.html#afc199e16f310243abfdf0f08f248401b">getRational</a>() { <span class="keywordflow">return</span> <a class="code" href="classTReturn.html#a2306f247630ba7d133db2e63651a584a">d_c</a>; } <a name="l00037"></a><a class="code" href="classTReturn.html#a75ec103851040bcd454dde054227a3c2">00037</a> <a class="code" href="classLFSCProof.html">LFSCProof</a>* <a class="code" href="classTReturn.html#a75ec103851040bcd454dde054227a3c2">getLFSCProof</a>(){ <span class="keywordflow">return</span> <a class="code" href="classTReturn.html#a934ee85a303379f5c699b88be35224ad">d_lfsc_pf</a>.<a class="code" href="classRefPtr.html#a2b987fbb75b20a1da1bd959325635e7e">get</a>(); } <a name="l00038"></a><a class="code" href="classTReturn.html#adfcacf33921f81fe720ef5b30b184153">00038</a> <span class="keywordtype">int</span> <a class="code" href="classTReturn.html#adfcacf33921f81fe720ef5b30b184153">getProvesY</a>() { <span class="keywordflow">return</span> <a class="code" href="classTReturn.html#a698d236c454a4d9ebe3c461d38d9dab0">d_provesY</a>; } <a name="l00039"></a><a class="code" href="classTReturn.html#a072febb7e4c799752ddc9c0c04eef157">00039</a> <span class="keywordtype">bool</span> <a class="code" href="classTReturn.html#a072febb7e4c799752ddc9c0c04eef157">hasFv</a>() { <span class="keywordflow">return</span> !<a class="code" href="classTReturn.html#ab2e40626799f04887f80159b0d74521a">d_L_used</a>.empty(); } <a name="l00040"></a>00040 <span class="preprocessor">#ifdef OPTIMIZE</span> <a name="l00041"></a>00041 <span class="preprocessor"></span> <span class="keywordtype">void</span> calcL( std::vector< int >& lget, std::vector< int >& lgetu ); <a name="l00042"></a>00042 <span class="preprocessor">#endif</span> <a name="l00043"></a>00043 <span class="preprocessor"></span> <a name="l00044"></a>00044 <span class="comment">// make it so that the two TReturns agree on what they are proving</span> <a name="l00045"></a>00045 <span class="comment">// t1 corresponds to the conversion of pf1, proving psi, Y( ps1 ), or Y2( ps1 )</span> <a name="l00046"></a>00046 <span class="comment">// t2 corresponds to the conversion of pf2, proving psi, Y( ps1 ), or Y2( ps1 )</span> <a name="l00047"></a>00047 <span class="comment">// on return, t1->d_proveY should equal t2->d_proveY</span> <a name="l00048"></a>00048 <span class="comment">// this will return the mode they normalized on, -1 means fail</span> <a name="l00049"></a>00049 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classTReturn.html#adf5d458ca36004015a91b8be7dbd341b">normalize_tret</a>( <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& pf1, <a class="code" href="classTReturn.html">TReturn</a>*& t1, <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& pf2, <a class="code" href="classTReturn.html">TReturn</a>*& t2, <span class="keywordtype">bool</span> rev_pol = <span class="keyword">false</span> ); <a name="l00050"></a>00050 <span class="comment">//normalize TReturn to prove a certain type</span> <a name="l00051"></a>00051 <span class="comment">// this will return the mode it normalized on, -1 means fail</span> <a name="l00052"></a>00052 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classTReturn.html#a76fa4cdab1d66c56bc96d3630150f030">normalize_tr</a>( <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& pf1, <a class="code" href="classTReturn.html">TReturn</a>*& t1, <span class="keywordtype">int</span> y, <span class="keywordtype">bool</span> rev_pol = <span class="keyword">false</span>, <span class="keywordtype">bool</span> printErr = <span class="keyword">true</span> ); <a name="l00053"></a>00053 <span class="comment">//normalize from polynomial formula to term formula atom</span> <a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classTReturn.html#a4cb0fc0f38683bd372e4111771c273ef">normalize_to_tf</a>( <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& pf, <a class="code" href="classTReturn.html">TReturn</a>*& t1, <span class="keywordtype">int</span> y ); <a name="l00055"></a>00055 }; <a name="l00056"></a>00056 <a name="l00057"></a>00057 <span class="preprocessor">#endif</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>