60 struct hash<
carl::BVUnaryContent> {
66 struct hash<
carl::BVBinaryContent> {
72 struct hash<
carl::BVExtractContent> {
82 using ContentType = std::variant<BVVariable, BVValue, BVUnaryContent, BVBinaryContent, BVExtractContent>;
91 return std::hash<ContentType>()(
mContent);
96 assert(std::holds_alternative<T>(
mContent));
152 assert(_highest < _operand.
width() && _highest >= _lowest);
155 std::size_t
id()
const {
177 [&vars](
const BVVariable& v){ vars.insert(v); },
179 [&vars](
const BVUnaryContent& c){ c.mOperand.gatherBVVariables(vars); },
181 c.mFirst.gatherBVVariables(vars);
182 c.mSecond.gatherBVVariables(vars);
194 return as<BVExtractContent>().mHighest - as<BVExtractContent>().mLowest + as<BVExtractContent>().mOperand.complexity();
196 return width() + as<BVUnaryContent>().mOperand.complexity();
198 return width() + as<BVBinaryContent>().mFirst.complexity() + as<BVBinaryContent>().mSecond.complexity();
210 if (lhs.
id() != 0 && rhs.
id() != 0)
return lhs.
id() == rhs.
id();
214 if (lhs.
id() != 0 && rhs.
id() != 0)
return lhs.
id() < rhs.
id();
225 return os <<
"%invalid%";
227 switch (term.
type()) {
234 return os << term.
type() <<
"_{" << ex.mHighest <<
"," << ex.mLowest <<
"}(" << ex.mOperand <<
")";
242 return os << term.
type() <<
"_" << un.mIndex <<
"(" << un.mOperand <<
")";
249 return os << term.
type() <<
"(" << bi.mFirst <<
", " << bi.mSecond <<
")";
261 struct hash<
carl::BVTermContent> {
carl is the main namespace for the library.
bool typeIsUnary(BVTermType type)
bool operator<(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
bool typeIsBinary(BVTermType type)
std::ostream & operator<<(std::ostream &os, const BasicConstraint< Poly > &c)
Prints the given constraint on the given stream.
void visit(const Formula< Pol > &formula, Visitor func)
Recursively calls func on every subformula.
bool operator==(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
std::size_t hash_all(Args &&... args)
Hashes an arbitrary number of values.
std::size_t width() const
bool operator<(const BVUnaryContent &rhs) const
bool operator==(const BVUnaryContent &rhs) const
BVUnaryContent(BVTerm operand, std::size_t index=0)
BVBinaryContent(BVTerm first, BVTerm second)
bool operator==(const BVBinaryContent &rhs) const
bool operator<(const BVBinaryContent &rhs) const
bool operator<(const BVExtractContent &rhs) const
BVExtractContent(BVTerm _operand, std::size_t _highest, std::size_t _lowest)
bool operator==(const BVExtractContent &rhs) const
std::size_t operator()(const carl::BVUnaryContent &uc) const
std::size_t operator()(const carl::BVBinaryContent &bc) const
std::size_t operator()(const carl::BVExtractContent &ec) const
std::size_t width() const
std::size_t computeHash() const
BVTermContent(BVTermType type, BVValue &&value)
const auto & content() const
void gatherBVVariables(std::set< BVVariable > &vars) const
BVTermContent(BVTermType type, const BVTerm &_first, const BVTerm &_second)
BVTermContent(BVTermType type, const BVTerm &_operand, std::size_t _highest, std::size_t _lowest)
BVTermContent(BVTermType type, const BVTerm &_operand, std::size_t _index=0)
std::variant< BVVariable, BVValue, BVUnaryContent, BVBinaryContent, BVExtractContent > ContentType
std::size_t complexity() const
BVTermContent(BVTermType type, const BVVariable &variable)
std::size_t operator()(const carl::BVTermContent &tc) const
Represent a BitVector-Variable.