BooleVariable.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_BooleVariable_h_
#define polybori_BooleVariable_h_
// include basic definitions
#include <polybori/pbori_defs.h>
// get BoolePolynomial's definition
#include <polybori/BooleEnv.h>
#include <polybori/BoolePolynomial.h>
#include <polybori/BooleSet.h>
BEGIN_NAMESPACE_PBORI
class BooleVariable:
public CAuxTypes {
typedef BooleVariable self;
public:
typedef BooleSet set_type;
typedef BoolePolyRing ring_type;
BooleVariable(idx_type idx, const ring_type& ring):
m_poly( ring.variableDiagram(idx) ) {}
BooleVariable(const ring_type& ring):
m_poly( ring.variableDiagram(0) ) {}
BooleVariable(const self& rhs):
m_poly(rhs.m_poly) {}
operator const BoolePolynomial&() const { return m_poly; }
idx_type index() const { return *m_poly.firstBegin(); }
bool operator== (const self& other) const{
return m_poly==other.m_poly;
}
// Nonequality check
bool operator!= (const self& other) const{
return m_poly!=other.m_poly;
}
hash_type stableHash() const{ return m_poly.stableHash(); }
hash_type hash() const { return m_poly.hash(); }
set_type set() const { return m_poly.set(); }
const ring_type& ring() const { return m_poly.ring(); }
private:
friend class BoolePolyRing;
BooleVariable(const BoolePolynomial& poly):m_poly(poly){}
BoolePolynomial m_poly;
};
inline BoolePolynomial
operator/(const BooleVariable& lhs, const BooleVariable& rhs) {
return BoolePolynomial(BooleConstant(lhs == rhs), lhs.ring());
}
END_NAMESPACE_PBORI
#endif // of polybori_BooleVariable_h_
END_NAMESPACE_PBORI
#define END_NAMESPACE_PBORI
Finish project's namespace.
Definition: pbori_defs.h:77
polybori::BooleVariable::ring_type
BoolePolyRing ring_type
Type for Boolean polynomial rings (without ordering)
Definition: BooleVariable.h:51
BEGIN_NAMESPACE_PBORI
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
BooleSet.h
polybori::BooleVariable::BooleVariable
BooleVariable(const self &rhs)
Copy constructor.
Definition: BooleVariable.h:67
polybori::BoolePolyRing
This class reinterprets decicion diagram managers as Boolean polynomial rings, adds an ordering and v...
Definition: BoolePolyRing.h:40
polybori::CAuxTypes
This struct contains auxiliary type definitions.
Definition: pbori_defs.h:210
polybori::BooleVariable::index
idx_type index() const
Get index of the variable.
Definition: BooleVariable.h:74
polybori::operator==
BoolePolynomial::bool_type operator==(BoolePolynomial::bool_type lhs, const BoolePolynomial &rhs)
Equality check (with constant lhs)
Definition: BoolePolynomial.h:579
polybori::BoolePolynomial
This class wraps the underlying decicion diagram type and defines the necessary operations.
Definition: BoolePolynomial.h:85
polybori::BooleVariable::stableHash
hash_type stableHash() const
Hash value of the variable.
Definition: BooleVariable.h:87
polybori::CAuxTypes::hash_type
std::size_t hash_type
Type for hashing.
Definition: pbori_defs.h:231
pbori_defs.h
BoolePolynomial.h
polybori::BooleVariable::set_type
BooleSet set_type
Type of sets of Boolean variables.
Definition: BooleVariable.h:48
polybori::BooleVariable::ring
const ring_type & ring() const
Access ring, where this belongs to.
Definition: BooleVariable.h:96
polybori::CAuxTypes::idx_type
int idx_type
Type for indices.
Definition: pbori_defs.h:228
polybori::operator/
BoolePolynomial operator/(const BooleVariable &lhs, const BooleVariable &rhs)
Division.
Definition: BooleVariable.h:108
polybori::BooleVariable::hash
hash_type hash() const
Get unique hash value (valid only per runtime)
Definition: BooleVariable.h:90
polybori::BooleVariable::set
set_type set() const
Convert to Boolean set.
Definition: BooleVariable.h:93
polybori::BooleVariable::BooleVariable
BooleVariable(const ring_type &ring)
Construct first variable of a given ring.
Definition: BooleVariable.h:63
polybori::operator!=
BoolePolynomial::bool_type operator!=(BoolePolynomial::bool_type lhs, const BoolePolynomial &rhs)
Nonquality check (with constant lhs)
Definition: BoolePolynomial.h:586
polybori::BooleSet
Definition: BooleSet.h:57
polybori::BooleConstant
This class wraps a bool value, which was not converted to a boolean polynomial or monomial yet...
Definition: BooleConstant.h:40
polybori::BooleVariable
This class is just a wrapper for using variables from cudd's decicion diagram.
Definition: BooleVariable.h:39
BooleEnv.h