array_proof_rules.h

Go to the documentation of this file.
00001 /*****************************************************************************/
00002 /*!
00003  * \file array_proof_rules.h
00004  * 
00005  * Author: Clark Barrett 5/29/2003
00006  * 
00007  * Created: May 29 19:16:33 GMT 2003
00008  *
00009  * <hr>
00010  *
00011  * License to use, copy, modify, sell and/or distribute this software
00012  * and its documentation for any purpose is hereby granted without
00013  * royalty, subject to the terms and conditions defined in the \ref
00014  * LICENSE file provided with this distribution.
00015  * 
00016  * <hr>
00017  * 
00018  * CLASS: ArrayProofRules
00019  * 
00020  * 
00021  * Description: Array proof rules.
00022  */
00023 /*****************************************************************************/
00024 
00025 #ifndef _cvc3__theory_array__array_proof_rules_h_
00026 #define _cvc3__theory_array__array_proof_rules_h_
00027 
00028 namespace CVC3 {
00029 
00030   class Theorem;
00031   class Expr;
00032   
00033   class ArrayProofRules {
00034   public:
00035     // Destructor
00036     virtual ~ArrayProofRules() { }
00037 
00038     ////////////////////////////////////////////////////////////////////
00039     // Proof rules
00040     ////////////////////////////////////////////////////////////////////
00041 
00042     // ==>
00043     // write(store, index_0, v_0, index_1, v_1, ..., index_n, v_n) = store IFF
00044     //
00045     // read(store, index_n) = v_n &
00046     // index_{n-1} != index_n -> read(store, index_{n-1}) = v_{n-1} &
00047     // (index_{n-2} != index_{n-1} & index_{n-2} != index_n) -> read(store, index_{n-2}) = v_{n-2} &
00048     // ...
00049     // (index_1 != index_2 & ... & index_1 != index_n) -> read(store, index_1) = v_1
00050     // (index_0 != index_1 & index_0 != index_2 & ... & index_0 != index_n) -> read(store, index_0) = v_0
00051     virtual Theorem rewriteSameStore(const Expr& e, int n) = 0;
00052 
00053     // ==> write(store, index, value) = write(...) IFF
00054     //       store = write(write(...), index, read(store, index)) &
00055     //       value = read(write(...), index)
00056     virtual Theorem rewriteWriteWrite(const Expr& e) = 0;
00057 
00058     // ==> read(write(store, index1, value), index2) =
00059     //   ite(index1 = index2, value, read(store, index2))
00060     virtual Theorem rewriteReadWrite(const Expr& e) = 0;
00061 
00062     // e = read(write(store, index1, value), index2):
00063     // ==> ite(index1 = index2,
00064     //         read(write(store, index1, value), index2) = value,
00065     //         read(write(store, index1, value), index2) = read(store, index2))
00066     virtual Theorem rewriteReadWrite2(const Expr& e) = 0;
00067 
00068     // value = read(store, index) ==>
00069     //   write(store, index, value) = store
00070     virtual Theorem rewriteRedundantWrite1(const Theorem& v_eq_r,
00071              const Expr& write) = 0;
00072 
00073     // ==>
00074     //   write(write(store, index, v1), index, v2) = write(store, index, v2)
00075     virtual Theorem rewriteRedundantWrite2(const Expr& e) = 0;
00076 
00077     // ==>
00078     //   write(write(store, index1, v1), index2, v2) =
00079     //   write(write(store, index2, v2), index1, ite(index1 = index2, v2, v1))
00080     virtual Theorem interchangeIndices(const Expr& e) = 0;
00081     //! Beta reduction of array literal: |- (array x. f(x))[arg] = f(arg)
00082     virtual Theorem readArrayLiteral(const Expr& e) = 0;
00083 
00084     //! Lift ite over read
00085     virtual Theorem liftReadIte(const Expr& e) = 0;
00086 
00087     //! a /= b |- exists i. a[i] /= b[i]
00088     virtual Theorem arrayNotEq(const Theorem& e) = 0;
00089 
00090   }; // end of class ArrayProofRules
00091 
00092 } // end of namespace CVC3
00093 
00094 #endif

Generated on Wed Nov 18 16:13:28 2009 for CVC3 by  doxygen 1.5.2