<!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: array_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 <span id="projectnumber">2.4.1</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <div class="title">array_theorem_producer.h</div> </div> </div> <div class="contents"> <a href="array__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 array_theorem_producer.h</span> <a name="l00004"></a>00004 <span class="comment"> * </span> <a name="l00005"></a>00005 <span class="comment"> * Author: Clark Barrett, 5/29/2003</span> <a name="l00006"></a>00006 <span class="comment"> * </span> <a name="l00007"></a>00007 <span class="comment"> * Created: May 29 19:16:33 GMT 2003</span> <a name="l00008"></a>00008 <span class="comment"> *</span> <a name="l00009"></a>00009 <span class="comment"> * <hr></span> <a name="l00010"></a>00010 <span class="comment"> *</span> <a name="l00011"></a>00011 <span class="comment"> * License to use, copy, modify, sell and/or distribute this software</span> <a name="l00012"></a>00012 <span class="comment"> * and its documentation for any purpose is hereby granted without</span> <a name="l00013"></a>00013 <span class="comment"> * royalty, subject to the terms and conditions defined in the \ref</span> <a name="l00014"></a>00014 <span class="comment"> * LICENSE file provided with this distribution.</span> <a name="l00015"></a>00015 <span class="comment"> * </span> <a name="l00016"></a>00016 <span class="comment"> * <hr></span> <a name="l00017"></a>00017 <span class="comment"> * </span> <a name="l00018"></a>00018 <span class="comment"> * CLASS: ArrayProofRules</span> <a name="l00019"></a>00019 <span class="comment"> * </span> <a name="l00020"></a>00020 <span class="comment"> * </span> <a name="l00021"></a>00021 <span class="comment"> * Description: TRUSTED implementation of array proof rules. DO</span> <a name="l00022"></a>00022 <span class="comment"> * NOT use this file in any DP code, use the exported API in</span> <a name="l00023"></a>00023 <span class="comment"> * array_proof_rules.h instead.</span> <a name="l00024"></a>00024 <span class="comment"> * </span> <a name="l00025"></a>00025 <span class="comment"> */</span> <a name="l00026"></a>00026 <span class="comment">/*****************************************************************************/</span> <a name="l00027"></a>00027 <span class="preprocessor">#ifndef _cvc3__theory_array__array_theorem_producer_h_</span> <a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#define _cvc3__theory_array__array_theorem_producer_h_</span> <a name="l00029"></a>00029 <span class="preprocessor"></span> <a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="array__proof__rules_8h.html">array_proof_rules.h</a>"</span> <a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="theorem__producer_8h.html">theorem_producer.h</a>"</span> <a name="l00032"></a>00032 <a name="l00033"></a>00033 <span class="keyword">namespace </span>CVC3 { <a name="l00034"></a>00034 <a name="l00035"></a>00035 <span class="keyword">class </span>TheoryArray; <a name="l00036"></a>00036 <a name="l00037"></a><a class="code" href="classCVC3_1_1ArrayTheoremProducer.html">00037</a> <span class="keyword">class </span><a class="code" href="classCVC3_1_1ArrayTheoremProducer.html">ArrayTheoremProducer</a>: <span class="keyword">public</span> <a class="code" href="classCVC3_1_1ArrayProofRules.html">ArrayProofRules</a>, <span class="keyword">public</span> <a class="code" href="classCVC3_1_1TheoremProducer.html">TheoremProducer</a> { <a name="l00038"></a>00038 <span class="keyword">private</span>: <a name="l00039"></a><a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#aa1f4b0ec8f008f77bff2bcfac4ce056d">00039</a> <a class="code" href="classCVC3_1_1TheoryArray.html" title="This theory handles arrays.">TheoryArray</a>* <a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#aa1f4b0ec8f008f77bff2bcfac4ce056d">d_theoryArray</a>; <a name="l00040"></a>00040 <a name="l00041"></a>00041 <span class="keyword">public</span>: <a name="l00042"></a>00042 <span class="comment">// Constructor</span> <a name="l00043"></a>00043 <a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#a8722003347f46425828e98393be8bb95">ArrayTheoremProducer</a>(<a class="code" href="classCVC3_1_1TheoryArray.html" title="This theory handles arrays.">TheoryArray</a>* theoryArray); <a name="l00044"></a>00044 <span class="comment"></span> <a name="l00045"></a>00045 <span class="comment"> ////////////////////////////////////////////////////////////////////</span> <a name="l00046"></a>00046 <span class="comment"></span> <span class="comment">// Proof rules</span><span class="comment"></span> <a name="l00047"></a>00047 <span class="comment"> ////////////////////////////////////////////////////////////////////</span> <a name="l00048"></a>00048 <span class="comment"></span> <a name="l00049"></a>00049 <span class="comment">// ==></span> <a name="l00050"></a>00050 <span class="comment">// write(store, index_0, v_0, index_1, v_1, ..., index_n, v_n) = store IFF</span> <a name="l00051"></a>00051 <span class="comment">//</span> <a name="l00052"></a>00052 <span class="comment">// read(store, index_n) = v_n &</span> <a name="l00053"></a>00053 <span class="comment">// index_{n-1} != index_n -> read(store, index_{n-1}) = v_{n-1} &</span> <a name="l00054"></a>00054 <span class="comment">// (index_{n-2} != index_{n-1} & index_{n-2} != index_n) -> read(store, index_{n-2}) = v_{n-2} &</span> <a name="l00055"></a>00055 <span class="comment">// ...</span> <a name="l00056"></a>00056 <span class="comment">// (index_1 != index_2 & ... & index_1 != index_n) -> read(store, index_1) = v_1</span> <a name="l00057"></a>00057 <span class="comment">// (index_0 != index_1 & index_0 != index_2 & ... & index_0 != index_n) -> read(store, index_0) = v_0</span> <a name="l00058"></a>00058 <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#a0ab9aba97b1937710a9eba916ae02c05">rewriteSameStore</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& e, <span class="keywordtype">int</span> n); <a name="l00059"></a>00059 <a name="l00060"></a>00060 <span class="comment">// ==> write(store, index, value) = write(...) IFF</span> <a name="l00061"></a>00061 <span class="comment">// store = write(write(...), index, read(store, index)) &</span> <a name="l00062"></a>00062 <span class="comment">// value = read(write(...), index)</span> <a name="l00063"></a>00063 <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#a45d175085355a9ff4215371c08fae566">rewriteWriteWrite</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& e); <a name="l00064"></a>00064 <a name="l00065"></a>00065 <span class="comment">// ==> read(write(store, index1, value), index2) =</span> <a name="l00066"></a>00066 <span class="comment">// ite(index1 = index2, value, read(store, index2))</span> <a name="l00067"></a>00067 <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#a508cb6e565c59ad0e91ee380774ea379">rewriteReadWrite</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& e); <a name="l00068"></a>00068 <a name="l00069"></a>00069 <span class="comment">// e = read(write(store, index1, value), index2):</span> <a name="l00070"></a>00070 <span class="comment">// ==> ite(index1 = index2,</span> <a name="l00071"></a>00071 <span class="comment">// read(write(store, index1, value), index2) = value,</span> <a name="l00072"></a>00072 <span class="comment">// read(write(store, index1, value), index2) = read(store, index2))</span> <a name="l00073"></a>00073 <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#a5b6d56f4f0f05cb3671b3c01b293d3bc">rewriteReadWrite2</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& e); <a name="l00074"></a>00074 <a name="l00075"></a>00075 <span class="comment">// value = read(store, index) ==></span> <a name="l00076"></a>00076 <span class="comment">// write(store, index, value) = store</span> <a name="l00077"></a>00077 <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#a1b4dd97c680555f98834c0c2eb63beca">rewriteRedundantWrite1</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>& v_eq_r, <a name="l00078"></a>00078 <span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& write); <a name="l00079"></a>00079 <a name="l00080"></a>00080 <span class="comment">// ==></span> <a name="l00081"></a>00081 <span class="comment">// write(write(store, index, v1), index, v2) = write(store, index, v2)</span> <a name="l00082"></a>00082 <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#a4eb3fa026164aa36735dde9de93067e6">rewriteRedundantWrite2</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& e); <a name="l00083"></a>00083 <a name="l00084"></a>00084 <span class="comment">// ==></span> <a name="l00085"></a>00085 <span class="comment">// write(write(store, index1, v1), index2, v2) =</span> <a name="l00086"></a>00086 <span class="comment">// write(write(store, index2, v2), index1, ite(index1 = index2, v2, v1))</span> <a name="l00087"></a>00087 <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#a531007d953fd91a89f9d273cf04d2196">interchangeIndices</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& e); <a name="l00088"></a>00088 <span class="comment">// Beta reduction of array literal: |- (array x. f(x))[arg] = f(arg)</span> <a name="l00089"></a>00089 <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#a8c0cbeb8e41da7e06528641cdf3be3fb" title="Beta reduction of array literal: |- (array x. f(x))[arg] = f(arg)">readArrayLiteral</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& e); <a name="l00090"></a>00090 <a name="l00091"></a>00091 <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#ac8a296684897a290c2894d4e8fee962b" title="Lift ite over read.">liftReadIte</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& e); <a name="l00092"></a>00092 <a name="l00093"></a>00093 <span class="comment">// a /= b |- exists i. a[i] /= b[i]</span> <a name="l00094"></a>00094 <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#ae644c310ea0d55518a2505acc4e3cc1d" title="a /= b |- exists i. a[i] /= b[i]">arrayNotEq</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>& e); <a name="l00095"></a>00095 <a name="l00096"></a>00096 <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#adfcf46071d0e2a7544d76f8bdcba3cf7">splitOnConstants</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a>& a, <span class="keyword">const</span> std::vector<Expr>& consts); <a name="l00097"></a>00097 <a name="l00098"></a>00098 <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a> <a class="code" href="classCVC3_1_1ArrayTheoremProducer.html#a845898b86bdae8fcee18b27d181e6bbd">propagateIndexDiseq</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1Theorem.html">Theorem</a>& read1eqread2isFalse); <a name="l00099"></a>00099 <a name="l00100"></a>00100 }; <span class="comment">// end of class ArrayTheoremProducer</span> <a name="l00101"></a>00101 <a name="l00102"></a>00102 } <span class="comment">// end of namespace CVC3</span> <a name="l00103"></a>00103 <a name="l00104"></a>00104 <span class="preprocessor">#endif</span> </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated on Wed Sep 7 2011 for CVC3 by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address> </body> </html>