00001 // -*- c++ -*- 00002 //***************************************************************************** 00028 //***************************************************************************** 00029 00030 00031 // load PolyBoRi settings 00032 # include "pbori_defs.h" 00033 #include <vector> 00034 00035 #ifndef BooleEnv_h_ 00036 #define BooleEnv_h_ 00037 00038 // Obey stricter dependence of Sun Studio compiler 00039 // todo: resolve dependency 00040 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC) 00041 # define PBORI_ENV_RING_NOTINLINED 00042 #endif 00043 00044 BEGIN_NAMESPACE_PBORI 00045 00046 00047 class BoolePolyRing; 00048 extern BoolePolyRing active_ring; 00049 class CDynamicOrderBase; 00050 00058 class BooleEnv: 00059 public CTypes::orderenums_type, public CTypes::compenums_type, 00060 public CTypes::auxtypes_type { 00061 00062 public: 00063 //------------------------------------------------------------------------- 00064 // types definitions 00065 //------------------------------------------------------------------------- 00066 00068 typedef BooleEnv self; 00069 00071 typedef CTypes::orderenums_type base; 00072 00074 00075 typedef CTypes::ordercode_type ordercode_type; 00076 typedef CTypes::manager_type manager_type; 00077 typedef CTypes::manager_reference manager_reference; 00078 typedef CTypes::manager_ptr manager_ptr; 00079 typedef CTypes::dd_type dd_type; 00080 typedef CTypes::vartext_type vartext_type; 00082 00084 typedef std::vector<idx_type> block_idx_type; 00085 00087 typedef block_idx_type::const_iterator block_iterator; 00088 00089 //------------------------------------------------------------------------- 00090 // constructors and destructor 00091 //------------------------------------------------------------------------- 00092 00094 using base::ordercodes; 00095 00097 static dd_type variable(idx_type idx); 00098 00100 static dd_type persistentVariable(idx_type idx); 00101 00103 static ordercode_type getOrderCode(); 00104 00107 static ordercode_type getBaseOrderCode(); 00108 00110 static dd_type zero(); 00111 00113 static dd_type one(); 00114 00116 static size_type nVariables(); 00117 00118 typedef BoolePolyRing ring_type; 00119 00120 typedef CDynamicOrderBase order_type; 00121 #ifdef PBORI_ENV_RING_NOTINLINED 00122 static ring_type& ring(); 00123 #else 00124 static ring_type& ring() { 00125 return active_ring; 00126 } 00127 #endif 00128 static manager_type& manager(); 00129 static order_type& ordering(); 00131 static void setVariableName(idx_type idx, vartext_type varname); 00132 00134 static vartext_type getVariableName(idx_type idx); 00135 00137 00138 static block_iterator blockBegin(); 00139 static block_iterator blockEnd(); 00140 static void appendBlock(idx_type idx); 00141 static void clearBlocks(); 00142 00143 static idx_type lastBlockStart(); 00145 00147 static void changeOrdering(ordercode_type code); 00148 00149 static void printInfo(); 00150 00151 static void set(ring_type& theRing); 00152 00153 00154 protected: 00155 00156 00157 }; 00158 00160 00161 END_NAMESPACE_PBORI 00162 00163 #endif // of #ifndef BooleEnv_h_