metaSMT 2
metaSMT/tags/QF_BV.hpp
Go to the documentation of this file.
00001 #pragma once
00002 #ifndef HEADER_metaSMT_TAG_QF_BV_HPP
00003 #define HEADER_metaSMT_TAG_QF_BV_HPP
00004 
00005 #include "Logic.hpp"
00006 
00007 #include <boost/mpl/vector/vector40.hpp>
00008 #include <boost/variant.hpp>
00009 
00010 namespace metaSMT {
00011   namespace logic {
00012     namespace QF_BV {
00016       namespace tag {
00017 
00018 #define PRINT(Tag, body) template<typename STREAM> \
00019   friend STREAM & operator<< (STREAM & out, Tag const & self) \
00020   { return (out << body); }
00021 #define TAG( NAME ) struct  NAME##_tag { \
00022   bool operator<(NAME##_tag const &) const {return false;} \
00023   PRINT(NAME##_tag, #NAME) \
00024 };
00025 
00026         
00027 
00028         // variable tag
00029         struct var_tag { unsigned id; unsigned width; 
00030           PRINT(var_tag, "bv_var_tag[" << self.id << ',' << self.width << "]")
00031           bool operator< (var_tag const & other) const {
00032             return id < other.id;
00033           }
00034         };
00035 
00036         // operation tags
00037         TAG(bit0)
00038         TAG(bit1)
00039 
00040         // unary
00041         TAG(bvnot)
00042         TAG(bvneg)
00043 
00044         // bitwise binary
00045         TAG(bvand)
00046         TAG(bvnand)
00047         TAG(bvor)
00048         TAG(bvnor)
00049         TAG(bvxor)
00050         TAG(bvxnor)
00051 
00052 
00053         TAG(bvcomp)
00054 
00055         // bitvec arithmetic
00056         TAG(bvadd)
00057         TAG(bvmul)
00058         TAG(bvsub)
00059         TAG(bvsdiv)
00060         TAG(bvsrem)
00061         TAG(bvudiv)
00062         TAG(bvurem)
00063 
00064         // bitvector constant creation
00065         TAG(bvuint)
00066         TAG(bvsint)
00067         TAG(bvbin)
00068         TAG(bvhex)
00069 
00070 
00071         // modifying bv length
00072         TAG(concat)
00073         TAG(extract)
00074         TAG(repeat)
00075         TAG(zero_extend)
00076         TAG(sign_extend)
00077 
00078         // bitvector shifting
00079         TAG(bvshl)
00080         TAG(bvshr)
00081         TAG(bvashr)
00082 
00083         // comparison operators
00084         TAG(bvslt)
00085         TAG(bvsgt)
00086         TAG(bvsle)
00087         TAG(bvsge)
00088         TAG(bvult)
00089         TAG(bvugt)
00090         TAG(bvule)
00091         TAG(bvuge)
00092 
00093 #undef PRINT
00094 #undef TAG
00095 
00096       // tag variant QF_BV_Tag
00097       typedef boost::mpl::vector39<
00098           nil
00099         , bit0_tag
00100         , bit1_tag
00101         , bvnot_tag
00102         , bvneg_tag
00103         , bvand_tag
00104         , bvnand_tag
00105         , bvor_tag
00106         , bvnor_tag
00107         , bvxor_tag
00108         , bvxnor_tag
00109         , bvcomp_tag
00110         , bvadd_tag
00111         , bvmul_tag
00112         , bvsub_tag
00113         , bvsrem_tag
00114         , bvsdiv_tag
00115         , bvurem_tag
00116         , bvudiv_tag
00117         , bvuint_tag
00118         , bvsint_tag
00119         , bvbin_tag
00120         , bvhex_tag
00121         , bvslt_tag
00122         , bvsgt_tag
00123         , bvsle_tag
00124         , bvsge_tag
00125         , bvult_tag
00126         , bvugt_tag
00127         , bvule_tag
00128         , bvuge_tag
00129         , concat_tag
00130         , extract_tag
00131         , zero_extend_tag
00132         , sign_extend_tag
00133         , bvshl_tag
00134         , bvshr_tag
00135         , bvashr_tag
00136         , var_tag
00137       >::type QF_BV_Tags;
00138 
00139       typedef boost::make_variant_over<QF_BV_Tags>::type QF_BV_Tag;
00140 
00141       } // namespace metaSMT::logic::QF_BV::tag
00142     } // namespace metaSMT::logic::QF_BV
00143   } // namespace metaSMT::logic
00144 } // namespace metaSMT
00145 #endif // HEADER_metaSMT_TAG_QF_BV_HPP
00146 //  vim: ft=cpp:ts=2:sw=2:expandtab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines