Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 583ffa4ba069126c3ba0bc565dc0485a > files > 84

cvc3-doc-2.4.1-1.fc15.noarch.rpm

<!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: bitvector_theorem_producer.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&#160;<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&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;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&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">bitvector_theorem_producer.h</div>  </div>
</div>
<div class="contents">
<a href="bitvector__theorem__producer_8h.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 bitvector_theorem_producer.h</span>
<a name="l00004"></a>00004 <span class="comment"> * \brief TRUSTED implementation of bitvector proof rules</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * Author: Vijay Ganesh</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * Created: Wed May  5 16:10:28 PST 2004</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * &lt;hr&gt;</span>
<a name="l00011"></a>00011 <span class="comment"> *</span>
<a name="l00012"></a>00012 <span class="comment"> * License to use, copy, modify, sell and/or distribute this software</span>
<a name="l00013"></a>00013 <span class="comment"> * and its documentation for any purpose is hereby granted without</span>
<a name="l00014"></a>00014 <span class="comment"> * royalty, subject to the terms and conditions defined in the \ref</span>
<a name="l00015"></a>00015 <span class="comment"> * LICENSE file provided with this distribution.</span>
<a name="l00016"></a>00016 <span class="comment"> *</span>
<a name="l00017"></a>00017 <span class="comment"> * &lt;hr&gt;</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">/*****************************************************************************/</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#ifndef _cvc3__bitvector_theorem_producer_h_</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define _cvc3__bitvector_theorem_producer_h_</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &quot;<a class="code" href="bitvector__proof__rules_8h.html" title="Arithmetic proof rules.">bitvector_proof_rules.h</a>&quot;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;<a class="code" href="theorem__producer_8h.html">theorem_producer.h</a>&quot;</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="keyword">namespace </span>CVC3 {
<a name="l00029"></a>00029 
<a name="l00030"></a>00030   <span class="keyword">class </span>TheoryBitvector;
<a name="l00031"></a>00031 <span class="comment"></span>
<a name="l00032"></a>00032 <span class="comment">  /*! @brief This class implements proof rules for bitvector</span>
<a name="l00033"></a>00033 <span class="comment">   *  normalizers (concatenation normal form, bvplus normal form),</span>
<a name="l00034"></a>00034 <span class="comment">   *  bitblaster rules, other relevant rewrite rules for bv arithmetic</span>
<a name="l00035"></a>00035 <span class="comment">   *  and word-level operators</span>
<a name="l00036"></a>00036 <span class="comment">  */</span><span class="comment"></span>
<a name="l00037"></a>00037 <span class="comment">  /*!</span>
<a name="l00038"></a>00038 <span class="comment">    Author: Vijay Ganesh, May-August, 2004</span>
<a name="l00039"></a>00039 <span class="comment"></span>
<a name="l00040"></a>00040 <span class="comment">  */</span>
<a name="l00041"></a><a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html">00041</a>   <span class="keyword">class </span><a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html" title="This class implements proof rules for bitvector normalizers (concatenation normal form...">BitvectorTheoremProducer</a>:
<a name="l00042"></a>00042     <span class="keyword">public</span> <a class="code" href="classCVC3_1_1BitvectorProofRules.html">BitvectorProofRules</a>, <span class="keyword">public</span> <a class="code" href="classCVC3_1_1TheoremProducer.html">TheoremProducer</a> {
<a name="l00043"></a>00043   <span class="keyword">private</span>:
<a name="l00044"></a><a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#adac6d564649b68cf95c22a82cefbbe72">00044</a>     <a class="code" href="classCVC3_1_1TheoryBitvector.html" title="Theory of bitvectors of known length \ (operations include: @,[i:j],[i],+,.,BVAND,BVNEG)">TheoryBitvector</a>* <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#adac6d564649b68cf95c22a82cefbbe72">d_theoryBitvector</a>; <span class="comment">//! instance of bitvector DP</span>
<a name="l00045"></a>00045 <span class="comment"></span><span class="comment">    //! Constant 1-bit bit-vector 0bin0</span>
<a name="l00046"></a><a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ae3c2817336952a9c84ca8a44db3896e1">00046</a> <span class="comment"></span>    <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ae3c2817336952a9c84ca8a44db3896e1" title="Constant 1-bit bit-vector 0bin0.">d_bvZero</a>;<span class="comment"></span>
<a name="l00047"></a>00047 <span class="comment">    //! Constant 1-bit bit-vector 0bin1</span>
<a name="l00048"></a><a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aed61523f51f9daff35bf4823e9c4c06e">00048</a> <span class="comment"></span>    <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aed61523f51f9daff35bf4823e9c4c06e" title="Constant 1-bit bit-vector 0bin1.">d_bvOne</a>;<span class="comment"></span>
<a name="l00049"></a>00049 <span class="comment">    //! Return cached constant 0bin0</span>
<a name="l00050"></a><a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aaf9905051ca381e18683a41651404b69">00050</a> <span class="comment"></span>    <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aaf9905051ca381e18683a41651404b69" title="Return cached constant 0bin0.">bvZero</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ae3c2817336952a9c84ca8a44db3896e1" title="Constant 1-bit bit-vector 0bin0.">d_bvZero</a>; }<span class="comment"></span>
<a name="l00051"></a>00051 <span class="comment">    //! Return cached constant 0bin1</span>
<a name="l00052"></a><a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a53f5be1f87db3613052a22fcf8a7e5d0">00052</a> <span class="comment"></span>    <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a53f5be1f87db3613052a22fcf8a7e5d0" title="Return cached constant 0bin1.">bvOne</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aed61523f51f9daff35bf4823e9c4c06e" title="Constant 1-bit bit-vector 0bin1.">d_bvOne</a>; }
<a name="l00053"></a>00053 <span class="comment"></span>
<a name="l00054"></a>00054 <span class="comment">    //! Collect all of: a*x1+b*x1 + c*x2-x2 + d*x3 + ~x3 + ~x4 +e into</span>
<a name="l00055"></a>00055 <span class="comment">    //!  (a+b, x1) , (c-1 , x2), (d-1, x3), (-1, x4) and the constant e-2.</span>
<a name="l00056"></a>00056 <span class="comment">    //! The constant is calculated from the formula -x = ~x+1 (or -x-1=~x).</span>
<a name="l00057"></a>00057 <span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ab46305e9bee9f911362cdb54a3037703">collectLikeTermsOfPlus</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e,
<a name="l00058"></a>00058         <a class="code" href="classCVC3_1_1ExprMap.html">ExprMap&lt;Rational&gt;</a> &amp; likeTerms,
<a name="l00059"></a>00059         <a class="code" href="classCVC3_1_1Rational.html">Rational</a> &amp; plusConstant);
<a name="l00060"></a>00060 <span class="comment"></span>
<a name="l00061"></a>00061 <span class="comment">    //! Collect a single coefficient*var pair into likeTerms.</span>
<a name="l00062"></a>00062 <span class="comment">    //! Update the counter of likeTerms[var] += coefficient.</span>
<a name="l00063"></a>00063 <span class="comment">    //! Potentially update the constant additive plusConstant.</span>
<a name="l00064"></a>00064 <span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a6596cca8e249d3ef6632429bd114a98a">collectOneTermOfPlus</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Rational.html">Rational</a> &amp; coefficient,
<a name="l00065"></a>00065             <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; var,
<a name="l00066"></a>00066             <a class="code" href="classCVC3_1_1ExprMap.html">ExprMap&lt;Rational&gt;</a> &amp; likeTerms,
<a name="l00067"></a>00067             <a class="code" href="classCVC3_1_1Rational.html">Rational</a> &amp; plusConstant);
<a name="l00068"></a>00068 <span class="comment"></span>
<a name="l00069"></a>00069 <span class="comment">    //! Create a vector which will form the next PVPLUS.</span>
<a name="l00070"></a>00070 <span class="comment">    //! Use the colleciton of likeTerms, and the constant additive plusConstant</span>
<a name="l00071"></a>00071 <span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a0c47ccc89b98254df839ea35b1a0720d">createNewPlusCollection</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> &amp; e,
<a name="l00072"></a>00072          <span class="keyword">const</span> <a class="code" href="classCVC3_1_1ExprMap.html">ExprMap&lt;Rational&gt;</a> &amp; likeTerms,
<a name="l00073"></a>00073          <a class="code" href="classCVC3_1_1Rational.html">Rational</a> &amp; plusConstant,
<a name="l00074"></a>00074          std::vector&lt;Expr&gt; &amp; result);
<a name="l00075"></a>00075 <span class="comment"></span>
<a name="l00076"></a>00076 <span class="comment">    //! Create expression by applying plus to all elements.</span>
<a name="l00077"></a>00077 <span class="comment">    //! All elements should be normalized and ready.</span>
<a name="l00078"></a>00078 <span class="comment">    //! If there are too few elements, a non BVPLUS expression will be created.</span>
<a name="l00079"></a>00079 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a24fff4a463643869b7a3b604884437b9">sumNormalizedElements</a>(<span class="keywordtype">int</span> bvplusLength,
<a name="l00080"></a>00080              <span class="keyword">const</span> std::vector&lt;Expr&gt;&amp; elements);
<a name="l00081"></a>00081 
<a name="l00082"></a>00082     <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a2a396fdaba828777b1c5277aee4fc69a">getPlusTerms</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <a class="code" href="classCVC3_1_1Rational.html">Rational</a>&amp; known_term, <a class="code" href="classCVC3_1_1ExprMap.html">ExprMap&lt;Rational&gt;</a>&amp; sumHashMap);
<a name="l00083"></a>00083     <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#af6d2296102e85962df7567ed2c09d0b6">buildPlusTerm</a>(<span class="keywordtype">int</span> bv_size, <a class="code" href="classCVC3_1_1Rational.html">Rational</a>&amp; known_term, <a class="code" href="classCVC3_1_1ExprMap.html">ExprMap&lt;Rational&gt;</a>&amp; sumHashMap);
<a name="l00084"></a>00084     <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ab6cc1b10eb60cdf44eabb5a45013477f">chopConcat</a>(<span class="keywordtype">int</span> bv_size, <a class="code" href="classCVC3_1_1Rational.html">Rational</a> c, std::vector&lt;Expr&gt;&amp; concatKids);
<a name="l00085"></a>00085     <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#afd8d2a7f441db7d8a8cf41b83dcc9d0a">okToSplit</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00086"></a>00086 
<a name="l00087"></a>00087   <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00088"></a>00088 <span class="comment">    //! Constructor: constructs an instance of bitvector DP</span>
<a name="l00089"></a>00089 <span class="comment"></span>    <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ab0dec14e43b28a75df52cbef0f767a23" title="Constructor: constructs an instance of bitvector DP.">BitvectorTheoremProducer</a>(<a class="code" href="classCVC3_1_1TheoryBitvector.html" title="Theory of bitvectors of known length \ (operations include: @,[i:j],[i],+,.,BVAND,BVNEG)">TheoryBitvector</a>* theoryBitvector);
<a name="l00090"></a><a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a8be04256f3b26c7932f2c0272ad3f6d1">00090</a>     <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a8be04256f3b26c7932f2c0272ad3f6d1">~BitvectorTheoremProducer</a>() {}
<a name="l00091"></a>00091 
<a name="l00092"></a>00092     <span class="comment">//ExprMap&lt;Expr&gt; d_bvPlusCarryCacheLeftBV;</span>
<a name="l00093"></a>00093     <span class="comment">//ExprMap&lt;Expr&gt; d_bvPlusCarryCacheRightBV;</span>
<a name="l00094"></a>00094 <span class="comment"></span>
<a name="l00095"></a>00095 <span class="comment">    ////////////////////////////////////////////////////////////////////</span>
<a name="l00096"></a>00096 <span class="comment"></span>    <span class="comment">// Partial Canonization rules</span><span class="comment"></span>
<a name="l00097"></a>00097 <span class="comment">    ////////////////////////////////////////////////////////////////////</span>
<a name="l00098"></a>00098 <span class="comment"></span><span class="comment"></span>
<a name="l00099"></a>00099 <span class="comment">    ////////////////////////////////////////////////////////////////////</span>
<a name="l00100"></a>00100 <span class="comment"></span>    <span class="comment">// Bitblasting rules for equations</span><span class="comment"></span>
<a name="l00101"></a>00101 <span class="comment">    ////////////////////////////////////////////////////////////////////</span>
<a name="l00102"></a>00102 <span class="comment"></span><span class="comment"></span>
<a name="l00103"></a>00103 <span class="comment">    /*! \param thm input theorem: (e1[i]&lt;=&gt;e2[i])&lt;=&gt;false</span>
<a name="l00104"></a>00104 <span class="comment">     *</span>
<a name="l00105"></a>00105 <span class="comment">     *  \result (e1=e2)&lt;=&gt;false</span>
<a name="l00106"></a>00106 <span class="comment">     */</span>
<a name="l00107"></a>00107     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a335f389e282bdb6529f86b2101b330e0">bitvectorFalseRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; thm);
<a name="l00108"></a>00108 <span class="comment"></span>
<a name="l00109"></a>00109 <span class="comment">    /*! \param thm input theorem: (~e1[i]&lt;=&gt;e2[i])&lt;=&gt;true</span>
<a name="l00110"></a>00110 <span class="comment">     *</span>
<a name="l00111"></a>00111 <span class="comment">     *  \result (e1!=e2)&lt;=&gt;true</span>
<a name="l00112"></a>00112 <span class="comment">     */</span>
<a name="l00113"></a>00113     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aafe3a19c755d3559e4c419be7c66d7c5">bitvectorTrueRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; thm);
<a name="l00114"></a>00114 <span class="comment"></span>
<a name="l00115"></a>00115 <span class="comment">    /*! \param e input equation: e1=e2 over bitvector terms</span>
<a name="l00116"></a>00116 <span class="comment">     *  \param f formula over the bits of bitvector variables in e:</span>
<a name="l00117"></a>00117 <span class="comment">     *</span>
<a name="l00118"></a>00118 <span class="comment">     *  \result \f[\frac{e_1 = e_2}{\bigwedge_{i=1}^n (e_{1}[i]</span>
<a name="l00119"></a>00119 <span class="comment">     *  \iff e_{2}[i]) } \f] where each of \f[ e_{1}[i], e{2}[i] \f] denotes a</span>
<a name="l00120"></a>00120 <span class="comment">     *  formula over variables in \f[ e_{1}, e_{2} \f] respectively</span>
<a name="l00121"></a>00121 <span class="comment">     */</span>
<a name="l00122"></a>00122     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#adc756096f301c80bb2bf73266c200aff">bitBlastEqnRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; f);
<a name="l00123"></a>00123 <span class="comment"></span>
<a name="l00124"></a>00124 <span class="comment">    /*! \param e : input disequality: e1 != e2 over bitvector terms</span>
<a name="l00125"></a>00125 <span class="comment">     *  \param f : formula over the bits of bitvector variables in e:</span>
<a name="l00126"></a>00126 <span class="comment">     *</span>
<a name="l00127"></a>00127 <span class="comment">     *  \result \f[\frac{e_1 \not = e_2}{\bigwedge_{i=1}^n ((\neg e_{1}[i])</span>
<a name="l00128"></a>00128 <span class="comment">     *  \iff e_{2}[i]) } \f] where each of \f[ e_{1}[i], e{2}[i] \f] denotes a</span>
<a name="l00129"></a>00129 <span class="comment">     *  formula over variables in \f[ e_{1}, e_{2} \f] respectively</span>
<a name="l00130"></a>00130 <span class="comment">     */</span>
<a name="l00131"></a>00131     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a9839f27db5f349fe6fb6b21575cde24c">bitBlastDisEqnRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; e, <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; f);
<a name="l00132"></a>00132 
<a name="l00133"></a>00133 <span class="comment"></span>
<a name="l00134"></a>00134 <span class="comment">    ////////////////////////////////////////////////////////////////////</span>
<a name="l00135"></a>00135 <span class="comment"></span>    <span class="comment">// Bitblasting and rewrite rules for Inequations</span><span class="comment"></span>
<a name="l00136"></a>00136 <span class="comment">    ////////////////////////////////////////////////////////////////////</span>
<a name="l00137"></a>00137 <span class="comment"></span><span class="comment"></span>
<a name="l00138"></a>00138 <span class="comment">    //! sign extend the input SX(e) appropriately</span>
<a name="l00139"></a>00139 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ae676208401e0d94c96d258f2dd652a68" title="sign extend the input SX(e) appropriately">signExtendRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00140"></a>00140 <span class="comment"></span>
<a name="l00141"></a>00141 <span class="comment">    //! Pad the kids of BVLT/BVLE to make their length equal</span>
<a name="l00142"></a>00142 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ac83f1aeaf2b0dd78c5aec3d4dd605b21" title="Pad the kids of BVLT/BVLE to make their length equal.">padBVLTRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <span class="keywordtype">int</span> len);
<a name="l00143"></a>00143 <span class="comment"></span>
<a name="l00144"></a>00144 <span class="comment">    //! Sign Extend the kids of BVSLT/BVSLE to make their length equal</span>
<a name="l00145"></a>00145 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ab1f7b6923eb8053bbc567f7610458685" title="Sign Extend the kids of BVSLT/BVSLE to make their length equal.">padBVSLTRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <span class="keywordtype">int</span> len);
<a name="l00146"></a>00146 <span class="comment"></span>
<a name="l00147"></a>00147 <span class="comment">    /*! input: e0 &lt;=(s) e1. output depends on whether the topbits(MSB) of</span>
<a name="l00148"></a>00148 <span class="comment">     *  e0 and e1 are constants. If they are constants then optimizations</span>
<a name="l00149"></a>00149 <span class="comment">     *  are done, otherwise the following rule is implemented.</span>
<a name="l00150"></a>00150 <span class="comment">     *</span>
<a name="l00151"></a>00151 <span class="comment">     *  e0 &lt;=(s) e1 &lt;==&gt; (e0[n-1] AND NOT e1[n-1]) OR</span>
<a name="l00152"></a>00152 <span class="comment">     *                   (e0[n-1] AND e1[n-1] AND e1[n-2:0] &lt;= e0[n-2:0]) OR</span>
<a name="l00153"></a>00153 <span class="comment">     *                   (NOT e0[n-1] AND NOT e1[n-1] AND e0[n-2:0] &lt;= e1[n-2:0])</span>
<a name="l00154"></a>00154 <span class="comment">     */</span>
<a name="l00155"></a>00155     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a1798c9272bc8f7f78100a4fb839fb907">signBVLTRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e,
<a name="l00156"></a>00156        <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; topBit0,
<a name="l00157"></a>00157        <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; topBit1);
<a name="l00158"></a>00158 <span class="comment"></span>
<a name="l00159"></a>00159 <span class="comment">    /*! NOT(e[0][0] = e[0][1]) &lt;==&gt; e[0][0] = ~e[0][1]</span>
<a name="l00160"></a>00160 <span class="comment">     */</span>
<a name="l00161"></a>00161     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aff7d8a5558884d2b24e83dc55dc0a59e">notBVEQ1Rule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00162"></a>00162 <span class="comment"></span>
<a name="l00163"></a>00163 <span class="comment">    /*! NOT(e[0][0] &lt; e[0][1]) &lt;==&gt; (e[0][1] &lt;= e[0][0]),</span>
<a name="l00164"></a>00164 <span class="comment">     *  NOT(e[0][0] &lt;= e[0][1]) &lt;==&gt; (e[0][1] &lt; e[0][0])</span>
<a name="l00165"></a>00165 <span class="comment">     */</span>
<a name="l00166"></a>00166     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a15d14a25e4805c5aceff3521f7dbebd0">notBVLTRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00167"></a>00167 <span class="comment"></span>
<a name="l00168"></a>00168 <span class="comment">    //! if(lhs==rhs) then we have (lhs &lt; rhs &lt;==&gt; false),(lhs &lt;= rhs &lt;==&gt; true)</span>
<a name="l00169"></a>00169 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aa9b8579a600e0c95fbc51a599b03a182" title="if(lhs==rhs) then we have (lhs &lt; rhs &lt;==&gt; false),(lhs &lt;= rhs &lt;==&gt; true)">lhsEqRhsIneqn</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <span class="keywordtype">int</span> kind);
<a name="l00170"></a>00170 
<a name="l00171"></a>00171     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ac141b7dc72e52b9b18fd2258db17a952" title="|= 0 &lt;= foo &lt;-&gt; TRUE">zeroLeq</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00172"></a>00172     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a00a6af751fe6354bfd282f5a8f25456a" title="if indeed e[0] &lt; e[1] then (e&lt;==&gt;true) else (e&lt;==&gt;false)">bvConstIneqn</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <span class="keywordtype">int</span> kind);
<a name="l00173"></a>00173 
<a name="l00174"></a>00174     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a9e41265f17a1d607e9559bb718963f0a">generalIneqn</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e,
<a name="l00175"></a>00175        <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; lhs_i,
<a name="l00176"></a>00176        <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; rhs_i, <span class="keywordtype">int</span> kind);
<a name="l00177"></a>00177 <span class="comment"></span>
<a name="l00178"></a>00178 <span class="comment">    ////////////////////////////////////////////////////////////////////</span>
<a name="l00179"></a>00179 <span class="comment"></span>    <span class="comment">// Bitblasting rules for terms</span><span class="comment"></span>
<a name="l00180"></a>00180 <span class="comment">    ////////////////////////////////////////////////////////////////////</span>
<a name="l00181"></a>00181 <span class="comment"></span>
<a name="l00182"></a>00182     <span class="comment">// Input: |- BOOLEXTRACT(a,0) &lt;=&gt; bc_0, ... BOOLEXTRACT(a,n-1) &lt;=&gt; bc_(n-1)</span>
<a name="l00183"></a>00183     <span class="comment">// where each bc_0 is TRUE or FALSE</span>
<a name="l00184"></a>00184     <span class="comment">// Output: |- a = c</span>
<a name="l00185"></a>00185     <span class="comment">// where c is an n-bit constant made from the values bc_0..bc_(n-1)</span>
<a name="l00186"></a>00186     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a70fb1053bd8518120c0d69dca9069062">bitExtractAllToConstEq</a>(std::vector&lt;Theorem&gt;&amp; thms);<span class="comment"></span>
<a name="l00187"></a>00187 <span class="comment">    //! t[i] ==&gt; t[i:i] = 0bin1   or    NOT t[i] ==&gt; t[i:i] = 0bin0</span>
<a name="l00188"></a>00188 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ae7cdd320c7fb8e16f943626d07d9f63b" title="t[i] ==&gt; t[i:i] = 0bin1 or NOT t[i] ==&gt; t[i:i] = 0bin0">bitExtractToExtract</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; thm);<span class="comment"></span>
<a name="l00189"></a>00189 <span class="comment">    //! t[i] &lt;=&gt; t[i:i][0]   (to use rewriter for simplifying t[i:i])</span>
<a name="l00190"></a>00190 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a8dab3dc6ffdf47a18f6097ad0185b4de" title="t[i] &lt;=&gt; t[i:i][0] (to use rewriter for simplifying t[i:i])">bitExtractRewrite</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; x);
<a name="l00191"></a>00191 <span class="comment"></span>
<a name="l00192"></a>00192 <span class="comment">    /*! \param x : input1 is bitvector constant</span>
<a name="l00193"></a>00193 <span class="comment">     *  \param i : input2 is extracted bitposition</span>
<a name="l00194"></a>00194 <span class="comment">     *</span>
<a name="l00195"></a>00195 <span class="comment">     *  \result \f[ \frac{}{\mathrm{BOOLEXTRACT(x,i)} \iff</span>
<a name="l00196"></a>00196 <span class="comment">     *  \mathrm{TRUE}} \f], if bitposition has a 1; \f[</span>
<a name="l00197"></a>00197 <span class="comment">     *  \frac{}{\mathrm{BOOLEXTRACT(x,i)} \iff \mathrm{FALSE}} \f], if</span>
<a name="l00198"></a>00198 <span class="comment">     *  the bitposition has a 0</span>
<a name="l00199"></a>00199 <span class="comment">     */</span>
<a name="l00200"></a>00200     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ad14158d7d8b6a1ccf2b6c47991d498d7">bitExtractConstant</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> &amp; x, <span class="keywordtype">int</span> i);
<a name="l00201"></a>00201 <span class="comment"></span>
<a name="l00202"></a>00202 <span class="comment">    /*! \param x : input1 is bitvector binary concatenation</span>
<a name="l00203"></a>00203 <span class="comment">     *  \param i : input2 is extracted bitposition</span>
<a name="l00204"></a>00204 <span class="comment">     *</span>
<a name="l00205"></a>00205 <span class="comment">     *  \result \f[ \frac{}{(t_{[m]}@q_{[n]})[i] \iff (q_{[n]})[i]}</span>
<a name="l00206"></a>00206 <span class="comment">     *  \f], where \f[ 0 \geq i \geq n-1 \f], another case of</span>
<a name="l00207"></a>00207 <span class="comment">     *  boolextract over concatenation is:</span>
<a name="l00208"></a>00208 <span class="comment">     *  \f[\frac{}{(t_{[m]}@q_{[n]})[i] \iff (t_{[m]})[i-n]} \f],</span>
<a name="l00209"></a>00209 <span class="comment">     *  where \f[ n \geq i \geq m+n-1 \f]</span>
<a name="l00210"></a>00210 <span class="comment">     */</span>
<a name="l00211"></a>00211     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a571db5dc21ec0b24e1d861c137892f9c">bitExtractConcatenation</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> &amp; x, <span class="keywordtype">int</span> i);
<a name="l00212"></a>00212 <span class="comment"></span>
<a name="l00213"></a>00213 <span class="comment">    /*! \param t : input1 is bitvector binary BVMULT. x[0] must be BVCONST</span>
<a name="l00214"></a>00214 <span class="comment">     *  \param i : input2 is extracted bitposition</span>
<a name="l00215"></a>00215 <span class="comment">     *</span>
<a name="l00216"></a>00216 <span class="comment">     *  \result bitblast of BVMULT</span>
<a name="l00217"></a>00217 <span class="comment">     */</span>
<a name="l00218"></a>00218     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#abf6f1ff706f6cefe196b1cbe7d5f85c1">bitExtractConstBVMult</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; t, <span class="keywordtype">int</span> i);
<a name="l00219"></a>00219 <span class="comment"></span>
<a name="l00220"></a>00220 <span class="comment">    /*! \param t : input1 is bitvector binary BVMULT. t[0] must not be BVCONST</span>
<a name="l00221"></a>00221 <span class="comment">     *  \param i : input2 is extracted bitposition</span>
<a name="l00222"></a>00222 <span class="comment">     *</span>
<a name="l00223"></a>00223 <span class="comment">     *  \result bitblast of BVMULT</span>
<a name="l00224"></a>00224 <span class="comment">     */</span>
<a name="l00225"></a>00225     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a0425488c3b01eb65554867483e3cac02">bitExtractBVMult</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; t, <span class="keywordtype">int</span> i);
<a name="l00226"></a>00226 <span class="comment"></span>
<a name="l00227"></a>00227 <span class="comment">    /*! \param x : input1 is bitvector extraction [k:j]</span>
<a name="l00228"></a>00228 <span class="comment">     *  \param i : input2 is extracted bitposition</span>
<a name="l00229"></a>00229 <span class="comment">     *</span>
<a name="l00230"></a>00230 <span class="comment">     *  \result \f[ \frac{}{(t_{[n]}[k:j])[i] \iff (t_{[n]})[i+j]}</span>
<a name="l00231"></a>00231 <span class="comment">     *  \f], where \f[ 0 \geq j \geq k &lt; n, 0 \geq i &lt; k-j \f]</span>
<a name="l00232"></a>00232 <span class="comment">     */</span>
<a name="l00233"></a>00233     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a8efcf949614eab1089f00519f1db57bb">bitExtractExtraction</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> &amp; x, <span class="keywordtype">int</span> i);
<a name="l00234"></a>00234 <span class="comment"></span>
<a name="l00235"></a>00235 <span class="comment">    /*! \param t1 : input1 is vector of bitblasts of t, from bit i-1 to 0</span>
<a name="l00236"></a>00236 <span class="comment">     *  \param t2 : input2 is vector of bitblasts of q, from bit i-1 to 0</span>
<a name="l00237"></a>00237 <span class="comment">     *  \param bvPlusTerm : input3 is BVPLUS term: BVPLUS(n,t,q)</span>
<a name="l00238"></a>00238 <span class="comment">     *  \param i  : input4 is extracted bitposition</span>
<a name="l00239"></a>00239 <span class="comment">     *</span>
<a name="l00240"></a>00240 <span class="comment">     *  \result The base case is: \f[</span>
<a name="l00241"></a>00241 <span class="comment">     *  \frac{}{(\mathrm{BVPLUS}(n,t,q))[0] \iff t[0] \oplus q[0]}</span>
<a name="l00242"></a>00242 <span class="comment">     *  \f], when \f[ 0 &lt; i \leq n-1 \f], we have \f[</span>
<a name="l00243"></a>00243 <span class="comment">     *  \frac{}{(\mathrm{BVPLUS}(n,t,q))[i] \iff t[i] \oplus q[i]</span>
<a name="l00244"></a>00244 <span class="comment">     *  \oplus c(t,q,i)} \f], where c(t,q,i) is the carry generated</span>
<a name="l00245"></a>00245 <span class="comment">     *  by the addition of bits from 0 to i-1</span>
<a name="l00246"></a>00246 <span class="comment">     */</span>
<a name="l00247"></a>00247     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a6c02b66248026d3ffb357e980de37ed7">bitExtractBVPlus</a>(<span class="keyword">const</span> std::vector&lt;Theorem&gt;&amp; t1,
<a name="l00248"></a>00248            <span class="keyword">const</span> std::vector&lt;Theorem&gt;&amp; t2,
<a name="l00249"></a>00249            <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; bvPlusTerm, <span class="keywordtype">int</span> i);
<a name="l00250"></a>00250 
<a name="l00251"></a>00251     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aaf4999f69872e881257cd1e127732ec8">bitExtractBVPlusPreComputed</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; t1_i,
<a name="l00252"></a>00252           <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; t2_i,
<a name="l00253"></a>00253           <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; bvPlusTerm,
<a name="l00254"></a>00254           <span class="keywordtype">int</span> bitPos,
<a name="l00255"></a>00255           <span class="keywordtype">int</span> precomputed);
<a name="l00256"></a>00256 <span class="comment"></span>
<a name="l00257"></a>00257 <span class="comment">    /*! \param bvPlusTerm : input1 is bvPlusTerm, a BVPLUS term with</span>
<a name="l00258"></a>00258 <span class="comment">     *  arity &gt; 2</span>
<a name="l00259"></a>00259 <span class="comment">     *</span>
<a name="l00260"></a>00260 <span class="comment">     *  \result : output is iff-Theorem: bvPlusTerm &lt;==&gt; outputTerm,</span>
<a name="l00261"></a>00261 <span class="comment">     *  where outputTerm is an equivalent BINARY bvplus.</span>
<a name="l00262"></a>00262 <span class="comment">     */</span>
<a name="l00263"></a>00263     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a415c16ecc3bbdd0942801028526d641f">bvPlusAssociativityRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; bvPlusTerm);
<a name="l00264"></a>00264 <span class="comment"></span>
<a name="l00265"></a>00265 <span class="comment">    /*! \param x : input1 is bitwise NEGATION</span>
<a name="l00266"></a>00266 <span class="comment">     *  \param i : input2 is extracted bitposition</span>
<a name="l00267"></a>00267 <span class="comment">     *</span>
<a name="l00268"></a>00268 <span class="comment">     *  \result \f[ \frac{}{(\sim t_{[n]})[i] \iff \neg (t_{[n]}[i])}</span>
<a name="l00269"></a>00269 <span class="comment">     *  \f]</span>
<a name="l00270"></a>00270 <span class="comment">     */</span>
<a name="l00271"></a>00271     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a43201ddd283a81a44095658241ca2a5e">bitExtractNot</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> &amp; x, <span class="keywordtype">int</span> i);
<a name="l00272"></a>00272 <span class="comment"></span>
<a name="l00273"></a>00273 <span class="comment">    //! Extract from bitwise AND, OR, or XOR</span>
<a name="l00274"></a>00274 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#acd7ddad997b468fbb64373913e03b5e9" title="Extract from bitwise AND, OR, or XOR.">bitExtractBitwise</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; x, <span class="keywordtype">int</span> i, <span class="keywordtype">int</span> kind);
<a name="l00275"></a>00275 <span class="comment"></span>
<a name="l00276"></a>00276 <span class="comment">    /*! \param x : input1 is bitvector FIXED SHIFT \f[ e_{[n]} \ll k \f]</span>
<a name="l00277"></a>00277 <span class="comment">     *  \param i : input2 is extracted bitposition</span>
<a name="l00278"></a>00278 <span class="comment">     *</span>
<a name="l00279"></a>00279 <span class="comment">     *  \result \f[\frac{}{(e_{[n]} \ll k)[i] \iff \mathrm{FALSE}}</span>
<a name="l00280"></a>00280 <span class="comment">     *  \f], if 0 &lt;= i &lt; k. however, if k &lt;= i &lt; n then, result is</span>
<a name="l00281"></a>00281 <span class="comment">     *  \f[\frac{}{(e_{[n]} \ll k)[i] \iff e_{[n]}[i]} \f]</span>
<a name="l00282"></a>00282 <span class="comment">     */</span>
<a name="l00283"></a>00283     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a4153b23dadd58aea7bde7f71001aad91">bitExtractFixedLeftShift</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> &amp; x, <span class="keywordtype">int</span> i);
<a name="l00284"></a>00284 
<a name="l00285"></a>00285     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a2db4c3bb12bae8276f7c542936989d83">bitExtractFixedRightShift</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> &amp; x, <span class="keywordtype">int</span> i);
<a name="l00286"></a>00286 
<a name="l00287"></a>00287     <span class="comment">// BOOLEXTRACT(bvshl(t,s),i) &lt;=&gt; ((s = 0) AND BOOLEXTRACT(t,i)) OR</span>
<a name="l00288"></a>00288     <span class="comment">//                               ((s = 1) AND BOOLEXTRACT(t,i-1)) OR ...</span>
<a name="l00289"></a>00289     <span class="comment">//                               ((s = i) AND BOOLEXTRACT(t,0))</span>
<a name="l00290"></a>00290     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a2b273a0a3bb7a39646f0fb065e954ccc">bitExtractBVSHL</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> &amp; x, <span class="keywordtype">int</span> i);
<a name="l00291"></a>00291 
<a name="l00292"></a>00292     <span class="comment">// BOOLEXTRACT(bvlshr(t,s),i) &lt;=&gt; ((s = 0) AND BOOLEXTRACT(t,i)) OR</span>
<a name="l00293"></a>00293     <span class="comment">//                                ((s = 1) AND BOOLEXTRACT(t,i+1)) OR ...</span>
<a name="l00294"></a>00294     <span class="comment">//                                ((s = n-1-i) AND BOOLEXTRACT(t,n-1))</span>
<a name="l00295"></a>00295     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#afc17991261fb1f240861496d391c452a">bitExtractBVLSHR</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> &amp; x, <span class="keywordtype">int</span> i);
<a name="l00296"></a>00296 
<a name="l00297"></a>00297     <span class="comment">// BOOLEXTRACT(bvashr(t,s),i) &lt;=&gt; ((s = 0) AND BOOLEXTRACT(t,i)) OR</span>
<a name="l00298"></a>00298     <span class="comment">//                                ((s = 1) AND BOOLEXTRACT(t,i+1)) OR ...</span>
<a name="l00299"></a>00299     <span class="comment">//                                ((s &gt;= n-1-i) AND BOOLEXTRACT(t,n-1))</span>
<a name="l00300"></a>00300     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ad9256452fce83e6505d94f2a11b2a463">bitExtractBVASHR</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> &amp; x, <span class="keywordtype">int</span> i);
<a name="l00301"></a>00301 <span class="comment"></span>
<a name="l00302"></a>00302 <span class="comment">    /*! \param e : input1 is bitvector term</span>
<a name="l00303"></a>00303 <span class="comment">     *  \param r : input2 is extracted bitposition</span>
<a name="l00304"></a>00304 <span class="comment">     *</span>
<a name="l00305"></a>00305 <span class="comment">     *  \result we check if r &gt; bvlength(e). if yes, then return</span>
<a name="l00306"></a>00306 <span class="comment">     *  BOOLEXTRACT(e,r) &lt;==&gt; FALSE; else raise soundness</span>
<a name="l00307"></a>00307 <span class="comment">     *  exception. (Note: this rule is used in BVPLUS bitblast</span>
<a name="l00308"></a>00308 <span class="comment">     *  function)</span>
<a name="l00309"></a>00309 <span class="comment">     */</span>
<a name="l00310"></a>00310     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a6c59521b4540e2acd1fe954272bf3e09">zeroPaddingRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <span class="keywordtype">int</span> r);
<a name="l00311"></a>00311 
<a name="l00312"></a>00312     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a1d749524ddb67fa00fc4da46df1156c9" title="bitExtractSXRule">bitExtractSXRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <span class="keywordtype">int</span> i);
<a name="l00313"></a>00313 <span class="comment"></span>
<a name="l00314"></a>00314 <span class="comment">    //! c1=c2 &lt;=&gt; TRUE/FALSE (equality of constant bitvectors)</span>
<a name="l00315"></a>00315 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aaa38beb3d8990340aa5867f09900f14e" title="c1=c2 &lt;=&gt; TRUE/FALSE (equality of constant bitvectors)">eqConst</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00316"></a>00316 <span class="comment">    //! |- c1=c2 ==&gt; |- AND(c1[i:i] = c2[i:i]) - expanding equalities into bits</span>
<a name="l00317"></a>00317 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a58ce4c07a8d005fa6d9820abc5fac028" title="|- c1=c2 ==&gt; |- AND(c1[i:i] = c2[i:i]) - expanding equalities into bits">eqToBits</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; eq);<span class="comment"></span>
<a name="l00318"></a>00318 <span class="comment">    //! t&lt;&lt;n = c @ 0bin00...00, takes e == (t&lt;&lt;n)</span>
<a name="l00319"></a>00319 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a68fd84ca46b0e62103314c45dee495bd" title="t&lt;&lt;n = c @ 0bin00...00, takes e == (t&lt;&lt;n)">leftShiftToConcat</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00320"></a>00320 <span class="comment">    //! t&lt;&lt;n = c @ 0bin00...00, takes e == (t&lt;&lt;n)</span>
<a name="l00321"></a>00321 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aabb5f8d91314adc4688e5970b986edf0" title="t&lt;&lt;n = c @ 0bin00...00, takes e == (t&lt;&lt;n)">constWidthLeftShiftToConcat</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00322"></a>00322 <span class="comment">    //! t&gt;&gt;m = 0bin00...00 @ t[bvlength-1:m], takes e == (t&gt;&gt;n)</span>
<a name="l00323"></a>00323 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a7d91d285e929d00572f3da4da772f505" title="t&gt;&gt;m = 0bin00...00 @ t[bvlength-1:m], takes e == (t&gt;&gt;n)">rightShiftToConcat</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00324"></a>00324 <span class="comment">    //! BVSHL(t,c) = t[n-c,0] @ 0bin00...00</span>
<a name="l00325"></a>00325 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ae47b2ec2a40c3376071ed60c16d457b6" title="BVSHL(t,c) = t[n-c,0] @ 0bin00...00.">bvshlToConcat</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00326"></a>00326 <span class="comment">    //! BVSHL(t,c) = IF (c = 0) THEN t ELSE IF (c = 1) ...</span>
<a name="l00327"></a>00327 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a431507c9e35ad328509072cea05f2d8e" title="BVSHL(t,c) = IF (c = 0) THEN t ELSE IF (c = 1) ...">bvshlSplit</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00328"></a>00328 <span class="comment">    //! BVLSHR(t,c) = 0bin00...00 @ t[n-1,c]</span>
<a name="l00329"></a>00329 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a5f99ee62c0847affeb44264840764b43" title="BVLSHR(t,c) = 0bin00...00 @ t[n-1,c].">bvlshrToConcat</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00330"></a>00330 <span class="comment">    //! All shifts over a 0 constant = 0</span>
<a name="l00331"></a>00331 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a61b2ded76e35d870b15502ab0641010d" title="All shifts over a 0 constant = 0.">bvShiftZero</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00332"></a>00332 <span class="comment">    //! BVASHR(t,c) = SX(t[n-1,c], n-1)</span>
<a name="l00333"></a>00333 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a3c3a4d49d47a08a3eb7599327f30f324" title="BVASHR(t,c) = SX(t[n-1,c], n-1)">bvashrToConcat</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00334"></a>00334 <span class="comment">    //! a XNOR b &lt;=&gt; (~a &amp; ~b) | (a &amp; b)</span>
<a name="l00335"></a>00335 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a70ad43279f8061f7be4e35c49205ab69" title="a XNOR b &lt;=&gt; (~a &amp; ~b) | (a &amp; b)">rewriteXNOR</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00336"></a>00336 <span class="comment">    //! a NAND b &lt;=&gt; ~(a &amp; b)</span>
<a name="l00337"></a>00337 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a2d49a06be7aae5f5675977fdc1b6457e" title="a NAND b &lt;=&gt; ~(a &amp; b)">rewriteNAND</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00338"></a>00338 <span class="comment">    //! a NOR b &lt;=&gt; ~(a | b)</span>
<a name="l00339"></a>00339 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a372c699b42bb9ab8b64e2a836bedcffd" title="a NOR b &lt;=&gt; ~(a | b)">rewriteNOR</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00340"></a>00340 <span class="comment">    //! BVCOMP(a,b) &lt;=&gt; ITE(a=b,0bin1,0bin0)</span>
<a name="l00341"></a>00341 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ab314017086d977ee1f4facb23208864c" title="BVCOMP(a,b) &lt;=&gt; ITE(a=b,0bin1,0bin0)">rewriteBVCOMP</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00342"></a>00342 <span class="comment">    //! a - b &lt;=&gt; a + (-b)</span>
<a name="l00343"></a>00343 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a1a040de059cc4fedf5cdd00cec37fc9c" title="a - b &lt;=&gt; a + (-b)">rewriteBVSub</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00344"></a>00344 <span class="comment">    //! k*t = BVPLUS(n, &lt;sum of shifts of t&gt;) -- translation of k*t to BVPLUS</span>
<a name="l00345"></a>00345 <span class="comment"></span><span class="comment">    /*! If k = 2^m, return k*t = t\@0...0 */</span>
<a name="l00346"></a>00346     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a560ad9ec684e523f941c2d12fa833cd1" title="k*t = BVPLUS(n, &lt;sum of shifts of t&gt;) -- translation of k*t to BVPLUS">constMultToPlus</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00347"></a>00347 <span class="comment">    //! 0bin0...0 @ BVPLUS(n, args) = BVPLUS(n+k, args)</span>
<a name="l00348"></a>00348 <span class="comment"></span><span class="comment">    /*! where k is the size of the 0bin0...0 */</span>
<a name="l00349"></a>00349     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#af734405e15de47e28f4112e07bfc9dba" title="0bin0...0 @ BVPLUS(n, args) = BVPLUS(n+k, args)">bvplusZeroConcatRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00350"></a>00350 
<a name="l00351"></a>00351 <span class="comment"></span>
<a name="l00352"></a>00352 <span class="comment">    ///////////////////////////////////////////////////////////////////</span>
<a name="l00353"></a>00353 <span class="comment">    /////  Bvplus Normal Form rules</span>
<a name="l00354"></a>00354 <span class="comment">    ///////////////////////////////////////////////////////////////////</span>
<a name="l00355"></a>00355 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a6d773885e3e78a736cd22dd79835b9e3">zeroCoeffBVMult</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00356"></a>00356     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a916fcffc7cb40f2159b00a710c26f669">oneCoeffBVMult</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00357"></a>00357     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a9ed93437abb38597bbf7d153184c70e5" title="t1*a &lt;==&gt; a*t1">flipBVMult</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00358"></a>00358 <span class="comment">    //! converts e to a bitvector of length rat</span>
<a name="l00359"></a>00359 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a99694606f15f144080a21f142b8a098f" title="converts e to a bitvector of length rat">pad</a>(<span class="keywordtype">int</span> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ae03f092d2050783885e338b5880b2645">rat</a>, <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00360"></a>00360     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aa3d3d7bff1a088fa66a19076c471571a" title="Pad the kids of BVMULT to make their bvLength = # of output-bits.">padBVPlus</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00361"></a>00361     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ac8509af4659a1391e983939d825f0e85" title="Pad the kids of BVMULT to make their bvLength = # of output-bits.">padBVMult</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00362"></a>00362     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a67921f96646d6b01d62d8a1cd116ddb3" title="a*(b*t) &lt;==&gt; (a*b)*t, where a,b,t have same bvLength">bvConstMultAssocRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00363"></a>00363     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#afa7daebdee6dafd361980583b6d3ffe1" title="(t1*t2)*t3 &lt;==&gt; t1*(t2*t3), where t1&lt;t2&lt;t3">bvMultAssocRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00364"></a>00364     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a44e37a65f45da9fb8469a0003a140836" title="a*(t1+...+tn) &lt;==&gt; (a*t1+...+a*tn), where all kids are equibvLength">bvMultDistRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00365"></a>00365     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a2a66e5fbe24e038a79ac07290900fdd4" title="input BVPLUS expression e.output e &lt;==&gt; e&#39;, where e&#39; has no BVPLUS">flattenBVPlus</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00366"></a>00366     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a2a6308a817bfe26b843612fd02ba5441">combineLikeTermsRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00367"></a>00367     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a85f807faae622c7c6cb9d85cad0c5fc3">lhsMinusRhsRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00368"></a>00368     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a5df17d5d90f8a7389808a870a90ae863" title="(x *[n] y)[m:k] = (x *[m+1] y)[m:k], where m &lt; n">extractBVMult</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00369"></a>00369     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aabeacfb4b8a65744ac53f2cfe5dadc74" title="(x +[n] y)[m:k] = (x +[m+1] y)[m:k], where m &lt; n">extractBVPlus</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00370"></a>00370 <span class="comment">    //! ite(c,t1,t2)[i:j] &lt;=&gt; ite(c,t1[i:j],t2[i:j])</span>
<a name="l00371"></a>00371 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a35d8c914e411c866485e17febed62c00" title="ite(c,t1,t2)[i:j] &lt;=&gt; ite(c,t1[i:j],t2[i:j])">iteExtractRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00372"></a>00372 <span class="comment">    //! ~ite(c,t1,t2) &lt;=&gt; ite(c,~t1,~t2)</span>
<a name="l00373"></a>00373 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a5bd890187bf9297b3b1092c623c1d922" title="~ite(c,t1,t2) &lt;=&gt; ite(c,~t1,~t2)">iteBVnegRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00374"></a>00374 
<a name="l00375"></a>00375     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ac0f04eeb2cf6b89dbbcf8849bea4e40b">bvuminusBVConst</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00376"></a>00376     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a84fcae86e983ecd86c77705c8a749576">bvuminusBVMult</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00377"></a>00377     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a256b7d97aae2e5933ac4a9161c2da211">bvuminusBVUminus</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00378"></a>00378     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a6c8e614b400899e9f7e28cbfb6129a2a">bvuminusVar</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00379"></a>00379     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a4b76e0978912f6211ce0549cb9dd8550" title="c*(-t) &lt;==&gt; (-c)*t">bvmultBVUminus</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00380"></a>00380 <span class="comment">    //! -t &lt;==&gt; ~t+1</span>
<a name="l00381"></a>00381 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a4ede1f1385025a1621114addc25569c1" title="generic rule used for bitblasting step. -e &lt;==&gt; ~e+1">bvuminusToBVPlus</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00382"></a>00382 <span class="comment">    //! -(c1*t1+...+cn*tn) &lt;==&gt; (-(c1*t1)+...+-(cn*tn))</span>
<a name="l00383"></a>00383 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a126c38f580c510745dacd0dea2cb5c15">bvuminusBVPlus</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00384"></a>00384 
<a name="l00385"></a>00385 <span class="comment"></span>
<a name="l00386"></a>00386 <span class="comment">    ///////////////////////////////////////////////////////////////////</span>
<a name="l00387"></a>00387 <span class="comment">    /////  Concatenation Normal Form rules</span>
<a name="l00388"></a>00388 <span class="comment">    ///////////////////////////////////////////////////////////////////</span>
<a name="l00389"></a>00389 <span class="comment"></span>
<a name="l00390"></a>00390     <span class="comment">// Extraction rules</span>
<a name="l00391"></a>00391 <span class="comment"></span>
<a name="l00392"></a>00392 <span class="comment">    //! c1[i:j] = c  (extraction from a constant bitvector)</span>
<a name="l00393"></a>00393 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a8c0923ca7a786c2a7ee60cc7b456a9e0" title="c1[i:j] = c (extraction from a constant bitvector)">extractConst</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00394"></a>00394 <span class="comment">    //! t[n-1:0] = t  for n-bit t</span>
<a name="l00395"></a>00395 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a8f8cd95c4037ee94e91ba93fe7d869c0" title="t[n-1:0] = t for n-bit t">extractWhole</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00396"></a>00396 <span class="comment">    //! t[i:j][k:l] = t[k+j:l+j]  (eliminate double extraction)</span>
<a name="l00397"></a>00397 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a5c7969edaba735a5f73258b57ea42184" title="t[i:j][k:l] = t[k+j:l+j] (eliminate double extraction)">extractExtract</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00398"></a>00398 <span class="comment">    //! (t1 @ t2)[i:j] = t1[...] @ t2[...]  (push extraction through concat)</span>
<a name="l00399"></a>00399 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ad3f6288f648cee583f8dfee29fc97112" title="(t1 @ t2)[i:j] = t1[...] @ t2[...] (push extraction through concat)">extractConcat</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00400"></a>00400 <span class="comment"></span>
<a name="l00401"></a>00401 <span class="comment">    //! Auxiliary function: (t1 op t2)[i:j] = t1[i:j] op t2[i:j]</span>
<a name="l00402"></a>00402 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a222240751acfa38ed43f717c803aca34" title="Auxiliary function: (t1 op t2)[i:j] = t1[i:j] op t2[i:j].">extractBitwise</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <span class="keywordtype">int</span> kind, <span class="keyword">const</span> std::string&amp; name);<span class="comment"></span>
<a name="l00403"></a>00403 <span class="comment">    //! (t1 &amp; t2)[i:j] = t1[i:j] &amp; t2[i:j]  (push extraction through OR)</span>
<a name="l00404"></a>00404 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a0b3d60749f5bc14f524e0f5234bb1cf3" title="(t1 &amp; t2)[i:j] = t1[i:j] &amp; t2[i:j] (push extraction through OR)">extractAnd</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00405"></a>00405 <span class="comment">    //! (t1 | t2)[i:j] = t1[i:j] | t2[i:j]  (push extraction through AND)</span>
<a name="l00406"></a>00406 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a7a8f90ee8e8450bcb4bfe3e1f231c4b0" title="(t1 | t2)[i:j] = t1[i:j] | t2[i:j] (push extraction through AND)">extractOr</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00407"></a>00407 <span class="comment">    //! (~t)[i:j] = ~(t[i:j]) (push extraction through NEG)</span>
<a name="l00408"></a>00408 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a8014d2c21597d514e39a4fba8a060952" title="(~t)[i:j] = ~(t[i:j]) (push extraction through NEG)">extractNeg</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00409"></a>00409 
<a name="l00410"></a>00410     <span class="comment">// Negation rules</span>
<a name="l00411"></a>00411 <span class="comment"></span>
<a name="l00412"></a>00412 <span class="comment">    //! ~c1 = c  (bit-wise negation of a constant bitvector)</span>
<a name="l00413"></a>00413 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a28038efe4f40407c727f91d856234d49" title="~c1 = c (bit-wise negation of a constant bitvector)">negConst</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00414"></a>00414 <span class="comment">    //! ~(t1\@...\@tn) = (~t1)\@...\@(~tn) -- push negation through concat</span>
<a name="l00415"></a>00415 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a8e1501e7e12f93e385f77c75a931b970" title="~(t1@...@tn) = (~t1)@...@(~tn) -- push negation through concat">negConcat</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00416"></a>00416 <span class="comment">    //! ~(~t) = t  -- eliminate double negation</span>
<a name="l00417"></a>00417 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ae2ec10b9faef513781d02bb81cc3e88b" title="~(~t) = t -- eliminate double negation">negNeg</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00418"></a>00418 <span class="comment">    //! ~t = -1*t + 1 -- eliminate negation</span>
<a name="l00419"></a>00419 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a8e6947b16b14750e13812e43b9f5080c" title="~t = -1*t + 1 -- eliminate negation">negElim</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00420"></a>00420 <span class="comment">    //! ~(t1 &amp; t2) &lt;=&gt; ~t1 | ~t2 -- DeMorgan&#39;s Laws</span>
<a name="l00421"></a>00421 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#abc285ae73d2259fe1efea8cb46b2698a" title="~(t1 &amp; t2) &lt;=&gt; ~t1 | ~t2 -- DeMorgan&#39;s Laws">negBVand</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00422"></a>00422 <span class="comment">    //! ~(t1 | t2) &lt;=&gt; ~t1 &amp; ~t2 -- DeMorgan&#39;s Laws</span>
<a name="l00423"></a>00423 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#abf45c19e2d11f75d68785cc88f7ccf32" title="~(t1 | t2) &lt;=&gt; ~t1 &amp; ~t2 -- DeMorgan&#39;s Laws">negBVor</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00424"></a>00424 <span class="comment">    //! ~(t1 xor t2) = ~t1 xor t2</span>
<a name="l00425"></a>00425 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a815029f46058047bfe8a5e0dbc85ddc6" title="~(t1 xor t2) = ~t1 xor t2">negBVxor</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00426"></a>00426 <span class="comment">    //! ~(t1 xnor t2) = t1 xor t2</span>
<a name="l00427"></a>00427 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a2388a9d25fafcd0711a286d4666ee960" title="~(t1 xnor t2) = t1 xor t2">negBVxnor</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00428"></a>00428 
<a name="l00429"></a>00429     <span class="comment">// Bit-wise rules</span><span class="comment"></span>
<a name="l00430"></a>00430 <span class="comment">    //! Combine constants in bitwise AND, OR, XOR</span>
<a name="l00431"></a>00431 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#af3928b2385a298cc085134ac1e8222e4" title="Combine constants in bitwise AND, OR, XOR.">bitwiseConst</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <span class="keyword">const</span> std::vector&lt;int&gt;&amp; idxs,
<a name="l00432"></a>00432        <span class="keywordtype">int</span> kind);<span class="comment"></span>
<a name="l00433"></a>00433 <span class="comment">    //! Lifts concatenation above bitwise operators.</span>
<a name="l00434"></a>00434 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a731d832fce739c8b6d7b5ccf9932a94a" title="Lifts concatenation above bitwise operators.">bitwiseConcat</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <span class="keywordtype">int</span> kind);<span class="comment"></span>
<a name="l00435"></a>00435 <span class="comment">    //! Flatten bitwise operation</span>
<a name="l00436"></a>00436 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ac6e8075bfc61e657a37648ba78003f36" title="Flatten bitwise operation.">bitwiseFlatten</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <span class="keywordtype">int</span> kind);<span class="comment"></span>
<a name="l00437"></a>00437 <span class="comment">    //! Simplify bitwise operator containing a constant child</span>
<a name="l00438"></a>00438 <span class="comment"></span><span class="comment">    /*! \param e is the bit-wise expr</span>
<a name="l00439"></a>00439 <span class="comment">     *  \param idx is the index of the constant bitvector</span>
<a name="l00440"></a>00440 <span class="comment">     *  \param kind is the kind of e</span>
<a name="l00441"></a>00441 <span class="comment">     */</span>
<a name="l00442"></a>00442     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aac798843b8390b423f901f9cc1cb14dd" title="Simplify bitwise operator containing a constant child.">bitwiseConstElim</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <span class="keywordtype">int</span> idx, <span class="keywordtype">int</span> kind);
<a name="l00443"></a>00443 <span class="comment"></span>
<a name="l00444"></a>00444 <span class="comment">    /*! checks if e is already present in likeTerms without conflicts.</span>
<a name="l00445"></a>00445 <span class="comment">     *  if yes return 1, else{ if conflict return -1 else return 0 }</span>
<a name="l00446"></a>00446 <span class="comment">     *  we have conflict if</span>
<a name="l00447"></a>00447 <span class="comment">     *          1. the kind of e is BVNEG,</span>
<a name="l00448"></a>00448 <span class="comment">     *                 and e[0] is already present in likeTerms</span>
<a name="l00449"></a>00449 <span class="comment">     *          2. ~e is present in likeTerms already</span>
<a name="l00450"></a>00450 <span class="comment">     */</span>
<a name="l00451"></a>00451     <span class="keywordtype">int</span> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ae51599976453a95306a7b5a0b2e15029">sameKidCheck</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <a class="code" href="classCVC3_1_1ExprMap.html">ExprMap&lt;int&gt;</a>&amp; likeTerms);
<a name="l00452"></a>00452 
<a name="l00453"></a>00453     <span class="comment">// Concatenation rules</span>
<a name="l00454"></a>00454 <span class="comment"></span>
<a name="l00455"></a>00455 <span class="comment">    //! c1\@c2\@...\@cn = c  (concatenation of constant bitvectors)</span>
<a name="l00456"></a>00456 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#abee7fa8ab42b1addc72b7463b4a60975" title="c1@c2@...@cn = c (concatenation of constant bitvectors)">concatConst</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00457"></a>00457 <span class="comment">    //! Flatten one level of nested concatenation, e.g.: x\@(y\@z)\@w = x\@y\@z\@w</span>
<a name="l00458"></a>00458 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#adba6266c081af892dadf257a001ae920" title="Flatten one level of nested concatenation, e.g.: x@(y@z)@w = x@y@z@w.">concatFlatten</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00459"></a>00459 <span class="comment">    //! Merge n-ary concat. of adjacent extractions: x[15:8]\@x[7:0] = x[15:0]</span>
<a name="l00460"></a>00460 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#af8c35b9567c60d128480b278de348842" title="Merge n-ary concat. of adjacent extractions: x[15:8]@x[7:0] = x[15:0].">concatMergeExtract</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00461"></a>00461 <span class="comment"></span>
<a name="l00462"></a>00462 <span class="comment">    ///////////////////////////////////////////////////////////////////</span>
<a name="l00463"></a>00463 <span class="comment">    /////  Modulo arithmetic rules</span>
<a name="l00464"></a>00464 <span class="comment">    ///////////////////////////////////////////////////////////////////</span>
<a name="l00465"></a>00465 <span class="comment"></span><span class="comment"></span>
<a name="l00466"></a>00466 <span class="comment">    //! BVPLUS(n, c1,c2,...,cn) = c  (bit-vector plus of constant bitvectors)</span>
<a name="l00467"></a>00467 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a8475377c17d5c4241e1a134ce5b28eba" title="BVPLUS(n, c1,c2,...,cn) = c (bit-vector plus of constant bitvectors)">bvplusConst</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);<span class="comment"></span>
<a name="l00468"></a>00468 <span class="comment">    /*! @brief n*c1 = c, where n &gt;= 0 (multiplication of a constant</span>
<a name="l00469"></a>00469 <span class="comment">     *  bitvector by a non-negative constant) */</span>
<a name="l00470"></a>00470     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a05e4123ccbc5000dbf9615d89e13067d" title="n*c1 = c, where n &gt;= 0 (multiplication of a constant bitvector by a non-negative constant)">bvmultConst</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00471"></a>00471 <span class="comment"></span>
<a name="l00472"></a>00472 <span class="comment">    ///////////////////////////////////////////////////////////////////</span>
<a name="l00473"></a>00473 <span class="comment">    /////  Type predicate rules</span>
<a name="l00474"></a>00474 <span class="comment">    ///////////////////////////////////////////////////////////////////</span>
<a name="l00475"></a>00475 <span class="comment"></span><span class="comment"></span>
<a name="l00476"></a>00476 <span class="comment">    //! |- t=0 OR t=1  for any 1-bit bitvector t</span>
<a name="l00477"></a>00477 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aea2fb217bff7c7b46f996eacd051461b" title="|- t=0 OR t=1 for any 1-bit bitvector t">typePredBit</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00478"></a>00478 <span class="comment"></span>
<a name="l00479"></a>00479 <span class="comment">    //! Expand the type predicate wrapper (compute the actual type predicate)</span>
<a name="l00480"></a>00480 <span class="comment"></span>    <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a7d8030814a36206774951e3ae8968848" title="Expand the type predicate wrapper (compute the actual type predicate)">expandTypePred</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; tp);
<a name="l00481"></a>00481 <span class="comment"></span>
<a name="l00482"></a>00482 <span class="comment">    ////////////////////////////////////////////////////////////////////</span>
<a name="l00483"></a>00483 <span class="comment"></span>    <span class="comment">// Helper functions</span><span class="comment"></span>
<a name="l00484"></a>00484 <span class="comment">    ////////////////////////////////////////////////////////////////////</span>
<a name="l00485"></a>00485 <span class="comment">    //! Create Expr from Rational (for convenience)</span>
<a name="l00486"></a><a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ae03f092d2050783885e338b5880b2645">00486</a> <span class="comment"></span>    <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ae03f092d2050783885e338b5880b2645">rat</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Rational.html">Rational</a>&amp; r) { <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1TheoremProducer.html#a1b706238281ad141a57363a6890f14a5">d_em</a>-&gt;<a class="code" href="group__EM__Priv.html#ga18423a42ce6557dc33287d3979ccc3c6">newRatExpr</a>(r); }<span class="comment"></span>
<a name="l00487"></a>00487 <span class="comment">    /*! \param t1BitExtractThms : input1 is vector of bitblasts of t1,</span>
<a name="l00488"></a>00488 <span class="comment">     *  from bit i-1 to 0</span>
<a name="l00489"></a>00489 <span class="comment">     *</span>
<a name="l00490"></a>00490 <span class="comment">     *  \param t2BitExtractThms : input2 is vector of bitblasts of t2,</span>
<a name="l00491"></a>00491 <span class="comment">     *  from bit i-1 to 0</span>
<a name="l00492"></a>00492 <span class="comment">     *</span>
<a name="l00493"></a>00493 <span class="comment">     *  \param bitPos : input3 is extracted * bitposition</span>
<a name="l00494"></a>00494 <span class="comment">     *</span>
<a name="l00495"></a>00495 <span class="comment">     *  \result is the expression \f$t1[0] \wedge t2[0]\f$ if</span>
<a name="l00496"></a>00496 <span class="comment">     *  bitPos=0. this function is recursive; if bitPos &gt; 0 then the</span>
<a name="l00497"></a>00497 <span class="comment">     *  output expression is</span>
<a name="l00498"></a>00498 <span class="comment">     *  \f[ (t1[i-1] \wedge t2[i-1])</span>
<a name="l00499"></a>00499 <span class="comment">     *     \vee (t1[i-1] \wedge computeCarry(t1,t2,i-1))</span>
<a name="l00500"></a>00500 <span class="comment">     *     \vee (t2[i-1] \wedge computeCarry(t1,t2,i-1))</span>
<a name="l00501"></a>00501 <span class="comment">     *  \f]</span>
<a name="l00502"></a>00502 <span class="comment">     */</span>
<a name="l00503"></a>00503     <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a433503188cd190201bbea389cbc43478">computeCarry</a>(<span class="keyword">const</span> std::vector&lt;Theorem&gt;&amp; t1BitExtractThms,
<a name="l00504"></a>00504           <span class="keyword">const</span> std::vector&lt;Theorem&gt;&amp; t2BitExtractThms,
<a name="l00505"></a>00505           <span class="keywordtype">int</span> bitPos);
<a name="l00506"></a>00506 
<a name="l00507"></a>00507     <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#afdb4f9bf82d3ab61d6ac486b7807aa71" title="compute carryout of the current bits and cache them, and return">computeCarryPreComputed</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; t1_i,
<a name="l00508"></a>00508          <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; t2_i,
<a name="l00509"></a>00509          <span class="keywordtype">int</span> bitPos,
<a name="l00510"></a>00510          <span class="keywordtype">int</span> precomputedFlag);
<a name="l00511"></a>00511 
<a name="l00512"></a>00512     <span class="comment">/*Beginning of Lorenzo PLatania&#39;s methods*/</span>
<a name="l00513"></a>00513 
<a name="l00514"></a>00514     <span class="comment">//    virtual Theorem multiply_coeff( Rational mult_inv, const Expr&amp; e);</span><span class="comment"></span>
<a name="l00515"></a>00515 <span class="comment">    //! isolate a variable with coefficient = 1 on the Lhs of an</span>
<a name="l00516"></a>00516 <span class="comment"></span>    <span class="comment">//equality expression</span>
<a name="l00517"></a>00517     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a54d8f6979007cfc5e0da1ebf7f73f51d" title="isolate a variable with coefficient = 1 on the Lhs of an">isolate_var</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00518"></a>00518 
<a name="l00519"></a>00519     <span class="comment">// BVPLUS(N, a@b, y) = BVPLUS(N-n,a,BVPLUS(N,b,y)[N-1:n])@BVPLUS(n,b,y)</span>
<a name="l00520"></a>00520     <span class="comment">// where n = BVSize(b), a != 0</span>
<a name="l00521"></a>00521     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a91a4bd06c22c93729e954302840877ad">liftConcatBVMult</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00522"></a>00522 <span class="comment"></span>
<a name="l00523"></a>00523 <span class="comment">    //! canonize BVMult expressions in order to get one coefficient</span>
<a name="l00524"></a>00524 <span class="comment"></span>    <span class="comment">//multiplying the variable(s) in the expression</span>
<a name="l00525"></a>00525     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aa5acae5a384220d4dca181b8675831b3" title="canonize BVMult expressions in order to get one coefficient">canonBVMult</a>( <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e );
<a name="l00526"></a>00526 
<a name="l00527"></a>00527     <span class="comment">// BVPLUS(N, a@b, y) = BVPLUS(N-n,a,BVPLUS(N,b,y)[N-1:n])@BVPLUS(n,b,y)</span>
<a name="l00528"></a>00528     <span class="comment">// where n = BVSize(b)</span>
<a name="l00529"></a>00529     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a5fb475feef8b6740cc8c2f5f2104f07d">liftConcatBVPlus</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00530"></a>00530 <span class="comment"></span>
<a name="l00531"></a>00531 <span class="comment">    //! canonize BVPlus expressions in order to get just one</span>
<a name="l00532"></a>00532 <span class="comment"></span>    <span class="comment">//coefficient multiplying each variable in the expression</span>
<a name="l00533"></a>00533     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a31b9e200eff6852b66a8d8ac19ec2db3" title="canonize BVPlus expressions in order to get just one">canonBVPlus</a>( <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e );
<a name="l00534"></a>00534 <span class="comment"></span>
<a name="l00535"></a>00535 <span class="comment">    //! canonize BVMinus expressions: push the minus to the leafs in</span>
<a name="l00536"></a>00536 <span class="comment"></span>    <span class="comment">//BVPLUS expr; simplify minus in BVMULT and BVMINUS expr</span>
<a name="l00537"></a>00537     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#af3fc29529753dc8161360688bcaaf12b" title="canonize BVMinus expressions: push the minus to the leafs in">canonBVUMinus</a>( <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e );
<a name="l00538"></a>00538 
<a name="l00539"></a>00539     <span class="comment">// Input: t[hi:lo] = rhs</span>
<a name="l00540"></a>00540     <span class="comment">// if t appears as leaf in rhs, then:</span>
<a name="l00541"></a>00541     <span class="comment">//    t[hi:lo] = rhs |- Exists x,y,z. (t = x @ y @ z AND y = rhs), solvedForm = false</span>
<a name="l00542"></a>00542     <span class="comment">// else</span>
<a name="l00543"></a>00543     <span class="comment">//    t[hi:lo] = rhs |- Exists x,y,z. (t = x @ rhs @ z AND y = rhs), solvedForm = true</span>
<a name="l00544"></a>00544     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a8475d9fad4a99ea877f69e154f1d67d6">processExtract</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>&amp; e, <span class="keywordtype">bool</span>&amp; solvedForm);
<a name="l00545"></a>00545 
<a name="l00546"></a>00546     <span class="comment">// normalizes equation</span>
<a name="l00547"></a>00547     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ac946768d5a1aae35472b63b53b457264">canonBVEQ</a>( <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e, <span class="keywordtype">int</span> maxEffort = 3 );
<a name="l00548"></a>00548 <span class="comment"></span>
<a name="l00549"></a>00549 <span class="comment">    //! apply the distributive rule on the BVMULT expression e</span>
<a name="l00550"></a>00550 <span class="comment"></span>    <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a9fe7ec7e369ee92339471e805a1dd7c3" title="apply the distributive rule on the BVMULT expression e">distributive_rule</a>( <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e );
<a name="l00551"></a>00551     <span class="comment">//    virtual Theorem BVMultConstTerm( const Expr&amp; e1, const Expr&amp; e2);</span>
<a name="l00552"></a>00552     <span class="comment">// recursively reorder subterms in a BVMULT term</span>
<a name="l00553"></a>00553     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a87288805014f1d0e935c052364142d6b">BVMult_order_subterms</a>( <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00554"></a>00554 
<a name="l00555"></a>00555     <span class="comment">// rewrites the equation in the form 0 = Expr</span>
<a name="l00556"></a>00556     <span class="comment">// this is needed for TheoryBitvector::solve</span>
<a name="l00557"></a>00557     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a0f02e48875ccb661cae7cc7a2489dce1">MarkNonSolvableEq</a>( <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00558"></a>00558     <span class="comment">/*End of Lorenzo PLatania&#39;s methods*/</span>
<a name="l00559"></a>00559 
<a name="l00560"></a>00560     <span class="comment">// rewrite BVZEROEXTEND into CONCAT</span>
<a name="l00561"></a>00561     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a8295f4644a077f3c8af0db53be7b458b" title="BVZEROEXTEND(e, i) = zeroString @ e.">zeroExtendRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00562"></a>00562 
<a name="l00563"></a>00563     <span class="comment">// rewrite BVREPEAT into CONCAT</span>
<a name="l00564"></a>00564     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a9b9a128c7c863d01c804bfec956ffb6c" title="BVREPEAT(e, i) = e @ e @ ... @ e.">repeatRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00565"></a>00565 
<a name="l00566"></a>00566     <span class="comment">// rewrite BVROTL into CONCAT</span>
<a name="l00567"></a>00567     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#afdc5b05255d1d217c26d5e3660957fde" title="BVROTL(e, i) = a[n-i-1:0] @ a[n-1:n-i].">rotlRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00568"></a>00568     <span class="comment">// rewrite BVROTR into CONCAT</span>
<a name="l00569"></a>00569     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a6495867fe7ef34a838e83315dd8b02e4" title="BVROTR(e, i) = a[i-1:0] @ a[n-1:i].">rotrRule</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; e);
<a name="l00570"></a>00570 
<a name="l00571"></a>00571     <span class="comment">// Dejan: Division rewrites</span>
<a name="l00572"></a>00572 <span class="comment"></span>
<a name="l00573"></a>00573 <span class="comment">    /**</span>
<a name="l00574"></a>00574 <span class="comment">     * Divide a with b unsigned and return the bit-vector constant result</span>
<a name="l00575"></a>00575 <span class="comment">     */</span>
<a name="l00576"></a>00576     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#acc221d6c256b7d550090627e6fee9643">bvUDivConst</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; divExpr);
<a name="l00577"></a>00577 <span class="comment"></span>
<a name="l00578"></a>00578 <span class="comment">    /**</span>
<a name="l00579"></a>00579 <span class="comment">     * Rewrite x/y to</span>
<a name="l00580"></a>00580 <span class="comment">     * \f[\exists s: s = x/y \wedge (y \neq 0 \implies x = y * s + m \wedge 0 &lt;= m &lt; y)\f]</span>
<a name="l00581"></a>00581 <span class="comment">     */</span>
<a name="l00582"></a>00582     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a330fc1ea75378bfe0fec034132af7400">bvUDivTheorem</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; divExpr);
<a name="l00583"></a>00583 <span class="comment"></span>
<a name="l00584"></a>00584 <span class="comment">    /**</span>
<a name="l00585"></a>00585 <span class="comment">     * Compute the remainder</span>
<a name="l00586"></a>00586 <span class="comment">     */</span>
<a name="l00587"></a>00587     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#af8bafa1141beb24e3742bce376697e8f">bvURemConst</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; remExpr);
<a name="l00588"></a>00588 <span class="comment"></span>
<a name="l00589"></a>00589 <span class="comment">    /**</span>
<a name="l00590"></a>00590 <span class="comment">     * Rewrite a%b in terms of a/b, i.e. a - a/b</span>
<a name="l00591"></a>00591 <span class="comment">     */</span>
<a name="l00592"></a>00592     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aa6941790eb888168ffdc5531b129b466">bvURemRewrite</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; remExpr);
<a name="l00593"></a>00593 <span class="comment"></span>
<a name="l00594"></a>00594 <span class="comment">    /**</span>
<a name="l00595"></a>00595 <span class="comment">     * Bit-blast the multiplication a_times_b given the bits in a_bits and b_bits.</span>
<a name="l00596"></a>00596 <span class="comment">     * The resulting output bits will be in the vector output_bits. The return value</span>
<a name="l00597"></a>00597 <span class="comment">     * is a theorem saying there is no overflow for this multiplication. (TODO, it&#39;s</span>
<a name="l00598"></a>00598 <span class="comment">     * just an empty theorem for now).</span>
<a name="l00599"></a>00599 <span class="comment">     */</span>
<a name="l00600"></a>00600     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a714a402f525e0d0c222846379366edc5">bitblastBVMult</a>(<span class="keyword">const</span> std::vector&lt;Theorem&gt;&amp; a_bits,
<a name="l00601"></a>00601                                <span class="keyword">const</span> std::vector&lt;Theorem&gt;&amp; b_bits,
<a name="l00602"></a>00602                                <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; a_times_b,
<a name="l00603"></a>00603                                std::vector&lt;Theorem&gt;&amp; output_bits);
<a name="l00604"></a>00604 <span class="comment"></span>
<a name="l00605"></a>00605 <span class="comment">    /**</span>
<a name="l00606"></a>00606 <span class="comment">     * Bit-blast the sum a_plus_b given the bits in a_bits and b_bits.</span>
<a name="l00607"></a>00607 <span class="comment">     * The resulting output bits will be in the vector output_bits. The return value</span>
<a name="l00608"></a>00608 <span class="comment">     * is a theorem saying there is no overflow for this sum. (TODO, it&#39;s</span>
<a name="l00609"></a>00609 <span class="comment">     * just an empty theorem for now).</span>
<a name="l00610"></a>00610 <span class="comment">     */</span>
<a name="l00611"></a>00611     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#aef3181ea41680c3f7b1b4ec724e8b68d">bitblastBVPlus</a>(<span class="keyword">const</span> std::vector&lt;Theorem&gt;&amp; a_bits,
<a name="l00612"></a>00612                                <span class="keyword">const</span> std::vector&lt;Theorem&gt;&amp; b_bits,
<a name="l00613"></a>00613                                <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; a_plus_b,
<a name="l00614"></a>00614                                std::vector&lt;Theorem&gt;&amp; output_bits);
<a name="l00615"></a>00615 <span class="comment"></span>
<a name="l00616"></a>00616 <span class="comment">    /**</span>
<a name="l00617"></a>00617 <span class="comment">     * Rewrite the signed divide in terms of the unsigned one.</span>
<a name="l00618"></a>00618 <span class="comment">     */</span>
<a name="l00619"></a>00619     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#ad3bdebd3ad40f70a1592fda3fae82e71">bvSDivRewrite</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; sDivExpr);
<a name="l00620"></a>00620 <span class="comment"></span>
<a name="l00621"></a>00621 <span class="comment">    /**</span>
<a name="l00622"></a>00622 <span class="comment">     * Rewrite the signed remainder in terms of the unsigned one.</span>
<a name="l00623"></a>00623 <span class="comment">     */</span>
<a name="l00624"></a>00624     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a73632313f926e7b93104538c465bbcfb">bvSRemRewrite</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; sRemExpr);
<a name="l00625"></a>00625 <span class="comment"></span>
<a name="l00626"></a>00626 <span class="comment">    /**</span>
<a name="l00627"></a>00627 <span class="comment">     * Rewrite the signed mod in terms of the unsigned one.</span>
<a name="l00628"></a>00628 <span class="comment">     */</span>
<a name="l00629"></a>00629     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a8d5827e983be4b7ed387314332ac4613">bvSModRewrite</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; sModExpr);
<a name="l00630"></a>00630 <span class="comment"></span>
<a name="l00631"></a>00631 <span class="comment">    /**</span>
<a name="l00632"></a>00632 <span class="comment">     * Rewrite \f[x_1 \vee x_2 \vee \ldots \vee x_n = 0\f] into</span>
<a name="l00633"></a>00633 <span class="comment">     * \f[x_1 = 0 \wedge x_2 = 0 \wedge \ldots \wedge x_n = 0\f].</span>
<a name="l00634"></a>00634 <span class="comment">     */</span>
<a name="l00635"></a>00635     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a9200f74bce7930bb77d5e2a00b81a1d4">zeroBVOR</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; orEqZero);
<a name="l00636"></a>00636 <span class="comment"></span>
<a name="l00637"></a>00637 <span class="comment">    /**</span>
<a name="l00638"></a>00638 <span class="comment">     * Rewrite \f[x_1 \wedge x_2 \wedge \ldots \wedge x_n = 1^n\f] into</span>
<a name="l00639"></a>00639 <span class="comment">     * \f[x_1 = 1^n \wedge x_2 = 1^n \wedge \ldots \wedge x_n = 1^n\f].</span>
<a name="l00640"></a>00640 <span class="comment">     */</span>
<a name="l00641"></a>00641     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a1d422c14bfbcac9e91c53260b856b93e">oneBVAND</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; andEqOne);
<a name="l00642"></a>00642 <span class="comment"></span>
<a name="l00643"></a>00643 <span class="comment">    /**</span>
<a name="l00644"></a>00644 <span class="comment">     * Equalities over constants go to true/false.</span>
<a name="l00645"></a>00645 <span class="comment">     */</span>
<a name="l00646"></a>00646     <span class="keyword">virtual</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a9c0a8eae91823c04c12dbedbbbbd417f">constEq</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; eq);
<a name="l00647"></a>00647 <span class="comment"></span>
<a name="l00648"></a>00648 <span class="comment">    /**</span>
<a name="l00649"></a>00649 <span class="comment">     * Returns true if equation is of the form x[i:j] = x[k:l], where the</span>
<a name="l00650"></a>00650 <span class="comment">     * extracted segments overlap, i.e. i &gt; j &gt;= k &gt; l or k &gt; i &gt;= l &gt; j.</span>
<a name="l00651"></a>00651 <span class="comment">     */</span>
<a name="l00652"></a>00652     <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#adf540a2323b9f9ba281d2d67826cdae7">solveExtractOverlapApplies</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; eq);
<a name="l00653"></a>00653 <span class="comment"></span>
<a name="l00654"></a>00654 <span class="comment">    /**</span>
<a name="l00655"></a>00655 <span class="comment">     * Returns the theorem that simplifies the equality of two overlapping</span>
<a name="l00656"></a>00656 <span class="comment">     * extracts over the same term.</span>
<a name="l00657"></a>00657 <span class="comment">     */</span>
<a name="l00658"></a>00658     <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1BitvectorTheoremProducer.html#a79998a92001fa8625a471bf7011b9cd3">solveExtractOverlap</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>&amp; eq);
<a name="l00659"></a>00659 
<a name="l00660"></a>00660 
<a name="l00661"></a>00661 }; <span class="comment">// end of class BitvectorTheoremProducer</span>
<a name="l00662"></a>00662 } <span class="comment">// end of name-space CVC3</span>
<a name="l00663"></a>00663 
<a name="l00664"></a>00664 
<a name="l00665"></a>00665 <span class="preprocessor">#endif</span>
<a name="l00666"></a>00666 <span class="preprocessor"></span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Sep 7 2011 for CVC3 by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>