00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef _MP_boolean_hpp_
00010 #define _MP_boolean_hpp_
00011
00012 #include <vector>
00013 using std::vector;
00014
00015 #include "MP_index.hpp"
00016
00017 namespace flopc {
00018 class SUBSETREF;
00019
00021 class Boolean_base {
00022 friend class Handle<Boolean_base*>;
00023 friend class MP_boolean;
00024 public:
00025 virtual bool evaluate() const = 0;
00026 protected:
00027 Boolean_base() : count(0) {}
00028 virtual ~Boolean_base() {}
00029 int count;
00030 };
00031
00040 class MP_boolean : public Handle<Boolean_base*> {
00041 public:
00042 MP_boolean() : Handle<Boolean_base*>(0) {}
00043 MP_boolean(bool b);
00044 MP_boolean(const Constant& c);
00045 MP_boolean(SUBSETREF& c);
00046 MP_boolean(Boolean_base* r) : Handle<Boolean_base*>(r) {}
00047 };
00048
00050
00058 MP_boolean operator!(const MP_boolean& b);
00059
00068 MP_boolean operator&&(const MP_boolean& e1, const MP_boolean& e2);
00069
00078 MP_boolean operator||(const MP_boolean& e1, const MP_boolean& e2);
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00107 MP_boolean operator<=(const MP_index_exp& e1, const MP_index_exp& e2);
00108
00116 MP_boolean operator<=(const Constant& e1, const Constant& e2);
00117
00127 MP_boolean operator<(const MP_index_exp& e1, const MP_index_exp& e2);
00128
00136 MP_boolean operator<(const Constant& e1, const Constant& e2);
00137
00147 MP_boolean operator>=(const MP_index_exp& e1, const MP_index_exp& e2);
00148
00156 MP_boolean operator>=(const Constant& e1, const Constant& e2);
00157
00167 MP_boolean operator>(const MP_index_exp& e1, const MP_index_exp& e2);
00168
00176 MP_boolean operator>(const Constant& e1, const Constant& e2);
00177
00187 MP_boolean operator==(const MP_index_exp& e1, const MP_index_exp& e2);
00188
00196 MP_boolean operator==(const Constant& e1, const Constant& e2);
00197
00207 MP_boolean operator!=(const MP_index_exp& e1, const MP_index_exp& e2);
00208
00216 MP_boolean operator!=(const Constant& e1, const Constant& e2);
00217
00218 }
00219 #endif